Go to the documentation of this file.
83 if (
names_[j] == names0[i])
94 <<
"Could not find specie " << names0[i]
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
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
153 word state =
"(unknown)";
174 <<
"Invalid phase: " << phaseTypeNames[pt] <<
nl
175 <<
" phase must be gas, liquid or solid" <<
nl
189 stateLabel_(
"(unknown)"),
199 stateLabel_(pp.stateLabel_),
202 carrierIds_(pp.carrierIds_)
229 setCarrierIds(gasNames);
238 setCarrierIds(gasNames);
253 <<
"Invalid phase: " << phaseTypeNames[phase_] <<
nl
254 <<
" phase must be gas, liquid or solid" <<
nl
275 return phaseTypeNames[phase_];
287 if (speciei >= names_.size())
290 <<
"Requested specie " << speciei <<
"out of range" <<
nl
291 <<
"Available phase species:" <<
nl << names_ <<
nl
295 return names_[speciei];
307 if (speciei >= Y_.size())
310 <<
"Requested specie " << speciei <<
"out of range" <<
nl
311 <<
"Available phase species:" <<
nl << names_ <<
nl
329 if (names_[speciei] == specieName)
~phaseProperties()
Destructor.
A class for handling words, derived from string.
List< word > names_
List of specie names.
word phaseTypeName() const
Return word representation of the phase type.
ListType reorder(const labelUList &oldToNew, const ListType &)
Reorder the elements (indices, not values) of a list.
#define forAll(list, i)
Loop across all elements in list.
void setCarrierIds(const wordList &carrierNames)
Set carrier ids.
Helper class to manage multi-specie phase properties.
label id(const word &specieName) const
Return the id of a specie in the local list by name.
dimensioned< scalar > mag(const dimensioned< Type > &)
word phaseToStateLabel(const phaseType pt) const
Set the state label.
phaseType phase_
Phase type.
const labelList & carrierIds() const
Return const access to the map to the carrier ids.
const List< word > & names() const
Return the list of specie names.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
scalarList Y0(nSpecie, 0.0)
scalarField Y_
List of specie mass fractions.
void checkTotalMassFraction() const
Check the total mass fraction.
static const NamedEnum< phaseType, 4 > phaseTypeNames
Corresponding word representations for phase type enumerations.
phaseProperties()
Null constructor.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
phaseType
Phase type enumeration.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void reorder(const wordList &specieNames)
Reorder species to be consistent with the given specie name list.
const word & stateLabel() const
Return const access to the phase state label.
phaseType phase() const
Return const access to the phase type.
void size(const label)
Override size to be inconsistent with allocated storage.
const word & name(const label speciei) const
Return const access to a specie name.
const scalarField & Y() const
Return const access to all specie mass fractions.
Initialise the NamedEnum HashTable from the static list of names.