30 template<
class Thermo,
class OtherThermo>
34 const dictionary& dict,
38 InterfaceCompositionModel<Thermo, OtherThermo>(dict, pair),
43 IOobject::groupName(
"gamma1", pair.
name()),
54 IOobject::groupName(
"gamma2", pair.
name()),
64 if (this->speciesNames_.size() != 2)
67 <<
"NonRandomTwoLiquid model is suitable for two species only." 71 species1Name_ = this->speciesNames_[0];
72 species2Name_ = this->speciesNames_[1];
74 species1Index_ = this->thermo_.composition().species()[species1Name_];
75 species2Index_ = this->thermo_.composition().species()[species2Name_];
81 dict.subDict(species1Name_).lookup(
"alpha")
87 dict.subDict(species2Name_).lookup(
"alpha")
94 dict.subDict(species1Name_).lookup(
"beta")
100 dict.subDict(species2Name_).lookup(
"beta")
103 saturationModel12_.reset
107 dict.subDict(species1Name_).subDict(
"interaction"),
111 saturationModel21_.reset
115 dict.subDict(species2Name_).subDict(
"interaction"),
124 dict.subDict(species1Name_),
133 dict.subDict(species2Name_),
142 template<
class Thermo,
class OtherThermo>
150 template<
class Thermo,
class OtherThermo>
162 this->thermo_.composition().Y(species1Index_)
168 this->thermo_.composition().Wi(species1Index_)
174 this->thermo_.composition().Y(species2Index_)
180 this->thermo_.composition().Wi(species2Index_)
198 tau21*
sqr(G21)/
max(
sqr(X1 + X2*G21), small)
199 + tau12*G12/
max(
sqr(X2 + X1*G12), small)
207 tau12*
sqr(G12)/
max(
sqr(X2 + X1*G12), small)
208 + tau21*G21/
max(
sqr(X1 + X2*G21), small)
214 template<
class Thermo,
class OtherThermo>
218 const word& speciesName,
222 if (speciesName == species1Name_)
225 this->otherThermo_.composition().Y(speciesName)
226 *speciesModel1_->Yf(speciesName, Tf)
229 else if (speciesName == species2Name_)
232 this->otherThermo_.composition().Y(speciesName)
233 *speciesModel2_->Yf(speciesName, Tf)
239 this->thermo_.composition().Y(speciesName)
240 *(scalar(1) - Yf(species1Name_, Tf) - Yf(species2Name_, Tf));
245 template<
class Thermo,
class OtherThermo>
250 const word& speciesName,
254 if (speciesName == species1Name_)
257 this->otherThermo_.composition().Y(speciesName)
258 *speciesModel1_->YfPrime(speciesName, Tf)
261 else if (speciesName == species2Name_)
264 this->otherThermo_.composition().Y(speciesName)
265 *speciesModel2_->YfPrime(speciesName, Tf)
271 - this->thermo_.composition().Y(speciesName)
272 *(YfPrime(species1Name_, Tf) + YfPrime(species2Name_, Tf));
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
virtual tmp< volScalarField > Yf(const word &speciesName, const volScalarField &Tf) const
The interface species fraction.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
virtual tmp< volScalarField > YfPrime(const word &speciesName, const volScalarField &Tf) const
The interface species fraction derivative w.r.t. temperature.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar exp(const dimensionedScalar &ds)
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
NonRandomTwoLiquid(const dictionary &dict, const phasePair &pair)
Construct from components.
const dimensionSet dimMoles(0, 0, 0, 0, 1, 0, 0)
word name(const complex &)
Return a string representation of a complex.
virtual ~NonRandomTwoLiquid()
Destructor.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const scalarList W(::W(thermo))
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
A class for managing temporary objects.
virtual void update(const volScalarField &Tf)
Update the composition.