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])
120 if (carrierIds_[i] == -1)
123 <<
"Could not find carrier specie " << names_[i]
124 <<
" in species list" <<
nl 125 <<
"Available species are: " <<
nl << carrierNames <<
nl 132 void Foam::phaseProperties::checkTotalMassFraction()
const 137 total += Y_[speciei];
140 if (Y_.size() != 0 &&
mag(total - 1.0) > small)
143 <<
"Specie fractions must total to unity for phase " 144 << phaseTypeNames[phase_] <<
nl 145 <<
"Species: " <<
nl << names_ <<
nl 151 Foam::word Foam::phaseProperties::phaseToStateLabel(
const phaseType pt)
const 153 word state =
"(unknown)";
174 <<
"Invalid phase: " << phaseTypeNames[pt] <<
nl 175 <<
" phase must be gas, liquid or solid" <<
nl 189 stateLabel_(
"(unknown)"),
204 void Foam::phaseProperties::reorder
219 setCarrierIds(gasNames);
226 reorder(liquidNames);
228 setCarrierIds(gasNames);
244 <<
" phase must be gas, liquid or solid" <<
nl 277 if (speciei >= names_.
size())
280 <<
"Requested specie " << speciei <<
"out of range" <<
nl 281 <<
"Available phase species:" <<
nl << names_ <<
nl 285 return names_[speciei];
297 if (speciei >= Y_.
size())
300 <<
"Requested specie " << speciei <<
"out of range" <<
nl 301 <<
"Available phase species:" <<
nl << names_ <<
nl 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.
phaseType
Phase type enumeration.
const List< word > & names() const
Return the list of specie names.
const labelList & carrierIds() const
Return const access to the map to the carrier ids.
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.