45 template<
class BasicMomentumTransportModel>
68 liquidTurbulencePtr_(
nullptr),
148 this->runTime_.timeName(),
160 this->runTime_.timeName(),
168 bound(k_, this->kMin_);
169 bound(epsilon_, this->epsilonMin_);
171 if (type == typeName)
173 this->printCoeffs(type);
178 template<
class BasicMomentumTransportModel>
184 const volScalarField::Boundary& ebf = epsilon.
boundaryField();
190 if (isA<fixedValueFvPatchScalarField>(ebf[
patchi]))
192 ebt[
patchi] = fixedValueFvPatchScalarField::typeName;
200 template<
class BasicMomentumTransportModel>
208 const volScalarField::Boundary& refBf =
215 isA<inletOutletFvPatchScalarField>(bf[
patchi])
216 && isA<inletOutletFvPatchScalarField>(refBf[patchi])
219 refCast<inletOutletFvPatchScalarField>
221 refCast<const inletOutletFvPatchScalarField>
222 (refBf[
patchi]).refValue();
228 template<
class BasicMomentumTransportModel>
231 if (rhom_.valid())
return;
239 this->liquidTurbulence();
245 this->runTime_.timeName(this->runTime_.startTime().value())
296 correctInletOutlet(km_(), kl);
310 mix(epsilonl, epsilong),
311 epsilonBoundaryTypes(epsilonl)
314 correctInletOutlet(epsilonm_(), epsilonl);
320 template<
class BasicMomentumTransportModel>
325 Cmu_.readIfPresent(this->coeffDict());
326 C1_.readIfPresent(this->coeffDict());
327 C2_.readIfPresent(this->coeffDict());
328 C3_.readIfPresent(this->coeffDict());
329 Cp_.readIfPresent(this->coeffDict());
330 sigmak_.readIfPresent(this->coeffDict());
331 sigmaEps_.readIfPresent(this->coeffDict());
342 template<
class BasicMomentumTransportModel>
345 this->nut_ = Cmu_*
sqr(k_)/epsilon_;
346 this->nut_.correctBoundaryConditions();
351 template<
class BasicMomentumTransportModel>
355 if (!liquidTurbulencePtr_)
359 const phaseModel& gas = refCast<const phaseModel>(this->transport());
363 liquidTurbulencePtr_ =
373 momentumTransportModel::typeName,
380 return *liquidTurbulencePtr_;
384 template<
class BasicMomentumTransportModel>
388 this->liquidTurbulence();
390 const phaseModel& gas = refCast<const phaseModel>(this->transport());
402 (6*this->Cmu_/(4*
sqrt(3.0/2.0)))
403 *drag.
K()/liquid.
rho()
404 *(liquidTurbulence.
k_/liquidTurbulence.
epsilon_)
407 volScalarField fAlphad((180 + (-4.71e3 + 4.26e4*alphag)*alphag)*alphag);
409 return sqr(1 + (Ct0 - 1)*
exp(-fAlphad));
413 template<
class BasicMomentumTransportModel>
417 const phaseModel& gas = refCast<const phaseModel>(this->transport());
423 template<
class BasicMomentumTransportModel>
427 const phaseModel& gas = refCast<const phaseModel>(this->transport());
431 return gas.rho() + virtualMass.
Cvm()*fluid.otherPhase(gas).rho();
435 template<
class BasicMomentumTransportModel>
441 return alphal*rholEff() + alphag*rhogEff();
445 template<
class BasicMomentumTransportModel>
455 return (alphal*rholEff()*fc + alphag*rhogEff()*fd)/rhom_();
459 template<
class BasicMomentumTransportModel>
470 (alphal*rholEff()*fc + alphag*rhogEff()*Ct2_()*fd)
471 /(alphal*rholEff() + alphag*rhogEff()*Ct2_());
475 template<
class BasicMomentumTransportModel>
497 template<
class BasicMomentumTransportModel>
502 this->liquidTurbulence();
504 const phaseModel& gas = refCast<const phaseModel>(this->transport());
516 *
pos(alphap_ - gas)*liquid*liquid.
rho()
536 template<
class BasicMomentumTransportModel>
540 return fvm::Su(bubbleG()/rhom_(), km_());
544 template<
class BasicMomentumTransportModel>
548 return fvm::Su(C3_*epsilonm_()*bubbleG()/(rhom_()*km_()), epsilonm_());
552 template<
class BasicMomentumTransportModel>
555 const phaseModel& gas = refCast<const phaseModel>(this->transport());
559 if (&gas != &fluid.phases()[0])
563 this->liquidTurbulence();
568 if (!this->turbulence_)
586 this->liquidTurbulence();
671 bound(km, this->kMin_);
672 epsilonm == mix(epsilonl, epsilong);
673 bound(epsilonm, this->epsilonMin_);
684 -
fvm::SuSp(((2.0/3.0)*C1_)*divUm, epsilonm)
685 -
fvm::Sp(C2_*epsilonm/km, epsilonm)
687 + fvModels.source(epsilonm)
690 epsEqn.
ref().relax();
695 bound(epsilonm, this->epsilonMin_);
710 + fvModels.source(km)
717 bound(km, this->kMin_);
720 const volScalarField Cc2(rhom/(alphal*rholEff() + alphag*rhogEff()*Ct2_()));
723 epsilonl = Cc2*epsilonm;
730 epsilong = Ct2_()*epsilonl;
732 nutg = Ct2_()*(liquidTurbulence.nu()/this->nu())*nutl;
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
#define forAll(list, i)
Loop across all elements in list.
tmp< surfaceScalarField > mixFlux(const surfaceScalarField &fc, const surfaceScalarField &fd) const
tmp< volScalarField > mixU(const volScalarField &fc, const volScalarField &fd) const
tmp< fvMatrix< Type > > SuSp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
void clear() const
If object pointer points to valid object:
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
const Boundary & boundaryField() const
Return const-reference to the boundary 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)
tmp< volScalarField > mix(const volScalarField &fc, const volScalarField &fd) const
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
dimensionedScalar sqrt(const dimensionedScalar &ds)
virtual tmp< volScalarField > rho() const =0
Return the density field.
wordList epsilonBoundaryTypes(const volScalarField &epsilon) const
const word & name() const
Generic dimensioned Type class.
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
Eddy viscosity turbulence model base class.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
BasicMomentumTransportModel::alphaField alphaField
Info<< "Reading strained laminar flame speed field Su\"<< endl;volScalarField Su(IOobject("Su", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field betav\"<< endl;volScalarField betav(IOobject("betav", mesh.facesInstance(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE), mesh);Info<< "Reading field Lobs\"<< endl;volScalarField Lobs(IOobject("Lobs", mesh.facesInstance(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE), mesh);Info<< "Reading field CT\"<< endl;volSymmTensorField CT(IOobject("CT", mesh.facesInstance(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE), mesh);Info<< "Reading field Nv\"<< endl;volScalarField Nv(IOobject("Nv", mesh.facesInstance(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE), mesh);Info<< "Reading field nsv\"<< endl;volSymmTensorField nsv(IOobject("nsv", mesh.facesInstance(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE), mesh);IOdictionary PDRProperties(IOobject("PDRProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE));autoPtr< PDRDragModel > drag
tmp< volScalarField > rhom() const
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
tmp< volScalarField > bubbleG() const
tmp< volScalarField > rhogEff() const
Templated abstract base class for RAS turbulence models.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual tmp< volScalarField > K() const
Return the drag coefficient K.
dimensionedScalar pos(const dimensionedScalar &ds)
bool read(const char *, int32_t &)
virtual void correctNut()
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
dimensionedScalar exp(const dimensionedScalar &ds)
BasicMomentumTransportModel::transportModel transportModel
Foam::fvConstraints & fvConstraints
Class to represent a system of phases and model interfacial transfers between them.
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()
const rhoThermo & thermo() const
Return const-access to phase rhoThermo.
static word groupName(Name name, const word &group)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
virtual bool read()
Re-read model coefficients if they have changed.
const phaseModel & otherPhase(const phaseModel &phase) const
Return the phase not given as an argument in a two-phase system.
virtual tmp< fvScalarMatrix > epsilonSource() const
virtual tmp< fvScalarMatrix > kSource() const
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.
virtual tmp< volScalarField > Cvm() const =0
Return the virtual mass coefficient.
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
surfaceScalarField phig(-rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
Foam::fvModels & fvModels
tmp< volScalarField > Ct2() const
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar pow3(const dimensionedScalar &ds)
BasicMomentumTransportModel::rhoField rhoField
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.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
Finite volume constraints.
Mixture k-epsilon turbulence model for two-phase gas-liquid systems.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
const phaseSystem & fluid() const
Return the system to which this phase belongs.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
virtual tmp< volScalarField > nu() const
Kinematic viscosity of mixture [m^2/s].
void correctBoundaryConditions()
Correct boundary field.
SolverPerformance< Type > solve(fvMatrix< Type > &, const word &)
Solve returning the solution statistics given convergence tolerance.
dimensioned< scalar > mag(const dimensioned< Type > &)
mixtureKEpsilon(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.
A class for managing temporary objects.
virtual tmp< volScalarField > CdRe() const =0
Drag coefficient.
const objectRegistry & db() const
Return the local objectRegistry.
void correctInletOutlet(volScalarField &vsf, const volScalarField &refVsf) const
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
tmp< volScalarField > rholEff() const
Calculate the matrix for implicit and explicit sources.