This commit is contained in:
mattijs
2008-11-24 16:42:44 +00:00
175 changed files with 1442 additions and 1838 deletions

View File

@ -11,11 +11,13 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/turbulenceModels/RAS/compressible/lnInclude
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude
LIB_LIBS = \
-llagrangian \
-lfiniteVolume \
-lpdf \
-lliquids \
-lliquidMixture \
@ -24,4 +26,6 @@ LIB_LIBS = \
-lspecie \
-lbasicThermophysicalModels \
-lcombustionThermophysicalModels \
-lcompressibleRASModels
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume

View File

@ -3,19 +3,18 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/turbulenceModels/RAS \
-I$(LIB_SRC)/turbulenceModels/LES \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
LIB_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lsampling \
-lincompressibleTransportModels \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
-lcompressibleLESModels
-lcompressibleLESModels \
-lfiniteVolume \
-lmeshTools \
-lsampling

View File

@ -30,11 +30,12 @@ License
#include "Time.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "incompressible/RASModel/RASModel.H"
#include "incompressible/LESModel/LESModel.H"
#include "incompressible/RAS/RASModel/RASModel.H"
#include "incompressible/LES/LESModel/LESModel.H"
#include "basicThermo.H"
#include "compressible/RASModel/RASModel.H"
#include "compressible/LESModel/LESModel.H"
#include "compressible/RAS/RASModel/RASModel.H"
#include "compressible/LES/LESModel/LESModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -79,10 +79,10 @@ public:
// Constructors
//- from components
//- Construct from components
anisotropicFilter(const fvMesh& mesh, scalar widthCoeff);
//- from IOdictionary
//- Construct from IOdictionary
anisotropicFilter(const fvMesh& mesh, const dictionary&);

View File

@ -80,10 +80,10 @@ public:
// Constructors
//- from components
//- Construct from components
laplaceFilter(const fvMesh& mesh, scalar widthCoeff);
//- from IOdictionary
//- Construct from IOdictionary
laplaceFilter(const fvMesh& mesh, const dictionary&);

View File

@ -69,10 +69,10 @@ public:
// Constructors
//- from components
//- Construct from components
simpleFilter(const fvMesh& mesh);
//- from IOdictionary
//- Construct from IOdictionary
simpleFilter(const fvMesh& mesh, const dictionary&);

View File

@ -2,7 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory
set -x
#wmake libso turbulenceModel
wmake libso turbulenceModel
wmake libso RAS
wmake libso LES

View File

@ -43,7 +43,6 @@ addToRunTimeSelectionTable(LESModel, DeardorffDiffStress, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from components
DeardorffDiffStress::DeardorffDiffStress
(
const volScalarField& rho,

View File

@ -103,10 +103,9 @@ public:
);
// Destructor
~DeardorffDiffStress()
{}
//- Destructor
virtual ~DeardorffDiffStress()
{}
// Member Functions
@ -121,10 +120,10 @@ public:
}
//- Correct Eddy-Viscosity and related properties
void correct(const tmp<volTensorField>& gradU);
virtual void correct(const tmp<volTensorField>& gradU);
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -37,7 +37,6 @@ namespace LESModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from components
GenEddyVisc::GenEddyVisc
(
const volScalarField& rho,
@ -86,9 +85,7 @@ GenEddyVisc::GenEddyVisc
),
mesh_
)
{
// printCoeffs();
}
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -88,10 +88,9 @@ public:
);
// Destructor
virtual ~GenEddyVisc()
{}
//- Destructor
virtual ~GenEddyVisc()
{}
// Member Functions
@ -138,7 +137,7 @@ public:
virtual void correct(const tmp<volTensorField>& gradU);
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -37,7 +37,6 @@ namespace LESModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from components
GenSGSStress::GenSGSStress
(
const volScalarField& rho,
@ -90,9 +89,7 @@ GenSGSStress::GenSGSStress
),
mesh_
)
{
// printCoeffs();
}
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -89,10 +89,9 @@ public:
);
// Destructor
virtual ~GenSGSStress()
{}
//- Destructor
virtual ~GenSGSStress()
{}
// Member Functions
@ -143,7 +142,7 @@ public:
virtual void correct(const tmp<volTensorField>& gradU);
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/
#include "LESModel.H"
#include "wallDist.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -61,6 +61,8 @@ LESModel::LESModel
const basicThermo& thermoPhysicalModel
)
:
turbulenceModel(rho, U, phi, thermoPhysicalModel),
IOdictionary
(
IOobject
@ -73,14 +75,6 @@ LESModel::LESModel
)
),
runTime_(U.time()),
mesh_(U.mesh()),
rho_(rho),
U_(U),
phi_(phi),
thermoPhysicalModel_(thermoPhysicalModel),
printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)),
coeffDict_(subDict(type + "Coeffs")),

View File

