Go to the documentation of this file.
38 { phaseType::GAS,
"gas" },
39 { phaseType::LIQUID,
"liquid" },
40 { phaseType::SOLID,
"solid" },
41 { phaseType::UNKNOWN,
"unknown" },
47 void Foam::phaseProperties::reorder(
const wordList& specieNames)
58 List<word> names0(names_);
65 if (names_.size() != names0.size())
78 if (names_[j] == names0[i])
89 <<
"Could not find specie " << names0[i]
90 <<
" in list " << names_
98 void Foam::phaseProperties::setCarrierIds
109 if (carrierNames[j] == names_[i])
115 if (carrierIds_[i] == -1)
118 <<
"Could not find carrier specie " << names_[i]
119 <<
" in species list" <<
nl
120 <<
"Available species are: " <<
nl << carrierNames <<
nl
127 void Foam::phaseProperties::checkTotalMassFraction()
const
130 for (
const scalar& val : Y_)
135 if (Y_.size() &&
mag(total - 1.0) > SMALL)
138 <<
"Specie fractions must total to unity for phase "
139 << phaseTypeNames[phase_] <<
nl
146 Foam::word Foam::phaseProperties::phaseToStateLabel(
const phaseType pt)
const
168 <<
"Invalid phase: " << phaseTypeNames[pt] <<
nl
169 <<
" phase must be gas, liquid or solid" <<
nl
184 stateLabel_(
"(unknown)"),
193 void Foam::phaseProperties::reorder
208 setCarrierIds(gasNames);
217 setCarrierIds(gasNames);
232 <<
"Invalid phase: " << phaseTypeNames[phase_] <<
nl
233 <<
" phase must be gas, liquid or solid" <<
nl
255 return phaseTypeNames[phase_];
267 if (speciei >= names_.size())
270 <<
"Requested specie " << speciei <<
"out of range" <<
nl
271 <<
"Available phase species:" <<
nl << names_ <<
nl
275 return names_[speciei];
287 if (speciei >= Y_.size())
290 <<
"Requested specie " << speciei <<
"out of range" <<
nl
291 <<
"Available phase species:" <<
nl << names_ <<
nl
307 return names_.find(specieName);
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
static const Enum< phaseType > phaseTypeNames
Corresponding word representations for phase type enumerations.
A class for handling words, derived from Foam::string.
word phaseTypeName() const
Return word representation of the phase type.
label id(const word &specieName) const
Return the id of a specie in the local list by name.
#define forAll(list, i)
Loop across all elements in list.
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.
List< word > wordList
A List of words.
ListType reorder(const labelUList &oldToNew, const ListType &input, const bool prune=false)
Reorder the elements of a list.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
phaseProperties()
Default construct, as 'UNKNOWN' state.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
phaseType
Phase type enumeration.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const word & stateLabel() const
Return const access to the phase state label.
phaseType phase() const
Return const access to the phase type.
scalarList Y0(nSpecie, Zero)
void setSize(const label newSize)
Alias for resize(const label)
const wordList solidNames(rp["solid"])
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.