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_;
93 template<
class BasicTurbulenceModel>
94 tmp<volScalarField> kL<BasicTurbulenceModel>::epsilon()
const 97 tmp<volScalarField> tepsilonCanopy = epsilonCanopy();
100 tmp<volScalarField> tepsilonPlain =
pow3(Cmu0_)*
pow(k_, 1.5)/L_;
103 tmp<volScalarField> tepsilon =
max(tepsilonPlain, tepsilonCanopy);
111 template<
class BasicTurbulenceModel>
112 tmp<volScalarField> kL<BasicTurbulenceModel>::canopyHeight()
const 114 tmp<volScalarField> tcanopy;
118 this->mesh_.template cfindObject<volScalarField>(
"canopyHeight")
136 template<
class BasicTurbulenceModel>
137 tmp<volScalarField> kL<BasicTurbulenceModel>::L()
const 143 tmp<volScalarField> tLcanopy = kappa_*canopyHeight();
147 return max(Lcanopy, Lplain);
151 template<
class BasicTurbulenceModel>
152 void kL<BasicTurbulenceModel>::stratification(
const volScalarField& fVB)
154 tmp<volScalarField> tLg =
L();
157 tmp<volScalarField> tcanopyHeight = canopyHeight();
160 tmp<volScalarField> tLcanopy = kappa_*canopyHeight;
163 const scalar Cmu0 = Cmu0_.value();
164 const scalar CbStable = CbStable_.value();
165 const scalar CbUnstable = CbUnstable_.value();
169 if (y_[i] > canopyHeight[i])
174 const scalar Lb = CbStable*
sqrt(k_[i])/
sqrt(fVB[i]);
189 Rt_[i] -
sqr(Rt_[i] + 1.0)/(Rt_[i] - 1.0)
195 *
sqrt(1.0 -
pow(Cmu0, 6.0)*
pow(CbUnstable, -2.0)*Rt_[i]);
211 template<
class BasicTurbulenceModel>
214 this->nut_ = Cmu()*
sqrt(k_)*L_;
215 this->nut_.correctBoundaryConditions();
218 BasicTurbulenceModel::correctNut();
222 template<
class BasicTurbulenceModel>
235 template<
class BasicTurbulenceModel>
238 const alphaField&
alpha,
244 const word& propertiesName,
364 g_(meshObjects::gravity::
New(this->mesh_.time())),
369 if (type == typeName)
378 template<
class BasicTurbulenceModel>
383 kappa_.readIfPresent(this->coeffDict());
384 sigmak_.readIfPresent(this->coeffDict());
385 beta_.readIfPresent(this->coeffDict());
386 Cmu0_.readIfPresent(this->coeffDict());
387 Lmax_.readIfPresent(this->coeffDict());
388 CbStable_.readIfPresent(this->coeffDict());
389 CbUnstable_.readIfPresent(this->coeffDict());
398 template<
class BasicTurbulenceModel>
401 if (!this->turbulence_)
407 const alphaField&
alpha = this->alpha_;
408 const rhoField&
rho = this->rho_;
415 eddyViscosity<RASModel<BasicTurbulenceModel>>
::correct();
428 tmp<volScalarField> tfBV = -beta_*(
fvc::grad(
T) & g_);
432 tmp<volScalarField> tPb = -fBV*nutPrime();
436 tmp<volScalarField> tepsilon =
epsilon();
444 tmp<fvScalarMatrix> kEqn
464 bound(k_, this->kMin_);
467 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.
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.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
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/v2406/OpenFOAM-v2406/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)