Go to the documentation of this file.
39 { phaseType::GAS,
"gas" },
40 { phaseType::LIQUID,
"liquid" },
41 { phaseType::SOLID,
"solid" },
42 { phaseType::UNKNOWN,
"unknown" },
48 void Foam::phaseProperties::reorder(
const wordList& specieNames)
59 List<word> names0(names_);
66 if (names_.size() != names0.size())
79 if (names_[j] == names0[i])
90 <<
"Could not find specie " << names0[i]
91 <<
" in list " << names_
99 void Foam::phaseProperties::setCarrierIds
110 if (carrierNames[j] == names_[i])
116 if (carrierIds_[i] == -1)
119 <<
"Could not find carrier specie " << names_[i]
120 <<
" in species list" <<
nl
121 <<
"Available species are: " <<
nl << carrierNames <<
nl
128 void Foam::phaseProperties::checkTotalMassFraction()
const
131 for (
const scalar& val : Y_)
136 if (Y_.size() &&
mag(total - 1.0) > SMALL)
139 <<
"Specie fractions must total to unity for phase "
140 << phaseTypeNames[phase_] <<
nl
147 Foam::word Foam::phaseProperties::phaseToStateLabel(
const phaseType pt)
const
169 <<
"Invalid phase: " << phaseTypeNames[pt] <<
nl
170 <<
" phase must be gas, liquid or solid" <<
nl
185 stateLabel_(
"(unknown)"),
194 void Foam::phaseProperties::reorder
209 setCarrierIds(gasNames);
218 setCarrierIds(gasNames);
233 <<
"Invalid phase: " << phaseTypeNames[phase_] <<
nl
234 <<
" phase must be gas, liquid or solid" <<
nl
256 return phaseTypeNames[phase_];
268 if (speciei >= names_.size())
271 <<
"Requested specie " << speciei <<
"out of range" <<
nl
272 <<
"Available phase species:" <<
nl << names_ <<
nl
276 return names_[speciei];
288 if (speciei >= Y_.size())
291 <<
"Requested specie " << speciei <<
"out of range" <<
nl
292 <<
"Available phase species:" <<
nl << names_ <<
nl
308 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
A class for handling words, derived from Foam::string.
word phaseTypeName() const
label id(const word &specieName) const
const labelList & carrierIds() const
const List< word > & names() const
List< word > wordList
A List of words.
Generic templated field type.
void setSize(const label n)
ListType reorder(const labelUList &oldToNew, const ListType &input, const bool prune=false)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const word & stateLabel() const
scalarList Y0(nSpecie, Zero)
const wordList solidNames(rp["solid"])
const word & name(const label speciei) const
#define WarningInFunction
const scalarField & Y() const