31 #include "phaseCompressibleTurbulenceModel.H" 42 #include "surfaceInterpolate.H" 47 template<
class BasePhaseModel>
51 word phiName(IOobject::groupName(
"phi", this->
name()));
56 U.mesh().time().timeName(),
63 Info<<
"Reading face flux field " << phiName <<
endl;
65 return tmp<surfaceScalarField>
72 U.mesh().time().timeName(),
83 Info<<
"Calculating face flux field " << phiName <<
endl;
87 U.boundaryField().size(),
95 isA<fixedValueFvPatchVectorField>(
U.boundaryField()[i])
96 || isA<slipFvPatchVectorField>(
U.boundaryField()[i])
97 || isA<partialSlipFvPatchVectorField>(
U.boundaryField()[i])
100 phiTypes[i] = fixedValueFvPatchScalarField::typeName;
104 return tmp<surfaceScalarField>
111 U.mesh().time().timeName(),
126 template<
class BasePhaseModel>
130 const word& phaseName,
134 BasePhaseModel(
fluid, phaseName, index),
189 IOobject::groupName(
"continuityErrorFlow", this->
name()),
196 continuityErrorSources_
200 IOobject::groupName(
"continuityErrorSources", this->
name()),
217 template<
class BasePhaseModel>
232 template<
class BasePhaseModel>
235 BasePhaseModel::correctKinematics();
251 K_.ref() = 0.5*
magSqr(this->
U());
256 template<
class BasePhaseModel>
261 turbulence_->correct();
265 template<
class BasePhaseModel>
268 BasePhaseModel::correctEnergyTransport();
270 turbulence_->correctEnergyTransport();
274 template<
class BasePhaseModel>
281 template<
class BasePhaseModel>
292 +
fvm::SuSp(- this->continuityError(), U_)
294 + turbulence_->divDevRhoReff(U_)
299 template<
class BasePhaseModel>
312 +
fvm::SuSp(- this->continuityErrorSources(), U_)
314 + turbulence_->divDevRhoReff(U_)
319 template<
class BasePhaseModel>
327 template<
class BasePhaseModel>
335 template<
class BasePhaseModel>
343 template<
class BasePhaseModel>
351 template<
class BasePhaseModel>
359 template<
class BasePhaseModel>
367 template<
class BasePhaseModel>
375 template<
class BasePhaseModel>
383 template<
class BasePhaseModel>
396 template<
class BasePhaseModel>
402 DUDtf_ =
byDt(phi_ - phi_.oldTime());
409 template<
class BasePhaseModel>
413 return continuityErrorFlow_ + continuityErrorSources_;
417 template<
class BasePhaseModel>
421 return continuityErrorFlow_;
425 template<
class BasePhaseModel>
429 return continuityErrorSources_;
433 template<
class BasePhaseModel>
450 template<
class BasePhaseModel>
458 template<
class BasePhaseModel>
465 template<
class BasePhaseModel>
469 return turbulence_->mut();
473 template<
class BasePhaseModel>
477 return turbulence_->muEff();
481 template<
class BasePhaseModel>
485 return turbulence_->nut();
489 template<
class BasePhaseModel>
493 return turbulence_->nuEff();
497 template<
class BasePhaseModel>
501 return turbulence_->kappaEff();
505 template<
class BasePhaseModel>
509 return turbulence_->kappaEff(patchi);
513 template<
class BasePhaseModel>
517 return turbulence_->alphaEff();
521 template<
class BasePhaseModel>
525 return turbulence_->alphaEff(patchi);
529 template<
class BasePhaseModel>
533 return turbulence_->k();
537 template<
class BasePhaseModel>
541 return turbulence_->pPrime();
virtual tmp< volVectorField > U() const
Access const reference to U.
fv::options & fvOptions() const
Access the fvOptions.
tmp< GeometricField< Type, fvPatchField, volMesh > > DDt(const surfaceScalarField &phi, const GeometricField< Type, fvPatchField, volMesh > &psi)
virtual tmp< fvVectorMatrix > UEqn()
Return the momentum equation.
virtual tmp< volScalarField > mut() const
Return the turbulent dynamic viscosity.
virtual tmp< surfaceScalarField > DUDtf() const
Return the substantive acceleration on the faces.
virtual tmp< fvVectorMatrix > UfEqn()
Return the momentum equation for the face-based algorithm.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
virtual tmp< volScalarField > nuEff() const
Return the effective kinematic viscosity.
MovingPhaseModel(const multiphaseInterSystem &fluid, const word &phaseName)
virtual void correctKinematics()
Correct the kinematics.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
virtual void correct()
Correct the phase properties other than the thermo and turbulence.
virtual surfaceScalarField & alphaPhiRef()
Access the volumetric flux of the phase.
fluid correctTurbulence()
GeometricField< vector, fvPatchField, volMesh > volVectorField
virtual tmp< volScalarField > continuityErrorFlow() const
Return the continuity error due to the flow field.
virtual tmp< volScalarField > K() const
Return the phase kinetic energy.
virtual tmp< volVectorField > DUDt() const
Return the substantive acceleration.
virtual tmp< surfaceScalarField > alphaRhoPhi() const
Return the mass flux of the phase.
#define forAll(list, i)
Loop across all elements in list.
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Calculate the first temporal derivative.
psiReactionThermo & thermo
const word calculatedType
A calculated patch field type.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
writeOption writeOpt() const noexcept
Get the write option.
void correctBoundaryVelocity(volVectorField &U) const
Correct the boundary velocity for the rotation of the MRF region.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
virtual volVectorField & URef()
Access the velocity.
Class to represent a system of phases and model interfacial transfers between them.
A class for handling words, derived from Foam::string.
Calculate the face-flux of the given field.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
virtual surfaceScalarField & phiRef()
Access the volumetric flux.
Calculate the matrix for the first temporal derivative.
const IOMRFZoneList & MRF() const
Return MRF zones.
tmp< volScalarField > byDt(const volScalarField &vf)
zeroField SuSp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
virtual tmp< volScalarField > kappaEff() const
Return the effective thermal conductivity.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
virtual tmp< volScalarField > rho() const
Density [kg/m^3] - uses current value of pressure.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Calculate the divergence of the given field.
virtual tmp< volScalarField > divU() const
Return the phase dilatation rate (d(alpha)/dt + div(alpha*phi))
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
virtual tmp< volScalarField > k() const
Return the turbulent kinetic energy.
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/v2306/OpenFOAM-v2306/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 > muEff() const
Return the effective dynamic viscosity.
virtual tmp< volScalarField > alphaEff() const
Return the effective thermal diffusivity.
const dimensionSet dimDensity
Calculate the matrix for the divergence of the given field and flux.
List< word > wordList
List of word.
virtual tmp< volScalarField > continuityError() const
Return the continuity error.
Automatically write from objectRegistry::writeObject()
virtual void correctEnergyTransport()
Correct the energy transport e.g. alphat.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field from name, mesh, dimensions and patch type.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
virtual void correctTurbulence()
Correct the turbulence.
Defines the attributes of an object for which implicit objectRegistry management is supported...
virtual tmp< volScalarField > pPrime() const
Return the phase-pressure'.
virtual tmp< volScalarField > continuityErrorSources() const
Return the continuity error due to any sources.
virtual surfaceScalarField & alphaRhoPhiRef()
Access the mass flux of the phase.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Calculate the finiteVolume matrix for implicit and explicit sources.
virtual bool stationary() const
Return whether the phase is stationary.
virtual tmp< volScalarField > nut() const
Return the turbulent kinematic viscosity.
virtual tmp< surfaceScalarField > phi() const
Constant access the volumetric flux.
virtual tmp< surfaceScalarField > alphaPhi() const
Constant access the volumetric flux of the phase.