52 void Foam::phaseProperties::reorder(
const wordList& specieNames)
70 if (names_.size() != names0.
size())
83 if (names_[j] == names0[i])
94 <<
"Could not find specie " << names0[i]
95 <<
" in list " << names_
96 <<
" for phase " << phaseTypeNames[phase_]
103 void Foam::phaseProperties::setCarrierIds
114 if (carrierNames[j] == names_[i])
124 void Foam::phaseProperties::checkTotalMassFraction()
const 129 total += Y_[speciei];
132 if (Y_.size() != 0 &&
mag(total - 1.0) > small)
135 <<
"Specie fractions must total to unity for phase " 136 << phaseTypeNames[phase_] <<
nl 137 <<
"Species: " <<
nl << names_ <<
nl 143 Foam::word Foam::phaseProperties::phaseToStateLabel(
const phaseType pt)
const 145 word state =
"(unknown)";
166 <<
"Invalid phase: " << phaseTypeNames[pt] <<
nl 167 <<
" phase must be gas, liquid or solid" <<
nl 181 stateLabel_(
"(unknown)"),
196 void Foam::phaseProperties::reorder
211 setCarrierIds(gasNames);
218 reorder(liquidNames);
220 setCarrierIds(gasNames);
229 setCarrierIds(gasNames);
236 <<
" phase must be gas, liquid or solid" <<
nl 269 if (speciei >= names_.
size())
272 <<
"Requested specie " << speciei <<
"out of range" <<
nl 273 <<
"Available phase species:" <<
nl << names_ <<
nl 277 return names_[speciei];
289 if (speciei >= Y_.
size())
292 <<
"Requested specie " << speciei <<
"out of range" <<
nl 293 <<
"Available phase species:" <<
nl << names_ <<
nl 303 if (carrierIds_[speciei] == -1)
306 <<
"Could not find specie " << names_[speciei]
307 <<
" in carrier " <<
nl 311 return carrierIds_[speciei];
319 if (names_[speciei] == specieName)
const word & stateLabel() const
Return const access to the phase state label.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
label id(const word &specieName) const
Return the id of a specie in the local list by name.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void size(const label)
Override size to be inconsistent with allocated storage.
const scalarField & Y() const
Return const access to all specie mass fractions.
Initialise the NamedEnum HashTable from the static list of names.
~phaseProperties()
Destructor.
scalarList Y0(nSpecie, 0.0)
static const NamedEnum< phaseType, 4 > phaseTypeNames
Corresponding word representations for phase type enumerations.
A class for handling words, derived from string.
label carrierId(const label speciei) const
Return the carrier id for a given specie.
phaseType
Phase type enumeration.
const List< word > & names() const
Return the list of specie names.
phaseType phase() const
Return const access to the phase type.
const word & name(const label speciei) const
Return const access to a specie name.
void setSize(const label)
Reset size of List.
phaseProperties()
Null constructor.
dimensioned< scalar > mag(const dimensioned< Type > &)
word phaseTypeName() const
Return word representation of the phase type.