41 template<
class BasePhaseModel>
45 word phiName(IOobject::groupName(
"phi", this->
name()));
50 U.mesh().time().timeName(),
57 Info<<
"Reading face flux field " << phiName <<
endl;
59 return tmp<surfaceScalarField>
66 U.mesh().time().timeName(),
77 Info<<
"Calculating face flux field " << phiName <<
endl;
81 U.boundaryField().size(),
82 calculatedFvPatchScalarField::typeName
87 if (!U.boundaryField()[
patchi].assignable())
89 phiTypes[
patchi] = fixedValueFvPatchScalarField::typeName;
93 return tmp<surfaceScalarField>
100 U.mesh().time().timeName(),
115 template<
class BasePhaseModel>
118 const phaseSystem& fluid,
119 const word& phaseName,
120 const bool referencePhase,
124 BasePhaseModel(fluid, phaseName, referencePhase, index),
129 IOobject::groupName(
"U", this->
name()),
142 IOobject::groupName(
"alphaPhi", this->
name()),
153 IOobject::groupName(
"alphaRhoPhi", this->
name()),
176 thermophysicalTransport_
178 PhaseThermophysicalTransportModel
182 >::
New(turbulence_, this->thermo_)
188 IOobject::groupName(
"continuityError", this->
name()),
199 if (fluid.mesh().dynamic())
206 fluid.mesh().time().timeName(),
221 template<
class BasePhaseModel>
228 template<
class BasePhaseModel>
240 template<
class BasePhaseModel>
244 this->
fluid().MRF().correctBoundaryVelocity(U_);
248 template<
class BasePhaseModel>
251 BasePhaseModel::correctKinematics();
267 K_.ref() = 0.5*
magSqr(this->
U());
272 template<
class BasePhaseModel>
275 BasePhaseModel::correctTurbulence();
277 turbulence_->correct();
281 template<
class BasePhaseModel>
284 BasePhaseModel::correctEnergyTransport();
285 thermophysicalTransport_->correct();
289 template<
class BasePhaseModel>
292 const fvMesh& mesh = this->
fluid().mesh();
300 surfaceVectorField::Boundary& UfBf = Uf_.ref().boundaryFieldRef();
301 const volVectorField::Boundary& UBf = U_.boundaryField();
307 if (isA<cyclicAMIFvPatch>(mesh.boundary()[
patchi]))
316 template<
class BasePhaseModel>
323 template<
class BasePhaseModel>
334 +
fvm::SuSp(-this->continuityError(), U_)
336 + turbulence_->divDevTau(U_)
341 template<
class BasePhaseModel>
355 + turbulence_->divDevTau(U_)
360 template<
class BasePhaseModel>
368 template<
class BasePhaseModel>
376 template<
class BasePhaseModel>
384 template<
class BasePhaseModel>
392 template<
class BasePhaseModel>
398 ? tmp<surfaceVectorField>(Uf_())
399 : tmp<surfaceVectorField>();
403 template<
class BasePhaseModel>
414 <<
"Uf has not been allocated." 422 template<
class BasePhaseModel>
430 template<
class BasePhaseModel>
438 template<
class BasePhaseModel>
446 template<
class BasePhaseModel>
454 template<
class BasePhaseModel>
460 const tmp<surfaceScalarField> taphi(
fvc::absolute(phi_, U_));
465 return tmp<volVectorField>(DUDt_());
469 template<
class BasePhaseModel>
475 DUDtf_ =
byDt(phi_ - phi_.oldTime());
478 return tmp<surfaceScalarField>(DUDtf_());
482 template<
class BasePhaseModel>
486 return continuityError_;
490 template<
class BasePhaseModel>
503 return tmp<volScalarField>(K_());
507 template<
class BasePhaseModel>
511 return divU_.valid() ? tmp<volScalarField>(divU_()) : tmp<volScalarField>();
515 template<
class BasePhaseModel>
522 template<
class BasePhaseModel>
526 return turbulence_->k();
530 template<
class BasePhaseModel>
534 return turbulence_->pPrime();
538 template<
class BasePhaseModel>
542 return thermophysicalTransport_->kappaEff(patchi);
546 template<
class BasePhaseModel>
550 return thermophysicalTransport_->divq(he);
554 template<
class BasePhaseModel>
558 return thermophysicalTransport_->divj(Yi);
#define forAll(list, i)
Loop across all elements in list.
virtual tmp< volScalarField > divU() const
Return the phase dilatation rate (d(alpha)/dt + div(alpha*phi))
tmp< GeometricField< Type, fvPatchField, volMesh > > DDt(const surfaceScalarField &phi, const GeometricField< Type, fvPatchField, volMesh > &psi)
tmp< fvMatrix< Type > > SuSp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
fluidReactionThermo & thermo
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual surfaceScalarField & alphaRhoPhiRef()
Access the mass flux of the phase.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual tmp< surfaceVectorField > Uf() const
Return the face velocity.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
virtual bool stationary() const
Return whether the phase is stationary.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual tmp< volVectorField > DUDt() const
Return the substantive acceleration.
virtual tmp< surfaceScalarField > alphaPhi() const
Return the volumetric flux of the phase.
virtual tmp< fvScalarMatrix > divj(volScalarField &Yi) const
Return the source term for the given specie mass-fraction.
virtual void correctTurbulence()
Correct the turbulence.
GeometricField< vector, fvPatchField, volMesh > volVectorField
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
virtual tmp< volScalarField > k() const
Return the turbulent kinetic energy.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Calculate the first temporal derivative.
CompressibleMomentumTransportModel< dynamicTransportModel > momentumTransportModel
const dimensionSet dimTime
MovingPhaseModel(const phaseSystem &fluid, const word &phaseName, const bool referencePhase, const label index)
virtual tmp< surfaceScalarField > alphaRhoPhi() const
Return the mass flux of the phase.
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
virtual tmp< fvVectorMatrix > UfEqn()
Return the momentum equation for the face-based algorithm.
virtual ~MovingPhaseModel()
Destructor.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-9/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()
Calculate the face-flux of the given field.
static word groupName(Name name, const word &group)
const dimensionSet dimDensity
virtual surfaceScalarField & phiRef()
Access the volumetric flux.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Calculate the matrix for the first temporal derivative.
virtual surfaceVectorField & UfRef()
Access the face velocity.
virtual volVectorField & URef()
Access the velocity.
virtual tmp< volScalarField > pPrime() const
Return the phase-pressure'.
Calculate the divergence of the given field.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
virtual void correctUf()
Correct the face velocity for moving meshes.
tmp< volScalarField > divU
virtual void correct()
Correct the phase properties other than the thermo and turbulence.
virtual tmp< volVectorField > U() const
Return the velocity.
word name(const complex &)
Return a string representation of a complex.
virtual void correctEnergyTransport()
Correct the energy transport e.g. alphat.
tmp< volScalarField > byDt(const volScalarField &vf)
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.
Internal & ref()
Return a reference to the dimensioned internal field.
static const GeometricField< vector, fvsPatchField, surfaceMesh > & null()
Return a null geometric field.
virtual tmp< volScalarField > continuityError() const
Return the continuity error.
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
Calculate the matrix for the divergence of the given field and flux.
List< word > wordList
A List of words.
virtual tmp< volScalarField > K() const
Return the phase kinetic energy.
virtual void correctContinuityError(const volScalarField &source)
Correct the continuity error.
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
fvModels source(alpha1, mixture.thermo1().rho())
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual surfaceScalarField & alphaPhiRef()
Access the volumetric flux of the phase.
virtual tmp< fvVectorMatrix > UEqn()
Return the momentum equation.
virtual tmp< scalarField > kappaEff(const label patchi) const
Return the effective thermal conductivity on a patch.
virtual void correctKinematics()
Correct the kinematics.
virtual tmp< surfaceScalarField > phi() const
Return the volumetric flux.
A class for managing temporary objects.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
virtual tmp< surfaceScalarField > DUDtf() const
Return the substantive acceleration on the faces.
Calculate the matrix for implicit and explicit sources.