46 void Foam::phaseProperties::setGlobalIds(
const wordList& globalNames)
52 if (globalNames[j] == names_[i])
58 if (globalIds_[i] == -1)
62 "void Foam::phaseProperties::setGlobalIds(const wordList&)"
63 ) <<
"Could not find specie " << names_[i]
64 <<
" in species list" <<
nl
65 <<
"Available species are: " <<
nl << globalNames <<
nl
72 void Foam::phaseProperties::setGlobalCarrierIds
77 globalCarrierIds_ = -1;
83 if (carrierNames[j] == names_[i])
85 globalCarrierIds_[i] = j;
89 if (globalCarrierIds_[i] == -1)
93 "void Foam::phaseProperties::setGlobalCarrierIds"
97 ) <<
"Could not find carrier specie " << names_[i]
98 <<
" in species list" <<
nl
99 <<
"Available species are: " <<
nl << carrierNames <<
nl
106 void Foam::phaseProperties::checkTotalMassFraction()
const
114 if (Y_.size() != 0 &&
mag(total - 1.0) > SMALL)
118 "void Foam::phaseProperties::checkTotalMassFraction() const"
119 ) <<
"Component fractions must total to unity for phase "
120 << phaseTypeNames_[phase_] <<
nl
126 Foam::word Foam::phaseProperties::phaseToStateLabel(
const phaseType pt)
const
128 word state =
"(unknown)";
150 "Foam::phaseProperties::phaseToStateLabel(phaseType pt)"
151 ) <<
"Invalid phase: " << phaseTypeNames_[pt] <<
nl
152 <<
" phase must be gas, liquid or solid" <<
nl
166 stateLabel_(
"(unknown)"),
177 stateLabel_(pp.stateLabel_),
180 globalIds_(pp.globalIds_),
181 globalCarrierIds_(pp.globalCarrierIds_)
206 setGlobalIds(gasNames);
207 forAll(globalCarrierIds_, i)
209 globalCarrierIds_[i] = globalIds_[i];
215 setGlobalIds(liquidNames);
216 setGlobalCarrierIds(gasNames);
221 setGlobalIds(solidNames);
224 "phaseProperties::initialiseGlobalIds(...)"
225 ) <<
"Assuming no mapping between solid and carrier species"
234 "Foam::phaseProperties::setGlobalIds"
236 "const PtrList<volScalarField>&, "
240 ) <<
"Invalid phase: " << phaseTypeNames_[phase_] <<
nl
241 <<
" phase must be gas, liquid or solid" <<
nl
262 return phaseTypeNames_[phase_];
274 if (cmptI >= names_.size())
278 "const Foam::word& Foam::phaseProperties::name"
282 ) <<
"Requested component " << cmptI <<
"out of range" <<
nl
283 <<
"Available phase components:" <<
nl << names_ <<
nl
287 return names_[cmptI];
299 if (cmptI >= Y_.size())
303 "const Foam::scalar& Foam::phaseProperties::Y"
307 ) <<
"Requested component " << cmptI <<
"out of range" <<
nl
308 <<
"Available phase components:" <<
nl << names_ <<
nl
318 label
id = this->id(cmptName);
326 return globalIds_[id];
340 return globalCarrierIds_;
348 if (names_[cmptI] == cmptName)