@ -43,13 +43,13 @@ Description
SourceFiles
LESModel.C
newLESModel.C
\*---------------------------------------------------------------------------*/
#ifndef compressibleLESModel_H
#define compressibleLESModel_H
#include "compressible/turbulenceModel/turbulenceModel.H"
#include "LESdelta.H"
#include "fvm.H"
#include "fvc.H"
@ -72,6 +72,7 @@ namespace compressible
class LESModel
:
public turbulenceModel,
public IOdictionary
{
@ -79,20 +80,6 @@ protected:
// Protected data
const Time& runTime_;
const fvMesh& mesh_;
private:
// Private data
const volScalarField& rho_;
const volVectorField& U_;
const surfaceScalarField& phi_;
const basicThermo& thermoPhysicalModel_;
Switch printCoeffs_;
dictionary coeffDict_;
@ -101,21 +88,23 @@ private:
autoPtr<LESdelta> delta_;
// Private Member Functions
// Disallow default bitwise copy construct and assignment
LESModel(const LESModel&);
LESModel& operator=(const LESModel&);
protected:
// Protected Member Functions
//- Print model coefficients
virtual void printCoeffs();
private:
// Private Member Functions
//- Disallow default bitwise copy construct
LESModel(const LESModel&);
//- Disallow default bitwise assignment
LESModel& operator=(const LESModel&);
public:
//- Runtime type information
@ -164,76 +153,37 @@ public:
);
// Destructor
virtual ~LESModel()
{}
//- Destructor
virtual ~LESModel()
{}
// Member Functions
// Access
//- Access the dictionary which provides info. about choice of
// models, and all related data (particularly model coefficients).
inline dictionary& coeffDict()
{
return coeffDict_;
}
//- Access function to the density field
inline const volScalarField& rho() const
{
return rho_;
}
//- Access function to filter width
inline const volScalarField& delta() const
{
return delta_();
}
//- Access function to velocity field
inline const volVectorField& U() const
{
return U_;
}
//- Return the value of k0 which k is not allowed to be less than
const dimensionedScalar& k0() const
{
return k0_;
}
//- Access function to flux field
inline const surfaceScalarField& phi() const
{
return phi_;
}
//- Access function to the thermophysical properties model
inline const basicThermo& thermo() const
{
return thermoPhysicalModel_;
}
//- Access the dictionary which provides info. about choice of
// models, and all related data (particularly model coefficients).
inline dictionary& coeffDict()
{
return coeffDict_;
}
//- Access function to filter width
inline const volScalarField& delta() const
{
return delta_();
}
//- Return the value of k0 which k is not allowed to be less than
const dimensionedScalar& k0() const
{
return k0_;
}
//- Allow k0 to be changed
dimensionedScalar& k0()
{
return k0_;
}
//- Access function to laminar viscosity
tmp<volScalarField> mu() const
{
return thermoPhysicalModel_.mu();
}
//- Access function to laminar thermal conductivity
tmp<volScalarField> alpha() const
{
return thermoPhysicalModel_.alpha();
}
//- Allow k0 to be changed
dimensionedScalar& k0()
{
return k0_;
}
//- Return the SGS turbulent kinetic energy.
@ -268,6 +218,34 @@ public:
// This is the additional term due to the filtering of the NSE.
virtual tmp<fvVectorMatrix> divDevRhoBeff(volVectorField& U) const = 0;
// RAS compatibility functions for the turbulenceModel base class
//- Return the turbulence viscosity
virtual tmp<volScalarField> mut() const
{
return muSgs();
}
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const
{
return B();
}
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devRhoReff() const
{
return devRhoBeff();
}
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const
{
return divDevRhoBeff(U);
}
//- Correct Eddy-Viscosity and related properties.
// This calls correct(const tmp<volTensorField>& gradU) by supplying
// gradU calculated locally.

View File

@ -1,11 +1,14 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/turbulenceModels/LES/LESfilters/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I../../LES/LESdeltas/lnInclude \
-I../../LES/LESfilters/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-lcompressibleTurbulenceModel \
-lLESdeltas \
-lLESfilters \
-lfiniteVolume \
-lmeshTools

View File

