31 #include "phaseCompressibleTurbulenceModel.H" 42 #include "surfaceInterpolate.H" 47 template<
class BasePhaseModel>
53 IOobject::groupName(
"phi", this->
name()),
54 U.mesh().time().timeName(),
63 Info<<
"Reading face flux field " <<
io.name() <<
endl;
69 Info<<
"Calculating face flux field " <<
io.name() <<
endl;
71 io.readOpt(IOobject::NO_READ);
75 U.boundaryField().size(),
83 isA<fixedValueFvPatchVectorField>(
U.boundaryField()[i])
84 || isA<slipFvPatchVectorField>(
U.boundaryField()[i])
85 || isA<partialSlipFvPatchVectorField>(
U.boundaryField()[i])
88 patchTypes[i] = fixedValueFvPatchScalarField::typeName;
104 template<
class BasePhaseModel>
108 const word& phaseName,
112 BasePhaseModel(
fluid, phaseName, index),
168 IOobject::groupName(
"continuityErrorFlow", this->
name()),
175 continuityErrorSources_
179 IOobject::groupName(
"continuityErrorSources", this->
name()),
196 template<
class BasePhaseModel>
211 template<
class BasePhaseModel>
214 BasePhaseModel::correctKinematics();
230 K_.ref() = 0.5*
magSqr(this->
U());
235 template<
class BasePhaseModel>
240 turbulence_->correct();
244 template<
class BasePhaseModel>
247 BasePhaseModel::correctEnergyTransport();
249 turbulence_->correctEnergyTransport();
253 template<
class BasePhaseModel>
260 template<
class BasePhaseModel>
272 +
fvm::SuSp(- this->continuityError(), U_)
274 + turbulence_->divDevRhoReff(U_)
279 template<
class BasePhaseModel>
291 +
fvm::SuSp(- this->continuityErrorSources(), U_)
293 + turbulence_->divDevRhoReff(U_)
298 template<
class BasePhaseModel>
306 template<
class BasePhaseModel>
314 template<
class BasePhaseModel>
322 template<
class BasePhaseModel>
330 template<
class BasePhaseModel>
338 template<
class BasePhaseModel>
346 template<
class BasePhaseModel>
354 template<
class BasePhaseModel>
362 template<
class BasePhaseModel>
375 template<
class BasePhaseModel>
381 DUDtf_ =
byDt(phi_ - phi_.oldTime());
388 template<
class BasePhaseModel>
392 return continuityErrorFlow_ + continuityErrorSources_;
396 template<
class BasePhaseModel>
400 return continuityErrorFlow_;
404 template<
class BasePhaseModel>
408 return continuityErrorSources_;
412 template<
class BasePhaseModel>
429 template<
class BasePhaseModel>
437 template<
class BasePhaseModel>
444 template<
class BasePhaseModel>
448 return turbulence_->mut();
452 template<
class BasePhaseModel>
456 return turbulence_->muEff();
460 template<
class BasePhaseModel>
464 return turbulence_->nut();
468 template<
class BasePhaseModel>
472 return turbulence_->nuEff();
476 template<
class BasePhaseModel>
480 return turbulence_->kappaEff();
484 template<
class BasePhaseModel>
488 return turbulence_->kappaEff(patchi);
492 template<
class BasePhaseModel>
496 return turbulence_->alphaEff();
500 template<
class BasePhaseModel>
504 return turbulence_->alphaEff(patchi);
508 template<
class BasePhaseModel>
512 return turbulence_->k();
516 template<
class BasePhaseModel>
520 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.
wordList patchTypes(nPatches)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< volScalarField > trho
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 expressions::valueTypeCode::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...
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
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/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 > 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)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
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.