Helper class to manage multi-specie phase properties. More...
Public Types | |
enum | phaseType { GAS, LIQUID, SOLID, UNKNOWN } |
Phase type enumeration. More... | |
Public Member Functions | |
phaseProperties () | |
Null constructor. More... | |
phaseProperties (Istream &) | |
Construct from Istream. More... | |
phaseProperties (const phaseProperties &) | |
Construct as copy. More... | |
~phaseProperties () | |
Destructor. More... | |
void | reorder (const wordList &gasNames, const wordList &liquidNames, const wordList &solidNames) |
Reorder species to be consistent with the corresponding. More... | |
phaseType | phase () const |
Return const access to the phase type. More... | |
const word & | stateLabel () const |
Return const access to the phase state label. More... | |
word | phaseTypeName () const |
Return word representation of the phase type. More... | |
const List< word > & | names () const |
Return the list of specie names. More... | |
const word & | name (const label speciei) const |
Return const access to a specie name. More... | |
const scalarField & | Y () const |
Return const access to all specie mass fractions. More... | |
scalar & | Y (const label speciei) |
Return non-const access to a specie mass fraction. More... | |
const labelList & | carrierIds () const |
Return const access to the map to the carrier ids. More... | |
label | id (const word &specieName) const |
Return the id of a specie in the local list by name. More... | |
Static Public Attributes | |
static const NamedEnum< phaseType, 4 > | phaseTypeNames |
Corresponding word representations for phase type enumerations. More... | |
Private Member Functions | |
void | reorder (const wordList &specieNames) |
Reorder species to be consistent with the given specie name list. More... | |
void | setCarrierIds (const wordList &carrierNames) |
Set carrier ids. More... | |
void | checkTotalMassFraction () const |
Check the total mass fraction. More... | |
word | phaseToStateLabel (const phaseType pt) const |
Set the state label. More... | |
Private Attributes | |
phaseType | phase_ |
Phase type. More... | |
word | stateLabel_ |
State label (s), (l), (g) etc. More... | |
List< word > | names_ |
List of specie names. More... | |
scalarField | Y_ |
List of specie mass fractions. More... | |
labelList | carrierIds_ |
Map to carrier id. More... | |
Friends | |
Istream & | operator>> (Istream &, phaseProperties &) |
Ostream & | operator<< (Ostream &, const phaseProperties &) |
Helper class to manage multi-specie phase properties.
Definition at line 52 of file phaseProperties.H.
enum phaseType |
Phase type enumeration.
Enumerator | |
---|---|
GAS | |
LIQUID | |
SOLID | |
UNKNOWN |
Definition at line 59 of file phaseProperties.H.
phaseProperties | ( | ) |
Null constructor.
Definition at line 186 of file phaseProperties.C.
phaseProperties | ( | Istream & | is | ) |
Construct from Istream.
Definition at line 31 of file phasePropertiesIO.C.
References phaseProperties::carrierIds_, IOstream::check(), phaseProperties::checkTotalMassFraction(), forAllConstIter(), entry::keyword(), dictionary::lookup(), phaseProperties::names_, dictionary::null, phaseProperties::phase_, phaseProperties::phaseToStateLabel(), phaseProperties::phaseTypeNames, Foam::readScalar(), List::setSize(), phaseProperties::stateLabel_, and phaseProperties::Y_.
phaseProperties | ( | const phaseProperties & | pp | ) |
Construct as copy.
Definition at line 196 of file phaseProperties.C.
~phaseProperties | ( | ) |
Destructor.
Definition at line 208 of file phaseProperties.C.
|
private |
Reorder species to be consistent with the given specie name list.
Definition at line 52 of file phaseProperties.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, found, phaseProperties::names_, phaseProperties::phase_, phaseProperties::phaseTypeNames, List::size(), Y0(), and phaseProperties::Y_.
|
private |
Set carrier ids.
Definition at line 104 of file phaseProperties.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, and Foam::nl.
|
private |
Check the total mass fraction.
Definition at line 132 of file phaseProperties.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), and Foam::nl.
Referenced by phaseProperties::phaseProperties().
|
private |
Set the state label.
Definition at line 151 of file phaseProperties.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
Referenced by phaseProperties::phaseProperties().
void reorder | ( | const wordList & | gasNames, |
const wordList & | liquidNames, | ||
const wordList & | solidNames | ||
) |
Reorder species to be consistent with the corresponding.
phase specie name list
Definition at line 215 of file phaseProperties.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and Foam::reorder().
Foam::phaseProperties::phaseType phase | ( | ) | const |
Return const access to the phase type.
Definition at line 261 of file phaseProperties.C.
Referenced by CompositionModel< CloudType >::Cp(), CompositionModel< CloudType >::H(), CompositionModel< CloudType >::Hc(), CompositionModel< CloudType >::Hs(), CompositionModel< CloudType >::L(), and CompositionModel< CloudType >::X().
const Foam::word & stateLabel | ( | ) | const |
Return const access to the phase state label.
Definition at line 267 of file phaseProperties.C.
Foam::word phaseTypeName | ( | ) | const |
Return word representation of the phase type.
Definition at line 273 of file phaseProperties.C.
const Foam::List< Foam::word > & names | ( | ) | const |
Return the list of specie names.
Definition at line 279 of file phaseProperties.C.
const Foam::word & name | ( | const label | speciei | ) | const |
Return const access to a specie name.
Definition at line 285 of file phaseProperties.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
const Foam::scalarField & Y | ( | ) | const |
Return const access to all specie mass fractions.
Definition at line 299 of file phaseProperties.C.
Foam::scalar & Y | ( | const label | speciei | ) |
Return non-const access to a specie mass fraction.
Definition at line 305 of file phaseProperties.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
const Foam::labelList & carrierIds | ( | ) | const |
Return const access to the map to the carrier ids.
Definition at line 319 of file phaseProperties.C.
Referenced by CompositionModel< CloudType >::Cp(), CompositionModel< CloudType >::H(), CompositionModel< CloudType >::Hc(), CompositionModel< CloudType >::Hs(), and CompositionModel< CloudType >::X().
Foam::label id | ( | const word & | specieName | ) | const |
Return the id of a specie in the local list by name.
Returns -1 if not found
Definition at line 325 of file phaseProperties.C.
References forAll.
|
friend |
|
friend |
|
static |
Corresponding word representations for phase type enumerations.
Definition at line 68 of file phaseProperties.H.
Referenced by phaseProperties::phaseProperties(), and phaseProperties::reorder().
|
private |
Phase type.
Definition at line 76 of file phaseProperties.H.
Referenced by phaseProperties::phaseProperties(), and phaseProperties::reorder().
|
private |
State label (s), (l), (g) etc.
Definition at line 79 of file phaseProperties.H.
Referenced by phaseProperties::phaseProperties().
List of specie names.
Definition at line 82 of file phaseProperties.H.
Referenced by phaseProperties::phaseProperties(), and phaseProperties::reorder().
|
private |
List of specie mass fractions.
Definition at line 85 of file phaseProperties.H.
Referenced by phaseProperties::phaseProperties(), and phaseProperties::reorder().
|
private |
Map to carrier id.
Definition at line 88 of file phaseProperties.H.
Referenced by phaseProperties::phaseProperties().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.