@ -43,7 +43,6 @@ addToRunTimeSelectionTable(LESModel, Smagorinsky, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from components
Smagorinsky::Smagorinsky
(
const volScalarField& rho,

View File

@ -98,19 +98,18 @@ public:
);
// Destructor
~Smagorinsky()
{}
//- Destructor
virtual ~Smagorinsky()
{}
// Member Functions
//- Correct Eddy-Viscosity and related properties
void correct(const tmp<volTensorField>& gradU);
virtual void correct(const tmp<volTensorField>& gradU);
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -106,36 +106,35 @@ public:
);
// Destructor
~SpalartAllmaras()
{}
//- Destructor
virtual ~SpalartAllmaras()
{}
// Member Functions
//- Return SGS kinetic energy
tmp<volScalarField> k() const
{
return sqr(muSgs()/rho()/ck_/dTilda_);
}
//- Return sub-grid disipation rate
tmp<volScalarField> epsilon() const;
tmp<volScalarField> nuTilda() const
{
return nuTilda_;
}
//- Return SGS kinetic energy
virtual tmp<volScalarField> k() const
{
return sqr(muSgs()/rho()/ck_/dTilda_);
}
//- Return sub-grid disipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return SGS viscosity
tmp<volScalarField> muSgs() const
virtual tmp<volScalarField> muSgs() const
{
return muSgs_;
}
//- Return thermal conductivity
tmp<volScalarField> alphaEff() const
virtual tmp<volScalarField> alphaEff() const
{
return tmp<volScalarField>
(
@ -152,13 +151,13 @@ public:
//- Returns div(rho*dev(B)).
// This is the additional term due to the filtering of the NSE.
tmp<fvVectorMatrix> divDevRhoBeff(volVectorField& U) const;
virtual tmp<fvVectorMatrix> divDevRhoBeff(volVectorField& U) const;
//- Correct nuTilda and related properties
void correct(const tmp<volTensorField>& gradU);
virtual void correct(const tmp<volTensorField>& gradU);
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -76,7 +76,6 @@ dimensionedScalar dynOneEqEddy::ce_(const volSymmTensorField& D) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from components
dynOneEqEddy::dynOneEqEddy
(
const volScalarField& rho,
@ -95,12 +94,6 @@ dynOneEqEddy::dynOneEqEddy
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
dynOneEqEddy::~dynOneEqEddy()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU)

View File

@ -110,8 +110,8 @@ public:
// Destructor
~dynOneEqEddy();
virtual ~dynOneEqEddy()
{}
// Member Functions
@ -119,17 +119,17 @@ public:
//- Return the effective diffusivity for k
tmp<volScalarField> DkEff() const
{
return tmp<volScalarField>
return tmp<volScalarField>
(
new volScalarField("DkEff", muSgs_ + mu())
);
}
//- Correct Eddy-Viscosity and related properties
void correct(const tmp<volTensorField>& gradU);
virtual void correct(const tmp<volTensorField>& gradU);
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -43,7 +43,6 @@ addToRunTimeSelectionTable(LESModel, lowReOneEqEddy, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from components
lowReOneEqEddy::lowReOneEqEddy
(
const volScalarField& rho,

View File

@ -100,10 +100,9 @@ public:
);
// Destructor
~lowReOneEqEddy()
{}
//- Destructor
virtual ~lowReOneEqEddy()
{}
// Member Functions
@ -118,10 +117,10 @@ public:
}
//- Correct Eddy-Viscosity and related properties
void correct(const tmp<volTensorField>& gradU);
virtual void correct(const tmp<volTensorField>& gradU);
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -104,9 +104,8 @@ public:
// Destructor
~oneEqEddy()
{}
virtual ~oneEqEddy()
{}
// Member Functions
@ -121,10 +120,10 @@ public:
}
//- Correct Eddy-Viscosity and related properties
void correct(const tmp<volTensorField>& gradU);
virtual void correct(const tmp<volTensorField>& gradU);
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -46,13 +46,12 @@ addToRunTimeSelectionTable(RASModel, LRR, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from components
LRR::LRR
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),

View File

@ -107,29 +107,23 @@ public:
// Constructors
//- from components
//- Construct from components
LRR
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
);
// Destructor
~LRR(){}
//- Destructor
virtual ~LRR()
{}
// Member Functions
//- Return the turbulence viscosity
tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective diffusivity for R
tmp<volScalarField> DREff() const
{
@ -148,8 +142,14 @@ public:
);
}
//- Return the turbulence viscosity
virtual tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective turbulent thermal diffusivity
tmp<volScalarField> alphaEff() const
virtual tmp<volScalarField> alphaEff() const
{
return tmp<volScalarField>
(
@ -158,34 +158,34 @@ public:
}
//- Return the turbulence kinetic energy
tmp<volScalarField> k() const
virtual tmp<volScalarField> k() const
{
return k_;
}
//- Return the turbulence kinetic energy dissipation rate
tmp<volScalarField> epsilon() const
virtual tmp<volScalarField> epsilon() const
{
return epsilon_;
}
//- Return the Reynolds stress tensor
tmp<volSymmTensorField> R() const
virtual tmp<volSymmTensorField> R() const
{
return R_;
}
//- Return the effective stress tensor including the laminar stress
tmp<volSymmTensorField> devRhoReff() const;
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the source term for the momentum equation
tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
//- Solve the turbulence equations and correct the turbulence viscosity
void correct();
virtual void correct();
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -48,13 +48,12 @@ addToRunTimeSelectionTable(RASModel, LaunderGibsonRSTM, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from components
LaunderGibsonRSTM::LaunderGibsonRSTM
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),

View File

@ -114,31 +114,23 @@ public:
// Constructors
//- from components
//- Construct from components
LaunderGibsonRSTM
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
);
// Destructor
~LaunderGibsonRSTM(){}
//- Destructor
virtual ~LaunderGibsonRSTM()
{}
// Member Functions
// Access
//- Return the turbulence viscosity
tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective diffusivity for R
tmp<volScalarField> DREff() const
{
@ -157,8 +149,14 @@ public:
);
}
//- Return the turbulence viscosity
virtual tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective turbulent thermal diffusivity
tmp<volScalarField> alphaEff() const
virtual tmp<volScalarField> alphaEff() const
{
return tmp<volScalarField>
(
@ -167,34 +165,34 @@ public:
}
//- Return the turbulence kinetic energy
tmp<volScalarField> k() const
virtual tmp<volScalarField> k() const
{
return k_;
}
//- Return the turbulence kinetic energy dissipation rate
tmp<volScalarField> epsilon() const
virtual tmp<volScalarField> epsilon() const
{
return epsilon_;
}
//- Return the Reynolds stress tensor
tmp<volSymmTensorField> R() const
virtual tmp<volSymmTensorField> R() const
{
return R_;
}
//- Return the effective stress tensor including the laminar stress
tmp<volSymmTensorField> devRhoReff() const;
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the source term for the momentum equation
tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
//- Solve the turbulence equations and correct the turbulence viscosity
void correct();
virtual void correct();
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -60,13 +60,12 @@ tmp<volScalarField> LaunderSharmaKE::f2() const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from components
LaunderSharmaKE::LaunderSharmaKE
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),

