31 template<
class BasicMomentumTransportModel>
43 BasicMomentumTransportModel
54 turbulence_(LESDict().template lookupOrDefault<
Switch>(
"turbulence", true)),
56 nutMaxCoeff_(
"nutMaxCoeff",
dimless, LESDict(), 1e5),
61 ? laminarModels::generalisedNewtonianViscosityModel::
New
67 :
autoPtr<laminarModels::generalisedNewtonianViscosityModel>
69 new laminarModels::generalisedNewtonianViscosityModels::Newtonian
82 this->groupName(
"delta"),
90 this->mesh_.deltaCoeffs();
96 template<
class BasicMomentumTransportModel>
121 {
"model",
"LESModel"}
125 <<
"Selecting LES turbulence model " << modelType <<
endl;
127 libs.
open(LESdict,
"libs", dictionaryConstructorTablePtr_);
129 typename dictionaryConstructorTable::iterator cstrIter =
130 dictionaryConstructorTablePtr_->find(modelType);
132 if (cstrIter == dictionaryConstructorTablePtr_->end())
135 <<
"Unknown LESModel type "
136 << modelType <<
nl <<
nl
137 <<
"Valid LESModel types:" <<
endl
138 << dictionaryConstructorTablePtr_->sortedToc()
154 template<
class BasicMomentumTransportModel>
158 return this->subDict(
"LES");
162 template<
class BasicMomentumTransportModel>
166 return typeDict(this->
type());
170 template<
class BasicMomentumTransportModel>
178 template<
class BasicMomentumTransportModel>
183 turbulence_.readIfPresent(
"turbulence", LESDict());
184 delta_().read(LESDict());
186 kMin_.readIfPresent(LESDict());
187 nutMaxCoeff_.readIfPresent(LESDict());
198 template<
class BasicMomentumTransportModel>
201 viscosityModel_->correct();
Generic GeometricField class.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
static word group(const word &name)
Return group (extension part of name)
BasicMomentumTransportModel::alphaField alphaField
const dictionary & LESDict() const
Const access to the LES dictionary.
LESModel(const word &type, const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity)
Construct from components.
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
const dictionary & typeDict() const
Const access to the coefficients dictionary.
static autoPtr< LESModel > New(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity)
Return a reference to the selected LES model.
virtual bool read()
Read model coefficients if they have changed.
BasicMomentumTransportModel::rhoField rhoField
Abstract base class for LES deltas.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const fileName & name() const
Return the dictionary name.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
ITstream & lookupBackwardsCompatible(const wordList &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream, trying a list of keywords.
const dictionary & optionalTypeDict(const word &typeName) const
Find and return an optional type sub-dictionary.
bool open(const fileName &libName, const bool verbose=true)
Open the named library, optionally with warnings if problems occur.
static typeIOobject< IOdictionary > readModelDict(const objectRegistry &obr, const word &group, bool registerObject=false)
Enables the printing of a dictionary and subsequently looked-up defaulted entries.
Abstract base class for all fluid physical properties.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
void correct(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiCorr, const SpType &Sp)
const dimensionSet dimless
errorManipArg< error, int > exit(error &err, const int errNo=1)
dlLibraryTable libs
Table of loaded dynamic libraries.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
const dimensionSet & dimVelocity
Ostream & indentOrNl(Ostream &os)
Indent stream or add newline if indent level == 0.
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.name(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Creating face flux\n"<< endl;surfaceScalarField phi(IOobject("phi", runTime.name(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedScalar(mesh.Sf().dimensions() *U.dimensions(), 0));autoPtr< viscosityModel > viscosity(viscosityModel::New(mesh))