31 template<
class BasicMomentumTransportModel>
43 BasicMomentumTransportModel
54 turbulence_(RASDict().template lookupOrDefault<
Switch>(
"turbulence", true)),
56 nutMaxCoeff_(
"nutMaxCoeff",
dimless, RASDict(), 1e5),
61 ? laminarModels::generalisedNewtonianViscosityModel::
New
67 :
autoPtr<laminarModels::generalisedNewtonianViscosityModel>
69 new laminarModels::generalisedNewtonianViscosityModels::Newtonian
80 this->mesh_.deltaCoeffs();
86 template<
class BasicMomentumTransportModel>
111 {
"model",
"RASModel"}
115 <<
"Selecting RAS turbulence model " << modelType <<
endl;
117 libs.
open(RASdict,
"libs", dictionaryConstructorTablePtr_);
119 typename dictionaryConstructorTable::iterator cstrIter =
120 dictionaryConstructorTablePtr_->find(modelType);
122 if (cstrIter == dictionaryConstructorTablePtr_->end())
125 <<
"Unknown RASModel type "
126 << modelType <<
nl <<
nl
127 <<
"Valid RASModel types:" <<
endl
128 << dictionaryConstructorTablePtr_->sortedToc()
144 template<
class BasicMomentumTransportModel>
148 return this->subDict(
"RAS");
152 template<
class BasicMomentumTransportModel>
156 return typeDict(this->
type());
160 template<
class BasicMomentumTransportModel>
168 template<
class BasicMomentumTransportModel>
173 turbulence_.readIfPresent(
"turbulence", RASDict());
174 kMin_.readIfPresent(RASDict());
175 nutMaxCoeff_.readIfPresent(RASDict());
186 template<
class BasicMomentumTransportModel>
189 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
static autoPtr< RASModel > 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 RAS model.
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
const dictionary & typeDict() const
Const access to the coefficients dictionary.
RASModel(const word &type, const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity)
Construct from components.
const dictionary & RASDict() const
Const access to the RAS dictionary.
virtual bool read()
Read model coefficients if they have changed.
BasicMomentumTransportModel::rhoField rhoField
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))