View File

@ -99,29 +99,23 @@ public:
// Constructors
//- from components
//- Construct from components
LaunderSharmaKE
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
);
// Destructor
~LaunderSharmaKE(){}
//- Destructor
virtual ~LaunderSharmaKE()
{}
// Member Functions
//- Return the turbulence viscosity
tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective diffusivity for k
tmp<volScalarField> DkEff() const
{
@ -140,8 +134,14 @@ public:
);
}
//- Return the turbulence viscosity
virtual tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective turbulent thermal diffusivity
tmp<volScalarField> alphaEff() const
virtual tmp<volScalarField> alphaEff() const
{
return tmp<volScalarField>
(
@ -150,31 +150,31 @@ public:
}
//- Return the turbulence kinetic energy
tmp<volScalarField> k() const
virtual tmp<volScalarField> k() const
{
return k_;
}
//- Return the turbulence kinetic energy dissipation rate
tmp<volScalarField> epsilon() const
virtual tmp<volScalarField> epsilon() const
{
return epsilon_;
}
//- Return the Reynolds stress tensor
tmp<volSymmTensorField> R() const;
virtual tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
tmp<volSymmTensorField> devRhoReff() const;
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the source term for the momentum equation
tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
//- Solve the turbulence equations and correct the turbulence viscosity
void correct();
virtual void correct();
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -1,8 +1,10 @@
EXE_INC = \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
LIB_LIBS = \
-lcompressibleTurbulenceModel \
-lfiniteVolume \
-lmeshTools

View File

@ -25,9 +25,8 @@ License
\*---------------------------------------------------------------------------*/
#include "RASModel.H"
#include "wallDist.H"
#include "wallFvPatch.H"
#include "fixedValueFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -61,9 +60,11 @@ RASModel::RASModel
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
)
:
turbulenceModel(rho, U, phi, thermophysicalModel),
IOdictionary
(
IOobject
@ -76,14 +77,6 @@ RASModel::RASModel
)
),
runTime_(U.time()),
mesh_(U.mesh()),
rho_(rho),
U_(U),
phi_(phi),
thermophysicalModel_(thermophysicalModel),
turbulence_(lookup("turbulence")),
printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)),
coeffDict_(subDict(type + "Coeffs")),

View File

@ -45,6 +45,7 @@ SourceFiles
#ifndef compressibleRASModel_H
#define compressibleRASModel_H
#include "compressible/turbulenceModel/turbulenceModel.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "nearWallDist.H"
@ -71,6 +72,7 @@ namespace compressible
class RASModel
:
public turbulenceModel,
public IOdictionary
{
@ -78,15 +80,6 @@ protected:
// Protected data
const Time& runTime_;
const fvMesh& mesh_;
const volScalarField& rho_;
const volVectorField& U_;
const surfaceScalarField& phi_;
basicThermo& thermophysicalModel_;
Switch turbulence_;
Switch printCoeffs_;
dictionary coeffDict_;
@ -111,12 +104,6 @@ protected:
//- Print model coefficients
virtual void printCoeffs();
//- Return the laminar thermal conductivity
const volScalarField& alpha() const
{
return thermophysicalModel_.alpha();
}
private:
@ -146,7 +133,7 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel
),
(rho, U, phi, thermoPhysicalModel)
);
@ -161,7 +148,7 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel
);
@ -173,14 +160,13 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel
);
// Destructor
virtual ~RASModel()
{}
//- Destructor
virtual ~RASModel()
{}
// Member Functions
@ -280,12 +266,6 @@ public:
}
//- Return the laminar viscosity
const volScalarField& mu() const
{
return thermophysicalModel_.mu();
}
//- Return the turbulence viscosity
virtual tmp<volScalarField> mut() const = 0;

View File

