43 template<
class BasicTurbulenceModel>
54 const scalar Cpm = pm.
dict().
get<scalar>(
C.name());
56 for (
const label zonei : cellZoneIDs)
60 for (
const label celli :
cells)
69 template<
class BasicTurbulenceModel>
73 const porosityModels::powerLawLopesdaCosta& pm
76 if (pm.dict().found(
C.name()))
78 const labelList& cellZoneIDs = pm.cellZoneIDs();
81 const scalar Cpm = pm.dict().
get<scalar>(
C.name());
83 for (
const label zonei : cellZoneIDs)
89 const label celli =
cells[i];
90 C[celli] = Cpm*Sigma[i];
97 template<
class BasicTurbulenceModel>
104 if (isA<fv::explicitPorositySource>(
fvOptions[i]))
106 const fv::explicitPorositySource& eps =
107 refCast<const fv::explicitPorositySource>(
fvOptions[i]);
109 if (isA<porosityModels::powerLawLopesdaCosta>(eps.model()))
111 const porosityModels::powerLawLopesdaCosta& pm =
112 refCast<const porosityModels::powerLawLopesdaCosta>
117 setPorosityCoefficient(Cmu_, pm);
118 Cmu_.correctBoundaryConditions();
119 setPorosityCoefficient(C1_, pm);
120 setPorosityCoefficient(C2_, pm);
121 setPorosityCoefficient(sigmak_, pm);
122 setPorosityCoefficient(sigmaEps_, pm);
123 sigmak_.correctBoundaryConditions();
124 sigmaEps_.correctBoundaryConditions();
126 setCdSigma(CdSigma_, pm);
127 setPorosityCoefficient(betap_, pm);
128 setPorosityCoefficient(betad_, pm);
129 setPorosityCoefficient(C4_, pm);
130 setPorosityCoefficient(C5_, pm);
137 template<
class BasicTurbulenceModel>
140 this->nut_ = Cmu_*
sqr(k_)/epsilon_;
141 this->nut_.correctBoundaryConditions();
144 BasicTurbulenceModel::correctNut();
148 template<
class BasicTurbulenceModel>
155 return fvm::Su(CdSigma_*(betap_*magU3 - betad_*magU*k_()), k_);
159 template<
class BasicTurbulenceModel>
170 *(C4_*betap_*epsilon_()/k_()*magU3 - C5_*betad_*magU*epsilon_()),
178 template<
class BasicTurbulenceModel>
181 const alphaField&
alpha,
187 const word& propertiesName,
368 if (type == typeName)
379 template<
class BasicTurbulenceModel>
391 template<
class BasicTurbulenceModel>
394 if (!this->turbulence_)
400 const alphaField&
alpha = this->alpha_;
401 const rhoField&
rho = this->rho_;
407 eddyViscosity<RASModel<BasicTurbulenceModel>>
::correct();
423 epsilon_.boundaryFieldRef().updateCoeffs();
425 epsilon_.boundaryFieldRef().template evaluateCoupled<coupledFvPatch>();
431 tmp<fvScalarMatrix> epsEqn
440 + epsilonSource(magU, magU3)
444 epsEqn.ref().relax();
446 epsEqn.ref().boundaryManipulate(epsilon_.boundaryFieldRef());
449 bound(epsilon_, this->epsilonMin_);
452 tmp<fvScalarMatrix> kEqn
461 + kSource(magU, magU3)
469 bound(k_, this->kMin_);
void correct(GeometricField< Type, PatchField, GeoMesh > &field)
Apply correction to field.
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
void setPorosityCoefficient(volScalarField::Internal &C, const porosityModels::powerLawLopesdaCosta &pm)
Graphite solid properties.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Variant of the power law porosity model with spatially varying drag coefficient.
dimensionedScalar kMin_
Lower limit of k.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const dictionary & dict() const
Return dictionary used for model construction.
optionList(const optionList &)=delete
No copy construct.
const dimensionedScalar G
Newtonian constant of gravitation.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type get(const label i) const
Return bool value at specified position, always false for out-of-range access.
virtual tmp< fvScalarMatrix > kSource(const volScalarField::Internal &magU, const volScalarField::Internal &magU3) const
Generic dimensioned Type class.
const dimensionSet dimless
Dimensionless.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
virtual bool read()
Re-read model coefficients if they have changed.
Eddy viscosity turbulence model base class.
GeometricField< vector, fvPatchField, volMesh > volVectorField
zeroField Su(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
DimensionedField< scalar, volMesh > Internal
The internal field type from which this GeometricField is derived.
const labelList & cellZoneIDs() const
Return const access to the cell zone IDs.
bool read(const char *buf, int32_t &val)
Same as readInt32.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
#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
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
virtual tmp< fvScalarMatrix > epsilonSource(const volScalarField::Internal &magU, const volScalarField::Internal &magU3) const
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void setCdSigma(volScalarField::Internal &C, const porosityModels::powerLawLopesdaCosta &pm)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
zeroField SuSp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
virtual void printCoeffs(const word &type)
Print model coefficients.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &solverControls)
Solve returning the solution statistics given convergence tolerance.
virtual void correctNut()
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()
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)
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. ...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
void setPorosityCoefficients()
Variant of the standard k-epsilon turbulence model with additional source terms to handle the changes...
List< label > labelList
A List of labels.
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...
dimensionedScalar epsilonMin_
Lower limit of epsilon.
SymmTensor< Cmpt > devTwoSymm(const SymmTensor< Cmpt > &st)
Return the deviatoric part of twice the symmetric part of a SymmTensor.