32 #include "twoPhaseSystem.H" 33 #include "dragModel.H" 34 #include "virtualMassModel.H" 48 template<
class BasicTurbulenceModel>
57 const word& propertiesName,
73 liquidTurbulencePtr_(
nullptr),
144 this->runTime_.timeName(),
156 this->runTime_.timeName(),
164 bound(k_, this->kMin_);
165 bound(epsilon_, this->epsilonMin_);
167 if (
type == typeName)
174 template<
class BasicTurbulenceModel>
186 if (isA<fixedValueFvPatchScalarField>(ebf[patchi]))
188 ebt[patchi] = fixedValueFvPatchScalarField::typeName;
196 template<
class BasicTurbulenceModel>
211 isA<inletOutletFvPatchScalarField>(bf[patchi])
212 && isA<inletOutletFvPatchScalarField>(refBf[patchi])
215 refCast<inletOutletFvPatchScalarField>
216 (bf[patchi]).refValue() =
217 refCast<const inletOutletFvPatchScalarField>
218 (refBf[patchi]).refValue();
224 template<
class BasicTurbulenceModel>
234 mixtureKEpsilon<BasicTurbulenceModel>& turbc = this->liquidTurbulence();
240 this->runTime_.timeName(this->runTime_.startTime().value())
288 kl.boundaryField().types()
291 correctInletOutlet(km_(), kl);
305 mix(epsilonl, epsilong),
306 epsilonBoundaryTypes(epsilonl)
309 correctInletOutlet(epsilonm_(), epsilonl);
315 template<
class BasicTurbulenceModel>
320 Cmu_.readIfPresent(this->coeffDict());
321 C1_.readIfPresent(this->coeffDict());
322 C2_.readIfPresent(this->coeffDict());
323 C3_.readIfPresent(this->coeffDict());
324 Cp_.readIfPresent(this->coeffDict());
325 sigmak_.readIfPresent(this->coeffDict());
326 sigmaEps_.readIfPresent(this->coeffDict());
335 template<
class BasicTurbulenceModel>
338 this->nut_ = Cmu_*
sqr(k_)/epsilon_;
339 this->nut_.correctBoundaryConditions();
342 BasicTurbulenceModel::correctNut();
346 template<
class BasicTurbulenceModel>
347 mixtureKEpsilon<BasicTurbulenceModel>&
348 mixtureKEpsilon<BasicTurbulenceModel>::liquidTurbulence()
const 350 if (!liquidTurbulencePtr_)
354 const transportModel& gas = this->transport();
355 const twoPhaseSystem&
fluid =
356 refCast<const twoPhaseSystem>(gas.fluid());
357 const transportModel& liquid =
fluid.otherPhase(gas);
359 liquidTurbulencePtr_ =
360 &
const_cast<mixtureKEpsilon<BasicTurbulenceModel>&
> 362 U.db().lookupObject<mixtureKEpsilon<BasicTurbulenceModel>>
373 return *liquidTurbulencePtr_;
377 template<
class BasicTurbulenceModel>
380 const mixtureKEpsilon<BasicTurbulenceModel>& liquidTurbulence =
381 this->liquidTurbulence();
393 (6*this->Cmu_/(4*
sqrt(3.0/2.0)))
395 *(liquidTurbulence.k_/liquidTurbulence.epsilon_)
400 return sqr(1 + (Ct0 - 1)*
exp(-fAlphad));
404 template<
class BasicTurbulenceModel>
409 return fluid.otherPhase(gas).rho();
413 template<
class BasicTurbulenceModel>
422 + virtualMass.
Cvm()*
fluid.otherPhase(gas).rho();
426 template<
class BasicTurbulenceModel>
432 return alphal*rholEff() + alphag*rhogEff();
436 template<
class BasicTurbulenceModel>
446 return (
alphal*rholEff()*fc + alphag*rhogEff()*fd)/rhom_();
450 template<
class BasicTurbulenceModel>
461 (
alphal*rholEff()*fc + alphag*rhogEff()*Ct2_()*fd)
462 /(
alphal*rholEff() + alphag*rhogEff()*Ct2_());
466 template<
class BasicTurbulenceModel>
488 template<
class BasicTurbulenceModel>
492 this->liquidTurbulence();
526 template<
class BasicTurbulenceModel>
529 return fvm::Su(bubbleG()/rhom_(), km_());
533 template<
class BasicTurbulenceModel>
536 return fvm::Su(C3_*epsilonm_()*bubbleG()/(rhom_()*km_()), epsilonm_());
540 template<
class BasicTurbulenceModel>
547 if (&gas != &
fluid.phase1())
551 this->liquidTurbulence();
556 if (!this->turbulence_)
565 tmp<surfaceScalarField>
phig = this->
phi();
573 mixtureKEpsilon<BasicTurbulenceModel>& liquidTurbulence =
574 this->liquidTurbulence();
575 tmp<surfaceScalarField> phil = liquidTurbulence.phi();
589 eddyViscosity<RASModel<BasicTurbulenceModel>>
::correct();
607 tmp<volScalarField> Gc;
609 tmp<volTensorField> tgradUl =
fvc::grad(Ul);
610 Gc = tmp<volScalarField>
621 kl.boundaryFieldRef().updateCoeffs();
623 kl.boundaryFieldRef().evaluateCoupled<coupledFvPatch>();
625 epsilonl.boundaryFieldRef().updateCoeffs();
626 epsilonl.boundaryFieldRef().evaluateCoupled<coupledFvPatch>();
631 tmp<volScalarField> Gd;
633 tmp<volTensorField> tgradUg =
fvc::grad(Ug);
634 Gd = tmp<volScalarField>
645 kg.boundaryFieldRef().updateCoeffs();
647 kg.boundaryFieldRef().evaluateCoupled<coupledFvPatch>();
648 epsilong.boundaryFieldRef().updateCoeffs();
650 epsilong.boundaryFieldRef().evaluateCoupled<coupledFvPatch>();
663 bound(km, this->kMin_);
664 epsilonm == mix(epsilonl, epsilong);
665 bound(epsilonm, this->epsilonMin_);
668 tmp<fvScalarMatrix> epsEqn
676 -
fvm::SuSp(((2.0/3.0)*C1_)*divUm, epsilonm)
677 -
fvm::Sp(C2_*epsilonm/km, epsilonm)
682 epsEqn.ref().relax();
684 epsEqn.ref().boundaryManipulate(epsilonm.boundaryFieldRef());
687 bound(epsilonm, this->epsilonMin_);
691 tmp<fvScalarMatrix> kmEqn
709 bound(km, this->kMin_);
710 km.correctBoundaryConditions();
714 kl.correctBoundaryConditions();
715 epsilonl = Cc2*epsilonm;
716 epsilonl.correctBoundaryConditions();
717 liquidTurbulence.correctNut();
721 kg.correctBoundaryConditions();
722 epsilong = Ct2_()*epsilonl;
723 epsilong.correctBoundaryConditions();
724 nutg = Ct2_()*(liquidTurbulence.nu()/this->
nu())*nutl;
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
void correct(GeometricField< Type, PatchField, GeoMesh > &field)
Apply correction to field.
BasicTurbulenceModel::alphaField alphaField
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
BasicTurbulenceModel::rhoField rhoField
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
BasicTurbulenceModel::transportModel transportModel
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())
wordList types() const
Return a list of the patch types.
dimensionedScalar sqrt(const dimensionedScalar &ds)
wordList epsilonBoundaryTypes(const volScalarField &epsilon) const
Generic dimensioned Type class.
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.
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
bool read(const char *buf, int32_t &val)
Same as readInt32.
tmp< volScalarField > bubbleG() const
Class which solves the volume fraction equations for two phases.
tmp< volScalarField > rhogEff() const
#define forAll(list, i)
Loop across all elements in list.
Templated abstract base class for RAS turbulence models.
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.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
virtual void correctNut()
scalar rho(scalar p, scalar T) const
Liquid density [kg/m^3].
dimensionedScalar exp(const dimensionedScalar &ds)
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
virtual bool read()
Re-read model coefficients if they have changed.
Reading is optional [identical to LAZY_READ].
virtual tmp< fvScalarMatrix > epsilonSource() const
zeroField SuSp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
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 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.
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()
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.
volScalarField & bound(volScalarField &, const dimensionedScalar &lowerBound)
Bound the given scalar field if it has gone unbounded.
Mixture k-epsilon turbulence model for two-phase gas-liquid systems.
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. ...
Automatically write from objectRegistry::writeObject()
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
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: [].
void correctInletOutlet(volScalarField &vsf, const volScalarField &refVsf) const
Defines the attributes of an object for which implicit objectRegistry management is supported...
tmp< volScalarField > rholEff() const
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
Calculate the finiteVolume matrix for implicit and explicit sources.
SymmTensor< Cmpt > devTwoSymm(const SymmTensor< Cmpt > &st)
Return the deviatoric part of twice the symmetric part of a SymmTensor.