@ -40,7 +40,7 @@ autoPtr<RASModel> RASModel::New
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
)
{
word RASModelTypeName;

View File

@ -46,13 +46,12 @@ addToRunTimeSelectionTable(RASModel, RNGkEpsilon, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from components
RNGkEpsilon::RNGkEpsilon
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),

View File

@ -97,29 +97,23 @@ public:
// Constructors
//- from components
//- Construct from components
RNGkEpsilon
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
);
// Destructor
~RNGkEpsilon(){}
//- Destructor
virtual ~RNGkEpsilon()
{}
// Member Functions
//- Return the turbulence viscosity
tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective diffusivity for k
tmp<volScalarField> DkEff() const
{
@ -138,8 +132,14 @@ public:
);
}
//- Return the turbulence viscosity
virtual tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective turbulent thermal diffusivity
tmp<volScalarField> alphaEff() const
virtual tmp<volScalarField> alphaEff() const
{
return tmp<volScalarField>
(
@ -148,31 +148,31 @@ public:
}
//- Return the turbulence kinetic energy
tmp<volScalarField> k() const
virtual tmp<volScalarField> k() const
{
return k_;
}
//- Return the turbulence kinetic energy dissipation rate
tmp<volScalarField> epsilon() const
virtual tmp<volScalarField> epsilon() const
{
return epsilon_;
}
//- Return the Reynolds stress tensor
tmp<volSymmTensorField> R() const;
virtual tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
tmp<volSymmTensorField> devRhoReff() const;
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the effective stress tensor including the laminar stress
tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
//- Solve the turbulence equations and correct the turbulence viscosity
void correct();
virtual void correct();
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -110,7 +110,7 @@ SpalartAllmaras::SpalartAllmaras
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),

View File

@ -132,30 +132,23 @@ public:
// Constructors
//- from components
//- Construct from components
SpalartAllmaras
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
);
// Destructor
~SpalartAllmaras()
{}
//- Destructor
virtual ~SpalartAllmaras()
{}
// Member Functions
//- Return the turbulence viscosity
tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective diffusivity for nuTilda
tmp<volScalarField> DnuTildaEff() const
{
@ -168,8 +161,15 @@ public:
)
);
}
//- Return the effective turbulent thermal diffusivity
tmp<volScalarField> alphaEff() const
//- Return the turbulence viscosity
virtual tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective turbulent thermal diffusivity
virtual tmp<volScalarField> alphaEff() const
{
return tmp<volScalarField>
(
@ -178,7 +178,7 @@ public:
}
//- Return the turbulence kinetic energy
tmp<volScalarField> k() const
virtual tmp<volScalarField> k() const
{
return tmp<volScalarField>
(
@ -197,7 +197,7 @@ public:
}
//- Return the turbulence kinetic energy dissipation rate
tmp<volScalarField> epsilon() const
virtual tmp<volScalarField> epsilon() const
{
return tmp<volScalarField>
(
@ -216,19 +216,19 @@ public:
}
//- Return the Reynolds stress tensor
tmp<volSymmTensorField> R() const;
virtual tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
tmp<volSymmTensorField> devRhoReff() const;
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the source term for the momentum equation
tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
//- Solve the turbulence equations and correct the turbulence viscosity
void correct();
virtual void correct();
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -51,7 +51,7 @@ kEpsilon::kEpsilon
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),

View File

@ -97,30 +97,23 @@ public:
// Constructors
//- from components
//- Construct from components
kEpsilon
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
);
// Destructor
~kEpsilon()
{}
//- Destructor
virtual ~kEpsilon()
{}
// Member Functions
//- Return the turbulence viscosity
tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective diffusivity for k
tmp<volScalarField> DkEff() const
{
@ -139,8 +132,14 @@ public:
);
}
//- Return the turbulence viscosity
virtual tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective turbulent thermal diffusivity
tmp<volScalarField> alphaEff() const
virtual tmp<volScalarField> alphaEff() const
{
return tmp<volScalarField>
(
@ -149,31 +148,31 @@ public:
}
//- Return the turbulence kinetic energy
tmp<volScalarField> k() const
virtual tmp<volScalarField> k() const
{
return k_;
}
//- Return the turbulence kinetic energy dissipation rate
tmp<volScalarField> epsilon() const
virtual tmp<volScalarField> epsilon() const
{
return epsilon_;
}
//- Return the Reynolds stress tensor
tmp<volSymmTensorField> R() const;
virtual tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
tmp<volSymmTensorField> devRhoReff() const;
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the source term for the momentum equation
tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
//- Solve the turbulence equations and correct the turbulence viscosity
void correct();
virtual void correct();
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -94,7 +94,7 @@ kOmegaSST::kOmegaSST
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),

View File

@ -199,23 +199,17 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
);
// Destructor
~kOmegaSST()
{}
//- Destructor
virtual ~kOmegaSST()
{}
// Member Functions
tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective diffusivity for k
tmp<volScalarField> DkEff(const volScalarField& F1) const
{
@ -234,8 +228,13 @@ public:
);
}
virtual tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective turbulent thermal diffusivity
tmp<volScalarField> alphaEff() const
virtual tmp<volScalarField> alphaEff() const
{
return tmp<volScalarField>
(
@ -244,18 +243,18 @@ public:
}
//- Return the turbulence kinetic energy
tmp<volScalarField> k() const
virtual tmp<volScalarField> k() const
{
return k_;
}
tmp<volScalarField> omega() const
virtual tmp<volScalarField> omega() const
{
return omega_;
}
//- Return the turbulence kinetic energy dissipation rate
tmp<volScalarField> epsilon() const
virtual tmp<volScalarField> epsilon() const
{
return tmp<volScalarField>
(
@ -274,19 +273,19 @@ public:
}
//- Return the Reynolds stress tensor
tmp<volSymmTensorField> R() const;
virtual tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
tmp<volSymmTensorField> devRhoReff() const;
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the source term for the momentum equation
tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
//- Solve the turbulence equations and correct the turbulence viscosity
void correct();
virtual void correct();
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -48,7 +48,7 @@ laminar::laminar
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel)
@ -171,7 +171,8 @@ tmp<fvVectorMatrix> laminar::divDevRhoReff(volVectorField& U) const
{
return
(
- fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
- fvm::laplacian(muEff(), U)
- fvc::div(muEff()*dev2(fvc::grad(U)().T()))
);
}

View File

@ -64,20 +64,19 @@ public:
// Constructors
//- from components
//- Construct from components
laminar
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
);
// Destructor
~laminar()
{}
//- Destructor
virtual ~laminar()
{}
// Member Functions

