41 template<
class BasicMomentumTransportModel>
52 const scalar Cpm = pm.
dict().
lookup<scalar>(C.name());
57 this->mesh_.cellZones()[cellZoneIDs[zonei]];
61 const label celli = cells[i];
69 template<
class BasicMomentumTransportModel>
81 const scalar Cpm = pm.
dict().
lookup<scalar>(C.name());
86 this->mesh_.cellZones()[cellZoneIDs[zonei]];
90 const label celli = cells[i];
91 C[celli] = Cpm*Sigma[celli];
98 template<
class BasicMomentumTransportModel>
109 if (isA<fv::explicitPorositySource>(fvModels[i]))
112 refCast<const fv::explicitPorositySource>(fvModels[i]);
114 if (isA<porosityModels::powerLawLopesdaCosta>(eps.
model()))
117 refCast<const porosityModels::powerLawLopesdaCosta>
122 setPorosityCoefficient(Cmu_, pm);
123 setPorosityCoefficient(C1_, pm);
124 setPorosityCoefficient(C2_, pm);
125 setPorosityCoefficient(sigmak_, pm);
126 setPorosityCoefficient(sigmaEps_, pm);
128 setCdSigma(CdSigma_, pm);
129 setPorosityCoefficient(betap_, pm);
130 setPorosityCoefficient(betad_, pm);
131 setPorosityCoefficient(C4_, pm);
132 setPorosityCoefficient(C5_, pm);
139 template<
class BasicMomentumTransportModel>
142 this->nut_ = Cmu_*
sqr(k_)/epsilon_;
143 this->nut_.correctBoundaryConditions();
148 template<
class BasicMomentumTransportModel>
155 return fvm::Su(CdSigma_*(betap_*magU3 - betad_*magU*k_()), k_);
159 template<
class BasicMomentumTransportModel>
170 *(C4_*betap_*epsilon_()/k_()*magU3 - C5_*betad_*magU*epsilon_()),
178 template<
class BasicMomentumTransportModel>
206 this->runTime_.timeName(),
222 this->runTime_.timeName(),
238 this->runTime_.timeName(),
254 this->runTime_.timeName(),
270 this->runTime_.timeName(),
287 this->runTime_.timeName(),
298 this->runTime_.timeName(),
309 this->runTime_.timeName(),
320 this->runTime_.timeName(),
331 this->runTime_.timeName(),
343 this->runTime_.timeName(),
355 this->runTime_.timeName(),
363 bound(k_, this->kMin_);
364 bound(epsilon_, this->epsilonMin_);
366 if (type == typeName)
368 this->printCoeffs(type);
371 setPorosityCoefficients();
377 template<
class BasicMomentumTransportModel>
391 template<
class BasicMomentumTransportModel>
394 if (!this->turbulence_)
422 nut.
v()*(
dev(
twoSymm(tgradU().v())) && tgradU().v())
427 epsilon_.boundaryFieldRef().updateCoeffs();
442 + epsilonSource(magU, magU3)
443 + fvModels.source(alpha, rho, epsilon_)
446 epsEqn.
ref().relax();
448 epsEqn.ref().boundaryManipulate(epsilon_.boundaryFieldRef());
451 bound(epsilon_, this->epsilonMin_);
463 + kSource(magU, magU3)
464 + fvModels.source(alpha, rho, k_)
471 bound(k_, this->kMin_);
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
void setPorosityCoefficient(volScalarField::Internal &C, const porosityModels::powerLawLopesdaCosta &pm)
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
tmp< fvMatrix< Type > > SuSp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void clear() const
If object pointer points to valid object:
Variant of the power law porosity model with spatially varying drag coefficient.
const dictionary & dict() const
Return dictionary used for model construction.
const scalarField & Sigma() const
Return the porosity surface area per unit volume zone field.
tmp< fvMatrix< Type > > Su(const DimensionedField< Type, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
T & ref() const
Return non-const reference or generate a fatal error.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
virtual tmp< fvScalarMatrix > kSource(const volScalarField::Internal &magU, const volScalarField::Internal &magU3) const
const dimensionSet dimless
Generic dimensioned Type class.
const dimensionedScalar G
Newtonian constant of gravitation.
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
virtual bool read()
Re-read model coefficients if they have changed.
Eddy viscosity turbulence model base class.
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
const labelList & cellZoneIDs() const
Return const access to the cell zone IDs.
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
const dimensionSet dimLength
Templated abstract base class for RAS turbulence models.
const porosityModel & model() const
Return the porosity model.
virtual tmp< fvScalarMatrix > epsilonSource(const volScalarField::Internal &magU, const volScalarField::Internal &magU3) const
bool read(const char *, int32_t &)
const Internal & v() const
Return a const-reference to the dimensioned internal field.
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
BasicMomentumTransportModel::transportModel transportModel
Foam::fvConstraints & fvConstraints
A class for handling words, derived from string.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-9/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
static word groupName(Name name, const word &group)
void setCdSigma(volScalarField::Internal &C, const porosityModels::powerLawLopesdaCosta &pm)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
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.
static autoPtr< dictionary > New(Istream &)
Construct top-level dictionary on freestore from Istream.
tmp< volScalarField > divU
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
BasicMomentumTransportModel::rhoField rhoField
Foam::fvModels & fvModels
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.
Finite volume constraints.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
kEpsilonLopesdaCosta(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &type=typeName)
Construct from components.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
void setPorosityCoefficients()
SolverPerformance< Type > solve(fvMatrix< Type > &, const word &)
Solve returning the solution statistics given convergence tolerance.
dimensioned< scalar > mag(const dimensioned< Type > &)
A class for managing temporary objects.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Explicit porosity source.
BasicMomentumTransportModel::alphaField alphaField
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.