basicThermo Class Referenceabstract

Base-class for fluid and solid thermodynamic properties. More...

Inheritance diagram for basicThermo:

Classes

class  implementation
 

Public Member Functions

 TypeName ("basicThermo")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, basicThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))
 Declare run-time constructor selection table. More...
 
virtual ~basicThermo ()
 Destructor. More...
 
virtual const IOdictionaryproperties () const =0
 Properties dictionary. More...
 
virtual IOdictionaryproperties ()=0
 Non-const access the properties dictionary. More...
 
virtual const fvMeshmesh () const =0
 Return const access to the mesh. More...
 
virtual const wordphaseName () const =0
 Phase name. More...
 
word phasePropertyName (const word &name) const
 Name of a property for a given phase. More...
 
void validate (const string &app, const word &) const
 Check that the thermodynamics package is consistent. More...
 
void validate (const string &app, const word &, const word &) const
 Check that the thermodynamics package is consistent. More...
 
virtual void correct ()=0
 Update properties. More...
 
virtual word thermoName () const =0
 Name of the thermo physics. More...
 
virtual bool incompressible () const =0
 Return true if the equation of state is incompressible. More...
 
virtual bool isochoric () const =0
 Return true if the equation of state is isochoric. More...
 
virtual Switch dpdt () const =0
 Should the dpdt term be included in the enthalpy equation. More...
 
virtual tmp< volScalarFieldrho () const =0
 Density [kg/m^3]. More...
 
virtual tmp< scalarFieldrho (const label patchi) const =0
 Density for patch [kg/m^3]. More...
 
virtual volScalarFieldhe ()=0
 Enthalpy/Internal energy [J/kg]. More...
 
virtual const volScalarFieldhe () const =0
 Enthalpy/Internal energy [J/kg]. More...
 
virtual tmp< volScalarFieldhe (const volScalarField &p, const volScalarField &T) const =0
 Enthalpy/Internal energy. More...
 
virtual tmp< scalarFieldhe (const scalarField &T, const labelList &cells) const =0
 Enthalpy/Internal energy for cell-set [J/kg]. More...
 
virtual tmp< scalarFieldhe (const scalarField &T, const label patchi) const =0
 Enthalpy/Internal energy for patch [J/kg]. More...
 
virtual tmp< volScalarFieldhs () const =0
 Sensible enthalpy [J/kg]. More...
 
virtual tmp< volScalarFieldhs (const volScalarField &p, const volScalarField &T) const =0
 Sensible enthalpy. More...
 
virtual tmp< scalarFieldhs (const scalarField &T, const labelList &cells) const =0
 Sensible enthalpy for cell-set [J/kg]. More...
 
virtual tmp< scalarFieldhs (const scalarField &T, const label patchi) const =0
 Sensible enthalpy for patch [J/kg]. More...
 
virtual tmp< volScalarFieldha () const =0
 Absolute enthalpy [J/kg]. More...
 
virtual tmp< volScalarFieldha (const volScalarField &p, const volScalarField &T) const =0
 Absolute enthalpy. More...
 
virtual tmp< scalarFieldha (const scalarField &T, const labelList &cells) const =0
 Absolute enthalpy for cell-set [J/kg]. More...
 
virtual tmp< scalarFieldha (const scalarField &T, const label patchi) const =0
 Absolute enthalpy for patch [J/kg]. More...
 
virtual tmp< volScalarFieldhc () const =0
 Enthalpy of formation [J/kg]. More...
 
virtual tmp< volScalarFieldTHE (const volScalarField &h, const volScalarField &p, const volScalarField &T0) const =0
 Temperature from enthalpy/internal energy. More...
 
virtual tmp< scalarFieldTHE (const scalarField &h, const scalarField &T0, const labelList &cells) const =0
 Temperature from enthalpy/internal energy for cell-set. More...
 
virtual tmp< scalarFieldTHE (const scalarField &h, const scalarField &T0, const label patchi) const =0
 Temperature from enthalpy/internal energy for patch. More...
 
virtual const volScalarFieldCp () const =0
 Heat capacity at constant pressure [J/kg/K]. More...
 
virtual const volScalarFieldCv () const =0
 Heat capacity at constant volume [J/kg/K]. More...
 
virtual const volScalarFieldCpv () const =0
 Heat capacity at constant pressure/volume [J/kg/K]. More...
 
