Go to the documentation of this file.
30 #include "phaseSystem.H"
31 #include "multiphaseSystem.H"
46 template<
class BasePhaseModel,
class phaseThermo>
54 BasePhaseModel(
fluid, phaseName),
68 if (thermoPtr_->composition().species().empty())
71 <<
" The selected thermo is pure. Use a multicomponent thermo."
75 species_ = thermoPtr_->composition().species();
77 inertIndex_ = species_[thermoPtr_().template get<word>(
"inertSpecie")];
79 X_.setSize(thermoPtr_->composition().species().size());
91 IOobject::groupName(
"X" + species_[i], phaseName),
92 fluid.mesh().time().timeName(),
103 calculateVolumeFractions();
110 template<
class BasePhaseModel,
class phaseThermo>
126 if (i != inertIndex_)
132 const volScalarField::Boundary& YBf =
Y()[i].boundaryField();
139 scalarField& xbf = X_[i].boundaryFieldRef()[patchi];
140 const scalarField& ybf =
Y()[i].boundaryField()[patchi];
144 xbf[facei] = Wbf[facei]*ybf[facei]/Wi.
value();
150 X_[inertIndex_] = 1.0 - Xtotal;
155 template<
class BasePhaseModel,
class phaseThermo>
160 for(label i=1; i< species_.size(); i++)
162 W += X_[i]*
thermo().composition().W(i);
167 Y()[i] = X_[i]*
thermo().composition().W(i)/W;
169 Info<<
Y()[i].name() <<
" mass fraction = "
170 <<
" Min(Y) = " <<
min(
Y()[i]).value()
171 <<
" Max(Y) = " <<
max(
Y()[i]).value()
177 template<
class BasePhaseModel,
class phaseThermo>
185 template<
class BasePhaseModel,
class phaseThermo>
193 template<
class BasePhaseModel,
class phaseThermo>
196 return thermo().correct();
200 template<
class BasePhaseModel,
class phaseThermo>
213 scalar cAlpha(MULEScontrols.
get<scalar>(
"cYi"));
237 surfaceScalarField::Boundary& phirBf =
phir.boundaryFieldRef();
248 word phirScheme(
"div(Yiphir," +
alpha1.name() +
')');
252 if (inertIndex_ != i)
261 "phi" + Yi.name() +
"Corr",
266 "div(phi," + Yi.name() +
')'
307 if (phi1p[facei] < 0)
309 phiYiCorrp[facei] = Yip[facei]*phi1p[facei];
317 1.0/
mesh.time().deltaT().value(),
340 if (inertIndex_ != i)
362 phiYiCorr += YiEqn.
flux();
364 if (nYiSubCycles > 1)
369 !(++YiSubCycle).
end();
403 X_[inertIndex_] = scalar(1) -
Yt;
404 X_[inertIndex_].max(0.0);
406 calculateMassFractions();
410 template<
class BasePhaseModel,
class phaseThermo>
414 return thermoPtr_->composition().Y();
418 template<
class BasePhaseModel,
class phaseThermo>
422 return thermoPtr_->composition().Y();
426 template<
class BasePhaseModel,
class phaseThermo>
Defines the attributes of an object for which implicit objectRegistry management is supported,...
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
CMULES: Multidimensional universal limiter for explicit corrected implicit solution.
A class for handling words, derived from Foam::string.
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)
Upwind differencing scheme class.
const volScalarField & alpha2
psiReactionThermo & thermo
const word dictName("faMeshDefinition")
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
virtual void solveYi(PtrList< volScalarField::Internal > &, PtrList< volScalarField::Internal > &)
Solve species fraction equation.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Calculate the divergence of the given field.
const dimensionSet dimMoles(0, 0, 0, 0, 1, 0, 0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type & value() const
Return const reference to value.
const volScalarField & alpha1
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
virtual bool fixesValue() const
Return true if this patch field fixes a value.
virtual const PtrList< volScalarField > & Y() const
Constant access the species mass fractions.
Basic second-order convection using face-gradients and Gauss' theorem.
basicSpecieMixture & composition
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.
Calculate the matrix for the divergence of the given field and flux.
#define forAll(list, i)
Loop across all elements in list.
surfaceScalarField phic(mixture.cAlpha() *mag(alphaPhic/mesh.magSf()))
void calculateMassFractions()
Transfor volume fraction into mass fractions.
MultiComponentPhaseModel(const phaseSystem &fluid, const word &phaseName)
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
label inertIndex() const
Return inert species index.
volScalarField Yt(0.0 *Y[0])
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual void correct()
Correct phase thermo.
Calculate the matrix for the laplacian of the field.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
Mesh data needed to do the Finite Volume discretisation.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
PtrList< volScalarField > & Y
Calculate the matrix for implicit and explicit sources.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void correctBoundaryConditions()
Correct boundary field.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Calculate the substantive (total) derivative.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Calculate the face-flux of the given field.
A class representing the concept of a field of 1 used to avoid unnecessary manipulations for objects ...
A special matrix type and solver, designed for finite volume solutions of scalar equations....
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
Calculate the first temporal derivative.
Class to represent a system of phases and model interfacial transfers between them.
void calculateVolumeFractions()
Transfor mass fraction into volume fractions.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
virtual bool coupled() const
Return true if this patch field is coupled.
Basic first-order Euler implicit/explicit ddt using only the current and previous time-step values.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux() const
Return the face-flux field from the matrix.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Calculate the matrix for the first temporal derivative.
multiphaseSystem::phaseModelList & phases
virtual const phaseThermo & thermo() const
Access to thermo.
Perform a subCycleTime on a field.