View File

@ -92,7 +92,7 @@ realizableKE::realizableKE
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),

View File

@ -112,29 +112,23 @@ public:
// Constructors
//- from components
//- Construct from components
realizableKE
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel
);
// Destructor
~realizableKE(){}
//- Destructor
virtual ~realizableKE()
{}
// Member Functions
//- Return the turbulence viscosity
tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective diffusivity for k
tmp<volScalarField> DkEff() const
{
@ -153,8 +147,14 @@ public:
);
}
//- Return the turbulence viscosity
virtual tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the effective turbulent thermal diffusivity
tmp<volScalarField> alphaEff() const
virtual tmp<volScalarField> alphaEff() const
{
return tmp<volScalarField>
(
@ -163,31 +163,31 @@ public:
}
//- Return the turbulence kinetic energy
tmp<volScalarField> k() const
virtual tmp<volScalarField> k() const
{
return k_;
}
//- Return the turbulence kinetic energy dissipation rate
tmp<volScalarField> epsilon() const
virtual tmp<volScalarField> epsilon() const
{
return epsilon_;
}
//- Return the Reynolds stress tensor
tmp<volSymmTensorField> R() const;
virtual tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
tmp<volSymmTensorField> devRhoReff() const;
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the source term for the momentum equation
tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
//- Solve the turbulence equations and correct the turbulence viscosity
void correct();
virtual void correct();
//- Read turbulenceProperties dictionary
bool read();
virtual bool read();
};

View File

@ -0,0 +1,4 @@
turbulenceModel.C
laminar/laminar.C
LIB = $(FOAM_LIBBIN)/libcompressibleTurbulenceModel

View File

@ -0,0 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
LIB_LIBS = \
-lfiniteVolume

View File