virtual const volScalarFieldkappa () const =0
 Thermal conductivity of mixture [W/m/K]. More...
 
virtual const volScalarFieldT () const =0
 Temperature [K]. More...
 
virtual volScalarFieldT ()=0
 Temperature [K]. More...
 
virtual tmp< scalarFieldCp (const scalarField &T, const label patchi) const =0
 Heat capacity at constant pressure for patch [J/kg/K]. More...
 
virtual tmp< scalarFieldCv (const scalarField &T, const label patchi) const =0
 Heat capacity at constant volume for patch [J/kg/K]. More...
 
virtual tmp< scalarFieldCpv (const scalarField &T, const label patchi) const =0
 Heat capacity at constant pressure/volume for patch [J/kg/K]. More...
 
template<class Thermo >
Foam::autoPtr< Thermo > New (const fvMesh &mesh, const word &phaseName)
 

Static Public Member Functions

static word phasePropertyName (const word &name, const word &phaseName)
 Name of a property for a given phase. More...
 
static const basicThermolookupThermo (const fvPatchScalarField &pf)
 Lookup the thermo associated with the given patch field. More...
 
static wordList splitThermoName (const word &thermoName, const int nCmpt)
 Split name of thermo package into a list of the components names. More...
 
static List< Pair< word > > thermoNameComponents (const word &thermoName)
 Split name of thermo package into a list of named components names. More...
 
template<class Thermo >
static autoPtr< Thermo > New (const fvMesh &, const word &phaseName=word::null)
 Generic New for each of the related thermodynamics packages. More...
 
static autoPtr< basicThermoNew (const fvMesh &, const word &phaseName=word::null)
 Specialisation of the Generic New for basicThermo. More...
 

Protected Member Functions

wordList heBoundaryTypes ()
 Enthalpy/internal energy field boundary types. More...
 
wordList heBoundaryBaseTypes ()
 Enthalpy/internal energy field boundary base types. More...
 

Static Protected Member Functions

static volScalarFieldlookupOrConstruct (const fvMesh &mesh, const char *name)
 Lookup and the named field, or construct it as MUST-READ if it is. More...
 
template<class Thermo , class Table >
static Table::iterator lookupCstrIter (const dictionary &thermoTypeDict, Table *tablePtr, const int nCmpt, const char *cmptNames[], const word &thermoTypeName)
 Get the constructor iterator for the given thermo dictionary and. More...
 
template<class Thermo , class Table >
static Table::iterator lookupCstrIter (const dictionary &thermoDict, Table *tablePtr)
 Get the constructor iterator for the given thermo dictionary and. More...
 

Detailed Description

Base-class for fluid and solid thermodynamic properties.

The basicThermo class is the pure virtual interface, plus static data and functions, including the selection table. It is default-constructable and holds no non-static data.

The basicThermo::implementation class contains the class data, non-default construction and other implementation details.

This structure allows for arbitrary mixing of the interfaces. Derived levels should implement a similar separation of interface and implementation. All interface classes should be default-constructable, and should be inherited virtually into whatever interfaces are required. Implementation classes should virtually inherit from their corresponding interface class and *not* a lower level implementation class.

In derived levels that are complete enough to act as the base of a thermodynamic instantiation, an additional *::composite sub class should be defined, which (non-virtually) inherits from all the *::implementation classes that it needs. This way, the composite class composes an interface for which diamond patterns are resolved by virtual inheritance, whilst also obtaining a single copy of all the implementation classes it needs to form a complete implementation. The use of virtual inheritance does not result in additional constructor calls propagating further down the hierarchy (into heThermo and similar) because all virtually inherited interface classes are default constructable.

Source files

Definition at line 77 of file basicThermo.H.

Constructor & Destructor Documentation

◆ ~basicThermo()

~basicThermo ( )
virtual

Destructor.

Definition at line 320 of file basicThermo.C.

Member Function Documentation

◆ lookupOrConstruct()

Foam::volScalarField & lookupOrConstruct ( const fvMesh mesh,
const char *  name 
)
staticprotected

Lookup and the named field, or construct it as MUST-READ if it is.

not found, and return a reference

Definition at line 48 of file basicThermo.C.

References IOobject::AUTO_WRITE, basicThermo::mesh(), IOobject::MUST_READ, dimensioned< Type >::name(), Foam::name(), regIOobject::store(), and fvMesh::time().

Here is the call graph for this function:

◆ lookupCstrIter() [1/2]

