43 template<
class BasicTurbulenceModel>
44 tmp<volScalarField> kL<BasicTurbulenceModel>::Cmu()
const 47 return (0.556 + 0.108*Rt_)/(1.0 + 0.308*Rt_ + 0.00837*
sqr(Rt_));
51 template<
class BasicTurbulenceModel>
52 tmp<volScalarField> kL<BasicTurbulenceModel>::CmuPrime()
const 55 return 0.556/(1.0 + 0.277*Rt_);
59 template<
class BasicTurbulenceModel>
60 tmp<volScalarField> kL<BasicTurbulenceModel>::nutPrime()
const 63 return CmuPrime()*
sqrt(k_)*L_;
67 template<
class BasicTurbulenceModel>
68 tmp<volScalarField> kL<BasicTurbulenceModel>::epsilonCanopy()
const 70 const auto* CdPtr = this->mesh_.template findObject<volScalarField>(
"Cd");
71 const auto* LADPtr = this->mesh_.template findObject<volScalarField>(
"LAD");
76 const auto& Cd = *CdPtr;
77 const auto& LAD = *LADPtr;
80 return Cd*LAD*
mag(
U)*k_;
88 this->runTime_.timeName(),
100 template<
class BasicTurbulenceModel>
101 tmp<volScalarField> kL<BasicTurbulenceModel>::epsilon()
const 104 tmp<volScalarField> tepsilonCanopy = epsilonCanopy();
107 tmp<volScalarField> tepsilonPlain =
pow3(Cmu0_)*
pow(k_, 1.5)/L_;
110 tmp<volScalarField> tepsilon =
max(tepsilonPlain, tepsilonCanopy);
118 template<
class BasicTurbulenceModel>
119 tmp<volScalarField> kL<BasicTurbulenceModel>::canopyHeight()
const 121 const auto* canopyHeightPtr =
122 this->mesh_.template findObject<volScalarField>(
"canopyHeight");
126 const auto& canopyHeight = *canopyHeightPtr;
135 this->runTime_.timeName(),
147 template<
class BasicTurbulenceModel>
148 tmp<volScalarField> kL<BasicTurbulenceModel>::L()
const 154 tmp<volScalarField> tLcanopy = kappa_*canopyHeight();
158 return max(Lcanopy, Lplain);
162 template<
class BasicTurbulenceModel>
163 void kL<BasicTurbulenceModel>::stratification(
const volScalarField& fVB)
165 tmp<volScalarField> tLg =
L();
168 tmp<volScalarField> tcanopyHeight = canopyHeight();
171 tmp<volScalarField> tLcanopy = kappa_*canopyHeight;
174 const scalar Cmu0 = Cmu0_.value();
175 const scalar CbStable = CbStable_.value();
176 const scalar CbUnstable = CbUnstable_.value();
180 if (y_[i] > canopyHeight[i])
185 const scalar Lb = CbStable*
sqrt(k_[i])/
sqrt(fVB[i]);
200 Rt_[i] -
sqr(Rt_[i] + 1.0)/(Rt_[i] - 1.0)
206 *
sqrt(1.0 -
pow(Cmu0, 6.0)*
pow(CbUnstable, -2.0)*Rt_[i]);
222 template<
class BasicTurbulenceModel>
225 this->nut_ = Cmu()*
sqrt(k_)*L_;
226 this->nut_.correctBoundaryConditions();
229 BasicTurbulenceModel::correctNut();
233 template<
class BasicTurbulenceModel>
246 template<
class BasicTurbulenceModel>
249 const alphaField&
alpha,
255 const word& propertiesName,
375 g_(meshObjects::gravity::
New(this->mesh_.time())),
380 if (type == typeName)
389 template<
class BasicTurbulenceModel>
394 kappa_.readIfPresent(this->coeffDict());
395 sigmak_.readIfPresent(this->coeffDict());
396 beta_.readIfPresent(this->coeffDict());
397 Cmu0_.readIfPresent(this->coeffDict());
398 Lmax_.readIfPresent(this->coeffDict());
399 CbStable_.readIfPresent(this->coeffDict());
400 CbUnstable_.readIfPresent(this->coeffDict());
409 template<
class BasicTurbulenceModel>
412 if (!this->turbulence_)
418 const alphaField&
alpha = this->alpha_;
419 const rhoField&
rho = this->rho_;
426 eddyViscosity<RASModel<BasicTurbulenceModel>>
::correct();
439 tmp<volScalarField> tfBV = -beta_*(
fvc::grad(
T) & g_);
443 tmp<volScalarField> tPb = -fBV*nutPrime();
447 tmp<volScalarField> tepsilon =
epsilon();
455 tmp<fvScalarMatrix> kEqn
475 bound(k_, this->kMin_);
478 Rt_ = fBV*
sqr(k_/tepsilon);
void correct(GeometricField< Type, PatchField, GeoMesh > &field)
Apply correction to field.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
dimensionedScalar kMin_
Lower limit of k.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const vector L(dict.get< vector >("L"))
const dimensionedScalar G
Newtonian constant of gravitation.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
dimensionedScalar sqrt(const dimensionedScalar &ds)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
SymmTensor< Cmpt > devSymm(const SymmTensor< Cmpt > &st)
Return the deviatoric part of the symmetric part of a SymmTensor.
Generic dimensioned Type class.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
Eddy viscosity turbulence model base class.
virtual tmp< fvScalarMatrix > kSource() const
Add explicit source for turbulent kinetic energy.
GeometricField< vector, fvPatchField, volMesh > volVectorField
DimensionedField< scalar, volMesh > Internal
The internal field type from which this GeometricField is derived.
bool read(const char *buf, int32_t &val)
Same as readInt32.
#define forAll(list, i)
Loop across all elements in list.
Templated abstract base class for RAS turbulence models.
constexpr const char *const group
Group name for atomic constants.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
volScalarField k_
Turbulent kinetic energy [m2/s2].
A one-equation (turbulent kinetic energy k) turbulence closure model for incompressible and compressi...
virtual bool read()
Re-read model coefficients if they have changed.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionSet dimVolume(pow3(dimLength))
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
const dimensionedScalar e
Elementary charge.
virtual void correctNut()
Correct the turbulence viscosity.
A class for handling words, derived from Foam::string.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
zeroField SuSp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
virtual void printCoeffs(const word &type)
Print model coefficients.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &solverControls)
Solve returning the solution statistics given convergence tolerance.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Bound the given scalar field if it has gone unbounded.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(psi *p+alphal *rhol0+((alphav *psiv+alphal *psil) - psi) *pSat, rhoMin);# 1 "/home/chef2/andy/OpenFOAM/release/v2312/OpenFOAM-v2312/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=clamp((rho - rholSat)/(rhovSat - rholSat), zero_one{});alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar pow3(const dimensionedScalar &ds)
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
volScalarField & bound(volScalarField &, const dimensionedScalar &lowerBound)
Bound the given scalar field if it has gone unbounded.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Base-class for all transport models used by the incompressible turbulence models. ...
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Interface to run-time selectable methods to calculate the distance-to-wall and normal-to-wall fields...
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
static options & New(const fvMesh &mesh)
Construct fvOptions and register to database if not present.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Defines the attributes of an object for which implicit objectRegistry management is supported...
Do not request registration (bool: false)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)