39 { phaseType::GAS,
"gas" },
40 { phaseType::LIQUID,
"liquid" },
41 { phaseType::SOLID,
"solid" },
42 { phaseType::UNKNOWN,
"unknown" },
48void 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_
99void 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
128void 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
147Foam::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)"),
194void 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);
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
void setSize(const label n)
Alias for resize()
void size(const label n)
Older name for setAddressableSize.
label id
The internal interface id.
static const Enum< phaseType > phaseTypeNames
Corresponding word representations for phase type enumerations.
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 type enumeration.
phaseProperties()
Default construct, as 'UNKNOWN' state.
phaseType phase() const
Return const access to the phase type.
const scalarField & Y() const
Return const access to all specie mass fractions.
const word & stateLabel() const
Return const access to the phase state label.
word phaseTypeName() const
Return word representation of the phase type.
A class for handling words, derived from Foam::string.
const wordList solidNames(rp["solid"])
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
List< word > wordList
A List of words.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
errorManipArg< error, int > exit(error &err, const int errNo=1)
ListType reorder(const labelUList &oldToNew, const ListType &input, const bool prune=false)
Reorder the elements of a list.
constexpr char nl
The newline '\n' character (0x0a)
scalarList Y0(nSpecie, Zero)
#define forAll(list, i)
Loop across all elements in list.