Table::iterator lookupCstrIter ( const dictionary thermoTypeDict,
Table *  tablePtr,
const int  nCmpt,
const char *  cmptNames[],
const word thermoTypeName 
)
staticprotected

Get the constructor iterator for the given thermo dictionary and.

entries and constructor iterator table

Definition at line 42 of file basicThermoTemplates.C.

References dynamicCode::allowSystemOperations, DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, dictionary::lookup(), mixtureName(), Foam::nl, Foam::printTable(), dynamicCode::resolveTemplate(), List< T >::size(), and thermo.

Here is the call graph for this function:

◆ lookupCstrIter() [2/2]

Table::iterator lookupCstrIter ( const dictionary thermoDict,
Table *  tablePtr 
)
staticprotected

Get the constructor iterator for the given thermo dictionary and.

constructor iterator table

Definition at line 146 of file basicThermoTemplates.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, dictionary::found(), Foam::Info, dictionary::isDict(), dictionary::lookup(), mixtureName(), Foam::nl, and dictionary::subDict().

Here is the call graph for this function:

◆ heBoundaryTypes()

Foam::wordList heBoundaryTypes ( )
protected

Enthalpy/internal energy field boundary types.

by interrogating the temperature field boundary types

Definition at line 216 of file basicThermo.C.

References forAll, patchi, Foam::T(), Field< Type >::typeName, and GeometricBoundaryField< Type, PatchField, GeoMesh >::types().

Here is the call graph for this function:

◆ heBoundaryBaseTypes()

Foam::wordList heBoundaryBaseTypes ( )
protected

Enthalpy/internal energy field boundary base types.

by interrogating the temperature field boundary types

Definition at line 198 of file basicThermo.C.

