45 template<
class BasePhaseModel,
class phaseThermo>
53 BasePhaseModel(
fluid, phaseName),
71 <<
" The selected thermo is pure. Use a multicomponent thermo." 80 thermoPtr_().template getOrDefault<bool>(
"addDiffusion",
false);
97 fluid.mesh().time().timeName(),
115 template<
class BasePhaseModel,
class phaseThermo>
131 if (i != inertIndex_)
144 scalarField& xbf = X_[i].boundaryFieldRef()[patchi];
145 const scalarField& ybf =
Y()[i].boundaryField()[patchi];
149 xbf[facei] = Wbf[facei]*ybf[facei]/Wi.
value();
155 X_[inertIndex_] = 1.0 - Xtotal;
160 template<
class BasePhaseModel,
class phaseThermo>
165 for(label i=1; i< species_.size(); i++)
174 Info<<
Y()[i].name() <<
" mass fraction = " 175 <<
" Min(Y) = " <<
min(
Y()[i]).value()
176 <<
" Max(Y) = " <<
max(
Y()[i]).value()
182 template<
class BasePhaseModel,
class phaseThermo>
190 template<
class BasePhaseModel,
class phaseThermo>
198 template<
class BasePhaseModel,
class phaseThermo>
205 template<
class BasePhaseModel,
class phaseThermo>
218 scalar cAlpha(MULEScontrols.
get<scalar>(
"cYi"));
250 if (!phirp.coupled())
256 word phirScheme(
"div(Yiphir," +
alpha1.
name() +
')');
260 if (inertIndex_ != i)
269 "phi" + Yi.name() +
"Corr",
274 "div(phi," + Yi.name() +
')' 305 forAll(phiYiCorr.boundaryField(), patchi)
308 phiYiCorr.boundaryFieldRef()[patchi];
310 if (!phiYiCorrp.coupled())
313 const scalarField& Yip = Yi.boundaryField()[patchi];
317 if (phi1p[facei] < 0)
319 phiYiCorrp[facei] = Yip[facei]*phi1p[facei];
350 if (inertIndex_ != i)
356 fv::EulerDdtScheme<scalar>(
mesh).fvmDdt(Yi)
357 + fv::gaussConvectionScheme<scalar>
372 phiYiCorr += YiEqn.flux();
374 if (nYiSubCycles > 1)
378 subCycle<volScalarField> YiSubCycle(Yi, nYiSubCycles);
379 !(++YiSubCycle).
end();
423 YiDiffEqn.solve(
"diffusion" + Yi.name());
430 X_[inertIndex_] = scalar(1) -
Yt;
433 calculateMassFractions();
437 template<
class BasePhaseModel,
class phaseThermo>
441 return thermoPtr_->composition().Y();
445 template<
class BasePhaseModel,
class phaseThermo>
449 return thermoPtr_->composition().Y();
453 template<
class BasePhaseModel,
class phaseThermo>
scalar Sct_
Schmidt number.
word dictName() const
The local dictionary name (final part of scoped name)
void clamp_min(const Type &lower)
Impose lower (floor) clamp on the field values (in-place)
fvsPatchField< scalar > fvsPatchScalarField
void limit(const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phi, surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su, const PsiMaxType &psiMax, const PsiMinType &psiMin, const bool returnCorr)
label inertIndex_
Inert species index.
const Type & value() const noexcept
Return const reference to value.
fvMatrix< scalar > fvScalarMatrix
virtual void solveYi(PtrList< volScalarField::Internal > &, PtrList< volScalarField::Internal > &)
Solve species fraction equation.
multiphaseSystem::phaseModelList & phases
static word phasePropertyName(const word &name, const word &phaseName)
The phase property name as property.phase.
scalar deltaTValue() const noexcept
Return time step value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
basicSpecieMixture & composition
bool empty() const noexcept
Deprecated(2020-07) True if the managed pointer is null.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
const word & name() const noexcept
Return the object name.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
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.
Calculate the matrix for the laplacian of the field.
void calculateVolumeFractions()
Transfor mass fraction into volume fractions.
const volScalarField & alpha2
GeometricBoundaryField< scalar, fvsPatchField, surfaceMesh > Boundary
Type of boundary fields.
Ignore writing from objectRegistry::writeObject()
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
const Time & time() const
Return the top-level database.
Calculate the substantive (total) derivative.
const dictionary & solverDict(const word &name) const
The solver controls dictionary for the given field. Same as solversDict().subDict(...)
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.
PtrList< volScalarField > X_
Ptr list of volumetric fractions for species.
virtual void correct()
Correct phase thermo.
virtual const PtrList< volScalarField > & Y() const
Constant access the species mass fractions.
#define forAll(list, i)
Loop across all elements in list.
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Calculate the first temporal derivative.
psiReactionThermo & thermo
MultiComponentPhaseModel(const multiphaseInterSystem &fluid, const word &phaseName)
HashTable< autoPtr< multiphaseInter::phaseModel > > phaseModelTable
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
autoPtr< phaseThermo > thermoPtr_
Thermophysical model.
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
void calculateMassFractions()
Transfor volume fraction into mass fractions.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Calculate the face-flux of the given field.
bool addDiffusion_
Add diffusion transport on Yi's Eq.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Calculate the matrix for the first temporal derivative.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
Calculate the divergence of the given field.
const Mesh & mesh() const noexcept
Return mesh.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
const dimensionSet dimMoles(0, 0, 0, 0, 1, 0, 0)
Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
surfaceScalarField phic(mixture.cAlpha() *mag(alphaPhic/mesh.magSf()))
Calculate the matrix for the divergence of the given field and flux.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
PtrList< volScalarField > & Y
Mesh data needed to do the Finite Volume discretisation.
virtual bool fixesValue() const
True if the patch field fixes a value.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
void correctBoundaryConditions()
Correct boundary field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual basicSpecieMixture & composition()=0
Return the composition of the multi-component mixture.
const surfaceScalarField & phi() const
Return the mixture flux.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
label find(const word &val) const
Find index of the value (searches the hash).
virtual void correct()=0
Update properties.
virtual scalar W(const label speciei) const =0
Molecular weight of the given specie [kg/kmol].
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
Defines the attributes of an object for which implicit objectRegistry management is supported...
virtual const phaseThermo & thermo() const
Access to thermo.
label inertIndex() const
Return inert species index.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
hashedWordList species_
Species table.
CMULES: Multidimensional universal limiter for explicit corrected implicit solution.
Calculate the finiteVolume matrix for implicit and explicit sources.
volScalarField Yt(0.0 *Y[0])
const volScalarField & alpha1