Files
openfoam/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H

223 lines
5.9 KiB
C++

/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Namespace
Foam::incompressible::turbulenceModels
Description
Namespace for incompressible turbulence turbulence models.
Class
Foam::incompressible::turbulenceModel
Description
Abstract base class for incompressible turbulence models
(RAS, LES and laminar).
SourceFiles
turbulenceModel.C
newTurbulenceModel.C
\*---------------------------------------------------------------------------*/
#ifndef turbulenceModel_H
#define turbulenceModel_H
#include "primitiveFieldsFwd.H"
#include "volFieldsFwd.H"
#include "surfaceFieldsFwd.H"
#include "fvMatricesFwd.H"
#include "incompressible/transportModel/transportModel.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declarations
class fvMesh;
namespace incompressible
{
/*---------------------------------------------------------------------------*\
Class turbulenceModel Declaration
\*---------------------------------------------------------------------------*/
class turbulenceModel
{
protected:
// Protected data
const Time& runTime_;
const fvMesh& mesh_;
const volVectorField& U_;
const surfaceScalarField& phi_;
transportModel& transportModel_;
private:
// Private Member Functions
//- Disallow default bitwise copy construct
turbulenceModel(const turbulenceModel&);
//- Disallow default bitwise assignment
void operator=(const turbulenceModel&);
public:
// Public data
//- Standard value for turbulence constant %Cmu
static const scalar standardCmu = 0.09;
//- Standard value for turbulence constant %kappa
static const scalar standardKappa = 0.41;
//- Standard value for turbulence constant %E
static const scalar standardE = 9.8;
//- Runtime type information
TypeName("turbulenceModel");
// Declare run-time New selection table
declareRunTimeNewSelectionTable
(
autoPtr,
turbulenceModel,
turbulenceModel,
(
const volVectorField& U,
const surfaceScalarField& phi,
transportModel& lamTransportModel
),
(U, phi, lamTransportModel)
);
// Constructors
//- Construct from components
turbulenceModel
(
const volVectorField& U,
const surfaceScalarField& phi,
transportModel& lamTransportModel
);
// Selectors
//- Return a reference to the selected turbulence model
static autoPtr<turbulenceModel> New
(
const volVectorField& U,
const surfaceScalarField& phi,
transportModel& lamTransportModel
);
//- Destructor
virtual ~turbulenceModel()
{}
// Member Functions
//- Access function to velocity field
inline const volVectorField& U() const
{
return U_;
}
//- Access function to flux field
inline const surfaceScalarField& phi() const
{
return phi_;
}
//- Access function to incompressible transport model
inline transportModel& transport() const
{
return transportModel_;
}
//- Return the laminar viscosity
const volScalarField& nu() const
{
return transportModel_.nu();
}
//- Return the turbulence viscosity
virtual tmp<volScalarField> nut() const = 0;
//- Return the effective viscosity
virtual tmp<volScalarField> nuEff() const = 0;
//- Return the turbulence kinetic energy
virtual tmp<volScalarField> k() const = 0;
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const = 0;
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const = 0;
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devReff() const = 0;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0;
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct() = 0;
//- Read turbulenceProperties dictionary
virtual bool read() = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace incompressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //