33template<
class ThermoType>
34const ThermoType& Foam::multiComponentMixture<ThermoType>::constructSpeciesData
44 new ThermoType(
thermoDict.subDict(species_[i]))
48 return speciesData_[0];
52template<
class ThermoType>
53void Foam::multiComponentMixture<ThermoType>::correctMassFractions()
58 for (label
n=1;
n<Y_.size();
n++)
63 if (
mag(
min(
Yt).value()) < ROOTVSMALL)
66 <<
"Sum of mass fractions is zero for species " << this->species()
69 <<
"Min of mass fraction sum " <<
min(
Yt).value()
76 if (diff > ROOTVSMALL)
79 <<
"Sum of mass fractions is different from one for species "
82 <<
"Max of mass fraction sum differs from 1 by " <<
diff
95template<
class ThermoType>
96Foam::multiComponentMixture<ThermoType>::multiComponentMixture
99 const wordList& specieNames,
100 const ReactionTable<ThermoType>& thermoData,
102 const word& phaseName
106 speciesData_(species_.size()),
107 mixture_(
"mixture", *thermoData[specieNames[0]]),
108 mixtureVol_(
"volMixture", *thermoData[specieNames[0]])
115 new ThermoType(*thermoData[
species_[i]])
119 correctMassFractions();
123template<
class ThermoType>
124Foam::multiComponentMixture<ThermoType>::multiComponentMixture
128 const word& phaseName
138 speciesData_(species_.size()),
139 mixture_(
"mixture", constructSpeciesData(
thermoDict)),
140 mixtureVol_(
"volMixture", speciesData_[0])
142 correctMassFractions();
148template<
class ThermoType>
154 mixture_ = Y_[0][celli]*speciesData_[0];
156 for (label
n=1;
n<Y_.size();
n++)
158 mixture_ += Y_[
n][celli]*speciesData_[
n];
165template<
class ThermoType>
172 mixture_ = Y_[0].boundaryField()[patchi][facei]*speciesData_[0];
174 for (label
n=1;
n<Y_.size();
n++)
176 mixture_ += Y_[
n].boundaryField()[patchi][facei]*speciesData_[
n];
183template<
class ThermoType>
194 rhoInv += Y_[i][celli]/speciesData_[i].rho(
p,
T);
198 Y_[0][celli]/speciesData_[0].rho(
p,
T)/rhoInv*speciesData_[0];
200 for (label
n=1;
n<Y_.size();
n++)
203 Y_[
n][celli]/speciesData_[
n].rho(
p,
T)/rhoInv*speciesData_[
n];
210template<
class ThermoType>
224 Y_[i].boundaryField()[patchi][facei]/speciesData_[i].rho(
p,
T);
228 Y_[0].boundaryField()[patchi][facei]/speciesData_[0].rho(
p,
T)/rhoInv
231 for (label
n=1;
n<Y_.size();
n++)
234 Y_[
n].boundaryField()[patchi][facei]/speciesData_[
n].rho(
p,
T)
235 / rhoInv*speciesData_[
n];
242template<
class ThermoType>
250 speciesData_[i] = ThermoType(
thermoDict.subDict(species_[i]));
volScalarField Yt(0.0 *Y[0])
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
speciesTable species_
Table of specie names.
PtrList< volScalarField > Y_
Species mass fractions.
basicSpecieMixture(const dictionary &thermoDict, const wordList &specieNames, const fvMesh &mesh, const word &phaseName)
Construct from dictionary, species names, mesh and phase name.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
const ThermoType & cellMixture(const label celli) const
const ThermoType & cellVolMixture(const scalar p, const scalar T, const label celli) const
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
const ThermoType & patchFaceVolMixture(const scalar p, const scalar T, const label patchi, const label facei) const
void read(const dictionary &)
Read dictionary.
Lookup type of boundary radiation properties.
A class for handling words, derived from Foam::string.
const dictionary & thermoDict
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
List< word > wordList
List of word.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & indent(Ostream &os)
Indent stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
HashPtrTable< ThermoType > ReactionTable
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.