29 #include "twoPhaseSystem.H" 30 #include "dragModel.H" 31 #include "virtualMassModel.H" 45 template<
class BasicTurbulenceModel>
54 const word& propertiesName,
70 liquidTurbulencePtr_(
nullptr),
141 this->runTime_.timeName(),
153 this->runTime_.timeName(),
161 bound(k_, this->kMin_);
162 bound(epsilon_, this->epsilonMin_);
164 if (type == typeName)
166 this->printCoeffs(type);
171 template<
class BasicTurbulenceModel>
177 const volScalarField::Boundary& ebf = epsilon.
boundaryField();
183 if (isA<fixedValueFvPatchScalarField>(ebf[
patchi]))
185 ebt[
patchi] = fixedValueFvPatchScalarField::typeName;
193 template<
class BasicTurbulenceModel>
201 const volScalarField::Boundary& refBf =
208 isA<inletOutletFvPatchScalarField>(bf[
patchi])
209 && isA<inletOutletFvPatchScalarField>(refBf[patchi])
212 refCast<inletOutletFvPatchScalarField>
214 refCast<const inletOutletFvPatchScalarField>
215 (refBf[
patchi]).refValue();
221 template<
class BasicTurbulenceModel>
224 if (rhom_.valid())
return;
237 this->runTime_.timeName(this->runTime_.startTime().value())
288 correctInletOutlet(km_(), kl);
302 mix(epsilonl, epsilong),
303 epsilonBoundaryTypes(epsilonl)
306 correctInletOutlet(epsilonm_(), epsilonl);
312 template<
class BasicTurbulenceModel>
317 Cmu_.readIfPresent(this->coeffDict());
318 C1_.readIfPresent(this->coeffDict());
319 C2_.readIfPresent(this->coeffDict());
320 C3_.readIfPresent(this->coeffDict());
321 Cp_.readIfPresent(this->coeffDict());
322 sigmak_.readIfPresent(this->coeffDict());
323 sigmaEps_.readIfPresent(this->coeffDict());
334 template<
class BasicTurbulenceModel>
337 this->nut_ = Cmu_*
sqr(k_)/epsilon_;
338 this->nut_.correctBoundaryConditions();
341 BasicTurbulenceModel::correctNut();
345 template<
class BasicTurbulenceModel>
349 if (!liquidTurbulencePtr_)
355 refCast<const twoPhaseSystem>(gas.fluid());
358 liquidTurbulencePtr_ =
372 return *liquidTurbulencePtr_;
376 template<
class BasicTurbulenceModel>
380 this->liquidTurbulence();
392 (6*this->Cmu_/(4*
sqrt(3.0/2.0)))
393 *fluid.Kd()/liquid.rho()
394 *(liquidTurbulence.
k_/liquidTurbulence.
epsilon_)
396 volScalarField Ct0((3 + beta)/(1 + beta + 2*gas.rho()/liquid.rho()));
397 volScalarField fAlphad((180 + (-4.71e3 + 4.26e4*alphag)*alphag)*alphag);
399 return sqr(1 + (Ct0 - 1)*
exp(-fAlphad));
403 template<
class BasicTurbulenceModel>
412 template<
class BasicTurbulenceModel>
423 template<
class BasicTurbulenceModel>
429 return alphal*rholEff() + alphag*rhogEff();
433 template<
class BasicTurbulenceModel>
443 return (alphal*rholEff()*fc + alphag*rhogEff()*fd)/rhom_();
447 template<
class BasicTurbulenceModel>
458 (alphal*rholEff()*fc + alphag*rhogEff()*Ct2_()*fd)
459 /(alphal*rholEff() + alphag*rhogEff()*Ct2_());
463 template<
class BasicTurbulenceModel>
485 template<
class BasicTurbulenceModel>
489 this->liquidTurbulence();
506 +
pow(drag.
CdRe()*liquid.nu()/gas.d(), 4.0/3.0)
523 template<
class BasicTurbulenceModel>
526 return fvm::Su(bubbleG()/rhom_(), km_());
530 template<
class BasicTurbulenceModel>
533 return fvm::Su(C3_*epsilonm_()*bubbleG()/(rhom_()*km_()), epsilonm_());
537 template<
class BasicTurbulenceModel>
544 if (&gas != &fluid.
phase1())
548 this->liquidTurbulence();
553 if (!this->turbulence_)
571 this->liquidTurbulence();
652 bound(km, this->kMin_);
653 epsilonm == mix(epsilonl, epsilong);
654 bound(epsilonm, this->epsilonMin_);
665 -
fvm::SuSp(((2.0/3.0)*C1_)*divUm, epsilonm)
666 -
fvm::Sp(C2_*epsilonm/km, epsilonm)
671 epsEqn.
ref().relax();
676 bound(epsilonm, this->epsilonMin_);
698 bound(km, this->kMin_);
701 volScalarField Cc2(rhom/(alphal*rholEff() + alphag*rhogEff()*Ct2_()));
704 epsilonl = Cc2*epsilonm;
711 epsilong = Ct2_()*epsilonl;
713 nutg = Ct2_()*(liquidTurbulence.nu()/this->
nu())*nutl;
const phaseModel & phase1() const
Return phase model 1.
BasicTurbulenceModel::alphaField alphaField
const modelType & lookupSubModel(const phasePair &key) const
Access a sub model between a phase pair.
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 > &)
BasicTurbulenceModel::rhoField rhoField
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.
BasicTurbulenceModel::transportModel transportModel
void correct(GeometricField< Type, fvPatchField, volMesh > &field)
Apply correction to 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
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
dimensionedScalar sqrt(const dimensionedScalar &ds)
wordList epsilonBoundaryTypes(const volScalarField &epsilon) 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.
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
mixtureKEpsilon(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName=turbulenceModel::propertiesName, const word &type=typeName)
Construct from components.
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
tmp< volScalarField > bubbleG() const
Class which solves the volume fraction equations for two phases.
tmp< volScalarField > rhogEff() const
Templated abstract base class for RAS turbulence models.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
bool read(const char *, int32_t &)
virtual void correctNut()
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
dimensionedScalar exp(const dimensionedScalar &ds)
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from string.
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.
virtual tmp< fvScalarMatrix > epsilonSource() const
void constrain(fvMatrix< Type > &eqn)
Apply constraints to equation.
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.
const phaseModel & otherPhase(const phaseModel &phase) const
Return the phase not given as an argument.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-7/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 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.
tmp< volScalarField > Ct2() const
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.
const dimensionedScalar & rho() const
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.
Mixture k-epsilon turbulence model for two-phase gas-liquid systems.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
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 > &)
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
A class for managing temporary objects.
virtual tmp< volScalarField > CdRe() const =0
Drag coefficient.
static options & New(const fvMesh &mesh)
Construct fvOptions and register to datbase if not present.
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...
tmp< volScalarField > rholEff() const
Calculate the matrix for implicit and explicit sources.