@ -0,0 +1,227 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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
\*---------------------------------------------------------------------------*/
#include "laminar.H"
#include "Time.H"
#include "volFields.H"
#include "fvcGrad.H"
#include "fvcDiv.H"
#include "fvmLaplacian.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(laminar, 0);
addToRunTimeSelectionTable(turbulenceModel, laminar, turbulenceModel);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
laminar::laminar
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
)
:
turbulenceModel(rho, U, phi, thermoPhysicalModel)
{}
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
autoPtr<laminar> laminar::New
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
)
{
return autoPtr<laminar>(new laminar(rho, U, phi, thermoPhysicalModel));
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<volScalarField> laminar::mut() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"mut",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("mut", mu().dimensions(), 0.0)
)
);
}
tmp<volScalarField> laminar::muEff() const
{
return tmp<volScalarField>(new volScalarField("muEff", mu()));
}
tmp<volScalarField> laminar::alphaEff() const
{
return tmp<volScalarField>(new volScalarField("alphaEff", alpha()));
}
tmp<volScalarField> laminar::k() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"k",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("k", sqr(U_.dimensions()), 0.0)
)
);
}
tmp<volScalarField> laminar::epsilon() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar
(
"epsilon", sqr(U_.dimensions())/dimTime, 0.0
)
)
);
}
tmp<volSymmTensorField> laminar::R() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
"R",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedSymmTensor
(
"R", sqr(U_.dimensions()), symmTensor::zero
)
)
);
}
tmp<volSymmTensorField> laminar::devRhoReff() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
"devRhoReff",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
-mu()*dev(twoSymm(fvc::grad(U_)))
)
);
}
tmp<fvVectorMatrix> laminar::divDevRhoReff(volVectorField& U) const
{
return
(
- fvm::laplacian(muEff(), U)
- fvc::div(muEff()*dev2(fvc::grad(U)().T()))
);
}
bool laminar::read()
{
return true;
}
void laminar::correct()
{
turbulenceModel::correct();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace incompressible
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,135 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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
Class
Foam::compressible::laminar
Description
Turbulence model for laminar compressible flow.
SourceFiles
laminar.C
\*---------------------------------------------------------------------------*/
#ifndef laminar_H
#define laminar_H
#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
/*---------------------------------------------------------------------------*\
Class laminar Declaration
\*---------------------------------------------------------------------------*/
class laminar
:
public turbulenceModel
{
public:
//- Runtime type information
TypeName("laminar");
// Constructors
//- Construct from components
laminar
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
);
// Selectors
//- Return a reference to the selected turbulence model
static autoPtr<laminar> New
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
);
//- Destructor
virtual ~laminar()
{}
// Member Functions
//- Return the turbulence viscosity, i.e. 0 for laminar flow
virtual tmp<volScalarField> mut() const;
//- Return the effective viscosity, i.e. the laminar viscosity
virtual tmp<volScalarField> muEff() const;
//- Return the effective turbulent thermal diffusivity
virtual tmp<volScalarField> alphaEff() const;
//- Return the turbulence kinetic energy, i.e. 0 for laminar flow
virtual tmp<volScalarField> k() const;
//- Return the turbulence kinetic energy dissipation rate,
// i.e. 0 for laminar flow
virtual tmp<volScalarField> epsilon() const;
//- Return the Reynolds stress tensor, i.e. 0 for laminar flow
virtual tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
//- Correct the laminar viscosity
virtual void correct();
//- Read turbulenceProperties dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace incompressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -26,21 +26,48 @@ License
#include "turbulenceModel.H"
#include "volFields.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace incompressible
namespace compressible
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(turbulenceModel, 0);
defineRunTimeSelectionTable(turbulenceModel, turbulenceModel);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
turbulenceModel::turbulenceModel
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
)
:
runTime_(U.time()),
mesh_(U.mesh()),
rho_(rho),
U_(U),
phi_(phi),
thermophysicalModel_(thermophysicalModel)
{}
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
autoPtr<turbulenceModel> turbulenceModel::New
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
transportModel& transport
const basicThermo& thermophysicalModel
)
{
word turbulenceModelTypeName;
@ -61,7 +88,7 @@ autoPtr<turbulenceModel> turbulenceModel::New
)
);
turbulencePropertiesDict.lookup("simulationType")
turbulencePropertiesDict.lookup("turbulenceModel")
>> turbulenceModelTypeName;
}
@ -75,8 +102,9 @@ autoPtr<turbulenceModel> turbulenceModel::New
{
FatalErrorIn
(
"turbulenceModel::New(const volVectorField&, "
"const surfaceScalarField&, transportModel&)"
"turbulenceModel::New(const volScalarField&, "
"const volVectorField&, const surfaceScalarField&, "
"basicThermo&)"
) << "Unknown turbulenceModel type " << turbulenceModelTypeName
<< endl << endl
<< "Valid turbulenceModel types are :" << endl
@ -84,13 +112,28 @@ autoPtr<turbulenceModel> turbulenceModel::New
<< exit(FatalError);
}
return autoPtr<turbulenceModel>(cstrIter()(U, phi, transport));
return autoPtr<turbulenceModel>
(
cstrIter()(rho, U, phi, thermophysicalModel)
);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
turbulenceModel::~turbulenceModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void turbulenceModel::correct()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace incompressible
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,229 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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::compressible::turbulenceModels
Description
Namespace for compressible turbulence turbulence models.
Class
Foam::compressible::turbulenceModel
Description
Abstract base class for compressible turbulence models
(RAS, LES and laminar).
SourceFiles
turbulenceModel.C
\*---------------------------------------------------------------------------*/
#ifndef compressibleturbulenceModel_H
#define compressibleturbulenceModel_H
#include "primitiveFieldsFwd.H"
#include "volFieldsFwd.H"
#include "surfaceFieldsFwd.H"
#include "fvMatricesFwd.H"
#include "basicThermo.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declarations
class fvMesh;
namespace compressible
{
/*---------------------------------------------------------------------------*\
Class turbulenceModel Declaration
\*---------------------------------------------------------------------------*/
class turbulenceModel
{
protected:
// Protected data
const Time& runTime_;
const fvMesh& mesh_;
const volScalarField& rho_;
const volVectorField& U_;
const surfaceScalarField& phi_;
const basicThermo& thermophysicalModel_;
private:
// Private Member Functions
//- Disallow default bitwise copy construct
turbulenceModel(const turbulenceModel&);
//- Disallow default bitwise assignment
void operator=(const turbulenceModel&);
public:
//- Runtime type information
TypeName("turbulenceModel");
// Declare run-time constructor selection table
declareRunTimeNewSelectionTable
(
autoPtr,
turbulenceModel,
turbulenceModel,
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
),
(rho, U, phi, thermoPhysicalModel)
);
// Constructors
//- Construct from components
turbulenceModel
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
);
// Selectors
//- Return a reference to the selected turbulence model
static autoPtr<turbulenceModel> New
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
);
//- Destructor
virtual ~turbulenceModel();
// Member Functions
//- Access function to density field
const volScalarField& rho() const
{
return rho_;
}
//- Access function to velocity field
const volVectorField& U() const
{
return U_;
}
//- Access function to flux field
const surfaceScalarField& phi() const
{
return phi_;
}
//- Access function to thermophysical model
const basicThermo& thermo() const
{
return thermophysicalModel_;
}
//- Return the laminar viscosity
const volScalarField& mu() const
{
return thermophysicalModel_.mu();
}
//- Return the laminar thermal conductivity
const volScalarField& alpha() const
{
return thermophysicalModel_.alpha();
}
//- Return the turbulence viscosity
virtual tmp<volScalarField> mut() const = 0;
//- Return the effective viscosity
virtual tmp<volScalarField> muEff() const = 0;
//- Return the effective turbulent thermal diffusivity
virtual tmp<volScalarField> alphaEff() 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> devRhoReff() const = 0;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(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 compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -48,7 +48,7 @@ SourceFiles
#ifndef LESModel_H
#define LESModel_H
#include "turbulenceModel.H"
#include "incompressible/turbulenceModel/turbulenceModel.H"
#include "LESdelta.H"
#include "fvm.H"
#include "fvc.H"
@ -157,18 +157,6 @@ public:
// 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 the dictionary which provides info. about choice of
// models, and all related data (particularly model coefficients).
inline dictionary& coeffDict()

View File

@ -1,7 +1,7 @@
EXE_INC = \
-I../turbulenceModel/lnInclude \
-I../../LES/LESdeltas/lnInclude \
-I../../LES/LESfilters/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/turbulenceModels/LES/LESfilters/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude

View File

@ -43,7 +43,6 @@ addToRunTimeSelectionTable(LESModel, spectEddyVisc, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// from components
spectEddyVisc::spectEddyVisc
(
const volVectorField& U,

View File

@ -102,7 +102,7 @@ public:
// Constructors
//- from components
//- Construct from components
LRR
(
const volVectorField& U,

View File

@ -82,7 +82,7 @@ public:
// Constructors
//- from components
//- Construct from components
LamBremhorstKE
(
const volVectorField& U,

View File

@ -110,7 +110,7 @@ public:
// Constructors
//- from components
//- Construct from components
LaunderGibsonRSTM
(
const volVectorField& U,

View File

@ -96,7 +96,7 @@ public:
// Constructors
//- from components
//- Construct from components
LaunderSharmaKE
(
const volVectorField& U,

View File

@ -90,7 +90,7 @@ public:
// Constructors
//- from components
//- Construct from components
LienCubicKE
(
const volVectorField& U,

View File

@ -115,7 +115,7 @@ public:
// Constructors
//- from components
//- Construct from components
LienCubicKELowRe
(
const volVectorField& U,

View File

@ -85,7 +85,7 @@ public:
// Constructors
//- from components
//- Construct from components
LienLeschzinerLowRe
(
const volVectorField& U,

View File

@ -1,5 +1,5 @@
EXE_INC = \
-I../turbulenceModel/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude

View File

@ -89,7 +89,7 @@ public:
// Constructors
//- from components
//- Construct from components
NonlinearKEShih
(
const volVectorField& U,

View File

@ -86,7 +86,7 @@ public:
// Constructors
//- from components
//- Construct from components
QZeta
(
const volVectorField& U,

View File

@ -42,7 +42,7 @@ SourceFiles
#ifndef RASModel_H
#define RASModel_H
#include "turbulenceModel.H"
#include "incompressible/turbulenceModel/turbulenceModel.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "nearWallDist.H"

View File

@ -93,7 +93,7 @@ public:
// Constructors
//- from components
//- Construct from components
RNGkEpsilon
(
const volVectorField& U,

View File

@ -130,7 +130,7 @@ public:
// Constructors
//- from components
//- Construct from components
SpalartAllmaras
(
const volVectorField& U,

View File

@ -63,7 +63,7 @@ public:
// Constructors
//- from components
//- Construct from components
laminar
(
const volVectorField& U,

View File

@ -110,7 +110,7 @@ public:
// Constructors
//- from components
//- Construct from components
realizableKE
(
const volVectorField& U,

View File

@ -1,5 +1,4 @@
turbulenceModel.C
newTurbulenceModel.C
laminar/laminar.C
LIB = $(FOAM_LIBBIN)/libincompressibleTurbulenceModel

View File

@ -27,7 +27,6 @@ License
#include "turbulenceModel.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "wallFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -59,6 +58,62 @@ turbulenceModel::turbulenceModel
{}
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
autoPtr<turbulenceModel> turbulenceModel::New
(
const volVectorField& U,
const surfaceScalarField& phi,
transportModel& transport
)
{
word turbulenceModelTypeName;
// Enclose the creation of the turbulencePropertiesDict to ensure it is
// deleted before the turbulenceModel is created otherwise the dictionary
// is entered in the database twice
{
IOdictionary turbulencePropertiesDict
(
IOobject
(
"turbulenceProperties",
U.time().constant(),
U.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
turbulencePropertiesDict.lookup("simulationType")
>> turbulenceModelTypeName;
}
Info<< "Selecting turbulence model type "
<< turbulenceModelTypeName << endl;
turbulenceModelConstructorTable::iterator cstrIter =
turbulenceModelConstructorTablePtr_->find(turbulenceModelTypeName);
if (cstrIter == turbulenceModelConstructorTablePtr_->end())
{
FatalErrorIn
(
"turbulenceModel::New(const volVectorField&, "
"const surfaceScalarField&, transportModel&)"
) << "Unknown turbulenceModel type " << turbulenceModelTypeName
<< endl << endl
<< "Valid turbulenceModel types are :" << endl
<< turbulenceModelConstructorTablePtr_->toc()
<< exit(FatalError);
}
return autoPtr<turbulenceModel>(cstrIter()(U, phi, transport));
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
turbulenceModel::~turbulenceModel()
{}

View File

@ -144,6 +144,18 @@ public:
// 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
{