References forAll, word::null, patchi, UPtrList< T >::size(), and Foam::T().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "basicThermo"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
basicThermo  ,
fvMesh  ,
(const fvMesh &mesh, const word &phaseName ,
(mesh, phaseName  
)

Declare run-time constructor selection table.

◆ phasePropertyName() [1/2]

static word phasePropertyName ( const word name,
const word phaseName 
)
inlinestatic

Name of a property for a given phase.

Definition at line 150 of file basicThermo.H.

References IOobject::groupName(), Foam::name(), and basicThermo::phaseName().

Referenced by basicChemistryModel::New(), combustionModel::New(), basicThermo::phasePropertyName(), constSolidThermo::readProperty(), rhoThermo::implementation::renameRho(), and basicThermo::validate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookupThermo()

◆ splitThermoName()

Foam::wordList splitThermoName ( const word thermoName,
const int  nCmpt 
)
static

Split name of thermo package into a list of the components names.

Definition at line 116 of file basicThermo.C.

References Foam::min().

Referenced by sootModel::New(), basicChemistryModel::New(), and combustionModel::New().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ thermoNameComponents()

Foam::List< Foam::Pair< Foam::word > > thermoNameComponents ( const word thermoName)
static

Split name of thermo package into a list of named components names.

Definition at line 178 of file basicThermo.C.

Referenced by basicChemistryModel::New().

Here is the caller graph for this function:

◆ New() [1/3]

static autoPtr<Thermo> New ( const fvMesh ,
const word phaseName = word::null 
)
static

Generic New for each of the related thermodynamics packages.

◆ New() [2/3]

Foam::autoPtr< Foam::basicThermo > New ( const fvMesh mesh,
const word phaseName = word::null 
)
static

Specialisation of the Generic New for basicThermo.

Definition at line 308 of file basicThermo.C.

References basicThermo::mesh(), and basicThermo::phaseName().

Here is the call graph for this function:

◆ properties() [1/2]

◆ properties() [2/2]

virtual IOdictionary& properties ( )
pure virtual

Non-const access the properties dictionary.

Implemented in basicThermo::implementation.

◆ mesh()

◆ phaseName()

◆ phasePropertyName() [2/2]

word phasePropertyName ( const word name) const
inline

Name of a property for a given phase.

Definition at line 209 of file basicThermo.H.

References Foam::name(), basicThermo::phaseName(), and basicThermo::phasePropertyName().

Here is the call graph for this function:

◆ validate() [1/2]

void validate ( const string app,
const word a 
) const

Check that the thermodynamics package is consistent.

with energy forms supported by the application

Definition at line 330 of file basicThermo.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, basicThermo::he(), IOobject::name(), Foam::name(), and basicThermo::phasePropertyName().

Referenced by film::film(), fluid::fluid(), multicomponentFluid::multicomponentFluid(), shockFluid::shockFluid(), solid::solid(), and XiFluid::XiFluid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate() [2/2]

void validate ( const string app,
const word a,
const word b 
) const

Check that the thermodynamics package is consistent.

with energy forms supported by the application

Definition at line 345 of file basicThermo.C.

References b, Foam::exit(), Foam::FatalError, FatalErrorInFunction, basicThermo::he(), IOobject::name(), Foam::name(), and basicThermo::phasePropertyName().

Here is the call graph for this function:

◆ correct()

virtual void correct ( )
pure virtual

◆ thermoName()

virtual word thermoName ( ) const
pure virtual

Name of the thermo physics.

Implemented in constSolidThermo.

Referenced by basicChemistryModel::New().

Here is the caller graph for this function:

◆ incompressible()

virtual bool incompressible ( ) const
pure virtual

Return true if the equation of state is incompressible.

i.e. rho != f(p)

Implemented in constSolidThermo.

◆ isochoric()

virtual bool isochoric ( ) const
pure virtual

Return true if the equation of state is isochoric.

i.e. rho = const

Implemented in constSolidThermo.

◆ dpdt()

virtual Switch dpdt ( ) const
pure virtual

Should the dpdt term be included in the enthalpy equation.

Implemented in basicThermo::implementation.

◆ rho() [1/2]

◆ rho() [2/2]

virtual tmp<scalarField> rho ( const label  patchi) const
pure virtual

◆ he() [1/5]

◆ he() [2/5]

virtual const volScalarField& he ( ) const
pure virtual

Enthalpy/Internal energy [J/kg].

Implemented in constSolidThermo.

◆ he() [3/5]

virtual tmp<volScalarField> he ( const volScalarField p,
const volScalarField T 
) const
pure virtual

Enthalpy/Internal energy.

for given pressure and temperature [J/kg]

Implemented in constSolidThermo.

◆ he() [4/5]

virtual tmp<scalarField> he ( const scalarField T,
const labelList cells 
) const
pure virtual

Enthalpy/Internal energy for cell-set [J/kg].

Implemented in constSolidThermo.

◆ he() [5/5]

virtual tmp<scalarField> he ( const scalarField T,
const label  patchi 
) const
pure virtual

Enthalpy/Internal energy for patch [J/kg].

Implemented in constSolidThermo.

◆ hs() [1/4]

◆ hs() [2/4]

virtual tmp<volScalarField> hs ( const volScalarField p,
const volScalarField T 
) const
pure virtual

Sensible enthalpy.

for given pressure and temperature [J/kg]

Implemented in constSolidThermo.

◆ hs() [3/4]

virtual tmp<scalarField> hs ( const scalarField T,
const labelList cells 
) const
pure virtual

Sensible enthalpy for cell-set [J/kg].

Implemented in constSolidThermo.

◆ hs() [4/4]

virtual tmp<scalarField> hs ( const scalarField T,
const label  patchi 
) const
pure virtual

Sensible enthalpy for patch [J/kg].

Implemented in constSolidThermo.

◆ ha() [1/4]

virtual tmp<volScalarField> ha ( ) const
pure virtual

Absolute enthalpy [J/kg].

Implemented in constSolidThermo.

Referenced by wallBoilingHeatTransfer::K(), HeatTransferPhaseSystem< BasePhaseSystem >::L(), and HeatTransferPhaseSystem< BasePhaseSystem >::Li().

Here is the caller graph for this function:

◆ ha() [2/4]

virtual tmp<volScalarField> ha ( const volScalarField p,
const volScalarField T 
) const
pure virtual

Absolute enthalpy.

for given pressure and temperature [J/kg]

Implemented in constSolidThermo.

◆ ha() [3/4]

virtual tmp<scalarField> ha ( const scalarField T,
const labelList cells 
) const
pure virtual

Absolute enthalpy for cell-set [J/kg].

Implemented in constSolidThermo.

◆ ha() [4/4]

virtual tmp<scalarField> ha ( const scalarField T,
const label  patchi 
) const
pure virtual

Absolute enthalpy for patch [J/kg].

Implemented in constSolidThermo.

◆ hc()

virtual tmp<volScalarField> hc ( ) const
pure virtual

Enthalpy of formation [J/kg].

Implemented in constSolidThermo.

◆ THE() [1/3]

virtual tmp<volScalarField> THE ( const volScalarField h,
const volScalarField p,
const volScalarField T0 
) const
pure virtual

Temperature from enthalpy/internal energy.

Implemented in constSolidThermo.

◆ THE() [2/3]

virtual tmp<scalarField> THE ( const scalarField h,
const scalarField T0,
const labelList cells 
) const
pure virtual

Temperature from enthalpy/internal energy for cell-set.

Implemented in constSolidThermo.

◆ THE() [3/3]

virtual tmp<scalarField> THE ( const scalarField h,
const scalarField T0,
const label  patchi 
) const
pure virtual

Temperature from enthalpy/internal energy for patch.

Implemented in constSolidThermo.

◆ Cp() [1/2]

◆ Cv() [1/2]

virtual const volScalarField& Cv ( ) const
pure virtual

Heat capacity at constant volume [J/kg/K].

Implemented in constSolidThermo.

Referenced by compressibleInterPhaseThermophysicalTransportModel::alphaEff(), and compressibleMultiphaseVoFMixture::alphaEff().

Here is the caller graph for this function:

◆ Cpv() [1/2]

◆ kappa()

◆ T() [1/2]

virtual const volScalarField& T ( ) const
pure virtual

Temperature [K].

Implemented in basicThermo::implementation.

Referenced by TwoResistanceHeatTransferPhaseSystem< BasePhaseSystem >::addDmdtHefs(), TwoResistanceHeatTransferPhaseSystem< BasePhaseSystem >::addDmidtHefs(), HeatTransferPhaseSystem< BasePhaseSystem >::addDmidtHefs(), HeatTransferPhaseSystem< BasePhaseSystem >::addDmidtHefsWithoutL(), anisotropic::anisotropic(), chemistryModel< ThermoType >::calculate(), ThermalPhaseChangePhaseSystem< BasePhaseSystem >::correctInterfaceThermo(), Fickian< BasicThermophysicalTransportModel >::divj(), isotropic::divq(), coupledMultiphaseTemperatureFvPatchScalarField::getNbr(), TwoResistanceHeatTransferPhaseSystem< BasePhaseSystem >::heatTransfer(), OneResistanceHeatTransferPhaseSystem< BasePhaseSystem >::heatTransfer(), Fickian< BasicThermophysicalTransportModel >::j(), wallBoilingHeatTransfer::K(), HeatTransferPhaseSystem< BasePhaseSystem >::L(), HeatTransferPhaseSystem< BasePhaseSystem >::Li(), combustionModel::New(), laminarFlameSpeed::New(), chemistryModel< ThermoType >::reactionRR(), chemistryModel< ThermoType >::solve(), chemistryModel< ThermoType >::tc(), multiphaseEuler::thermophysicalPredictor(), shockFluid::thermophysicalPredictor(), uniformFixedMultiphaseHeatFluxFvPatchScalarField::updateCoeffs(), energyJumpFvPatchScalarField::updateCoeffs(), fixedEnergyFvPatchScalarField::updateCoeffs(), gradientEnergyFvPatchScalarField::updateCoeffs(), and mixedEnergyFvPatchScalarField::updateCoeffs().

Here is the caller graph for this function:

◆ T() [2/2]

virtual volScalarField& T ( )
pure virtual

Temperature [K].

Non-const access allowed for transport equations

Implemented in basicThermo::implementation.

◆ Cp() [2/2]

virtual tmp<scalarField> Cp ( const scalarField T,
const label  patchi 
) const
pure virtual

Heat capacity at constant pressure for patch [J/kg/K].

Implemented in constSolidThermo.

◆ Cv() [2/2]

virtual tmp<scalarField> Cv ( const scalarField T,
const label  patchi 
) const
pure virtual

Heat capacity at constant volume for patch [J/kg/K].

Implemented in constSolidThermo.

◆ Cpv() [2/2]

virtual tmp<scalarField> Cpv ( const scalarField T,
const label  patchi 
) const
pure virtual

Heat capacity at constant pressure/volume for patch [J/kg/K].

Implemented in constSolidThermo.

◆ New() [3/3]

Foam::autoPtr<Thermo> New ( const fvMesh mesh,
const word phaseName 
)

Definition at line 249 of file basicThermoTemplates.C.

References physicalProperties::findModelDict().

Here is the call graph for this function:

The documentation for this class was generated from the following files: