47 template<
class BasicMomentumTransportModel>
55 const viscosity& viscosity,
70 gasTurbulencePtr_(
nullptr),
150 this->runTime_.timeName(),
162 this->runTime_.timeName(),
170 bound(k_, this->kMin_);
171 bound(epsilon_, this->epsilonMin_);
173 if (type == typeName)
175 this->printCoeffs(type);
178 const phaseModel&
phase = refCast<const phaseModel>(this->properties());
181 if (phase.
index() == 1)
190 this->runTime_.timeName(),
206 this->runTime_.timeName(),
222 this->runTime_.timeName(),
239 this->runTime_.timeName(),
252 template<
class BasicMomentumTransportModel>
255 static bool initialised =
false;
268 template<
class BasicMomentumTransportModel>
273 Cmu_.readIfPresent(this->coeffDict());
274 C1_.readIfPresent(this->coeffDict());
275 C2_.readIfPresent(this->coeffDict());
276 C3_.readIfPresent(this->coeffDict());
277 Cp_.readIfPresent(this->coeffDict());
278 sigmak_.readIfPresent(this->coeffDict());
279 sigmaEps_.readIfPresent(this->coeffDict());
290 template<
class BasicMomentumTransportModel>
293 this->nut_ = Cmu_*
sqr(k_)/epsilon_;
294 this->nut_.correctBoundaryConditions();
299 template<
class BasicMomentumTransportModel>
303 if (!gasTurbulencePtr_)
308 refCast<const phaseModel>(this->properties());
322 momentumTransportModel::typeName,
329 return *gasTurbulencePtr_;
333 template<
class BasicMomentumTransportModel>
337 this->gasTurbulence();
352 (6*this->Cmu_/(4*
sqrt(3.0/2.0)))
353 *drag.
K()/liquid.
rho()
357 volScalarField fAlphad((180 + (-4.71e3 + 4.26e4*alphag)*alphag)*alphag);
359 return sqr(1 + (Ct0 - 1)*
exp(-fAlphad));
363 template<
class BasicMomentumTransportModel>
372 template<
class BasicMomentumTransportModel>
381 fluid.lookupInterfacialModel
385 return gas.
rho() + virtualMass.
Cvm()*liquid.
rho();
389 template<
class BasicMomentumTransportModel>
395 return alphal*rholEff() + alphag*rhogEff();
399 template<
class BasicMomentumTransportModel>
409 return (alphal*rholEff()*fc + alphag*rhogEff()*fd)/rhom_();
413 template<
class BasicMomentumTransportModel>
424 (alphal*rholEff()*fc + alphag*rhogEff()*Ct2_()*fd)
425 /(alphal*rholEff() + alphag*rhogEff()*Ct2_());
429 template<
class BasicMomentumTransportModel>
451 template<
class BasicMomentumTransportModel>
456 this->gasTurbulence();
472 *
pos(alphap_ - gas)*liquid*liquid.
rho()
492 template<
class BasicMomentumTransportModel>
496 return fvm::Su(bubbleG()/rhom_(), km_());
500 template<
class BasicMomentumTransportModel>
504 return fvm::Su(C3_*epsilonm_()*bubbleG()/(rhom_()*km_()), epsilonm_());
508 template<
class BasicMomentumTransportModel>
511 const phaseModel&
phase = refCast<const phaseModel>(this->properties());
514 if (phase.
index() == 0)
518 this->gasTurbulence();
527 if (!this->turbulence_)
542 this->gasTurbulence();
627 bound(km, this->kMin_);
628 epsilonm == mix(epsilonl, epsilong);
629 bound(epsilonm, this->epsilonMin_);
640 -
fvm::SuSp(((2.0/3.0)*C1_)*divUm, epsilonm)
641 -
fvm::Sp(C2_*epsilonm/km, epsilonm)
643 + fvModels.source(epsilonm)
646 epsEqn.
ref().relax();
651 bound(epsilonm, this->epsilonMin_);
665 + fvModels.source(km)
672 bound(km, this->kMin_);
675 const volScalarField Cc2(rhom/(alphal*rholEff() + alphag*rhogEff()*Ct2_()));
678 epsilonl = Cc2*epsilonm;
685 epsilong = Ct2_()*epsilonl;
687 nutg = Ct2_()*(this->nu()/gasTurbulence.
nu())*nutl;
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
label index() const
Return the index of the phase.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
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:
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-10/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()
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
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.
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
const word & name() const
const dimensionSet dimless
Generic dimensioned Type class.
tmp< volScalarField > d() const
Return the Sauter-mean diameter.
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
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
dimensionedScalar pos(const dimensionedScalar &ds)
bool read(const char *, int32_t &)
virtual void correctNut()
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
dimensionedScalar exp(const dimensionedScalar &ds)
Foam::fvConstraints & fvConstraints
Class to represent a system of phases and model interfacial transfers between them.
virtual tmp< volScalarField > Cvm() const =0
Return the virtual mass coefficient.
mixtureKEpsilon(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity, const word &type=typeName)
Construct from components.
A class for handling words, derived from string.
const rhoThermo & thermo() const
Return const-access to phase rhoThermo.
static word groupName(Name name, const word &group)
Info<< "Reading field p\"<< endl;volScalarField p(IOobject("p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);pressureReference pressureReference(p, simple.dict());mesh.schemes().setFluxRequired(p.name());Info<< "Reading field pa\"<< endl;volScalarField pa(IOobject("pa", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field Ua\"<< endl;volVectorField Ua(IOobject("Ua", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);# 65 "/home/ubuntu/OpenFOAM-10/applications/solvers/incompressible/adjointShapeOptimisationFoam/createFields.H" 2label paRefCell=0;scalar paRefValue=0.0;setRefCell(pa, simple.dict(), paRefCell, paRefValue);mesh.schemes().setFluxRequired(pa.name());autoPtr< viscosityModel > viscosity(viscosityModel::New(mesh))
const dimensionSet dimDensity
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
virtual bool read()
Re-read model coefficients if they have changed.
virtual tmp< fvScalarMatrix > epsilonSource() const
Class to represent a interface between phases where one phase is considered dispersed within the othe...
void updateCoeffs()
Update the boundary condition coefficients.
virtual tmp< volScalarField > CdRe() const =0
Drag coefficient.
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.
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.
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.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
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.
const surfaceScalarField phig(-rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
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].
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
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 > &)
virtual tmp< volScalarField > K() const
Return the drag coefficient K.
A class for managing temporary objects.
const objectRegistry & db() const
Return the local objectRegistry.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
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.