Opm::PTFlashParameterCache< Scalar, FluidSystem > Class Template Reference

Specifies the parameter cache used by the SPE-5 fluid system. More...

#include <PTFlashParameterCache.hpp>

Inheritance diagram for Opm::PTFlashParameterCache< Scalar, FluidSystem >:
Inheritance graph

Public Types

using OilPhaseParams = Opm::PengRobinsonParamsMixture< Scalar, FluidSystem, oilPhaseIdx, false >
 The cached parameters for the oil phase. More...
 
using GasPhaseParams = Opm::PengRobinsonParamsMixture< Scalar, FluidSystem, gasPhaseIdx, false >
 The cached parameters for the gas phase. More...
 
enum  ExceptQuantities
 Constants for ORing the quantities of the fluid state that have not changed since the last update. More...
 

Public Member Functions

 PTFlashParameterCache ()
 
template<class FluidState >
void updatePhase (const FluidState &fluidState, unsigned phaseIdx, int exceptQuantities=ParentType::None)
 Update all cached parameters of a specific fluid phase. More...
 
template<class FluidState >
void updateSingleMoleFraction (const FluidState &fluidState, unsigned phaseIdx, unsigned compIdx)
 Update all cached parameters of a specific fluid phase which depend on the mole fraction of a single component. More...
 
Scalar a (unsigned phaseIdx) const
 The Peng-Robinson attractive parameter for a phase. More...
 
Scalar b (unsigned phaseIdx) const
 The Peng-Robinson covolume for a phase. More...
 
Scalar aPure (unsigned phaseIdx, unsigned compIdx) const
 The Peng-Robinson attractive parameter for a pure component given the same temperature and pressure of the phase. More...
 
Scalar bPure (unsigned phaseIdx, unsigned compIdx) const
 The Peng-Robinson covolume for a pure component given the same temperature and pressure of the phase. More...
 
Scalar aCache (unsigned phaseIdx, unsigned compIdx, unsigned compJIdx) const
 TODO. More...
 
Scalar molarVolume (unsigned phaseIdx) const
 Returns the molar volume of a phase [m^3/mol]. More...
 
const OilPhaseParamsoilPhaseParams () const
 Returns the Peng-Robinson mixture parameters for the oil phase. More...
 
const GasPhaseParamsgasPhaseParams () const
 Returns the Peng-Robinson mixture parameters for the gas phase. More...
 
template<class FluidState >
void updateEosParams (const FluidState &fluidState, unsigned phaseIdx, int exceptQuantities=ParentType::None)
 Update all parameters required by the equation of state to calculate some quantities for the phase. More...
 
void assignPersistentData (const OtherCache &)
 Copy the data which is not dependent on the type of the Scalars from another parameter cache. More...
 
void updateAll (const FluidState &fluidState, int=None)
 Update the quantities of the parameter cache for all phases. More...
 
void updateAllPressures (const FluidState &fluidState)
 Update pressure dependent quantities of the parameter cache for all phases. More...
 
void updateAllTemperatures (const FluidState &fluidState)
 Update temperature dependent quantities of the parameter cache for all phases. More...
 
void updateTemperature (const FluidState &fluidState, unsigned phaseIdx)
 Update all cached parameters of a specific fluid phase which depend on temperature. More...
 
void updatePressure (const FluidState &fluidState, unsigned phaseIdx)
 Update all cached parameters of a specific fluid phase which depend on pressure. More...
 
void updateComposition (const FluidState &fluidState, unsigned phaseIdx)
 Update all cached parameters of a specific fluid phase which depend on composition. More...
 

Protected Member Functions

template<class FluidState >
void updatePure_ (const FluidState &fluidState, unsigned phaseIdx)
 Update all parameters of a phase which only depend on temperature and/or pressure. More...
 
template<class FluidState >
void updateMix_ (const FluidState &fluidState, unsigned phaseIdx)
 Update all parameters of a phase which depend on the fluid composition. It is assumed that updatePure() has been called before this method. More...
 
template<class FluidState >
void updateMolarVolume_ (const FluidState &fluidState, unsigned phaseIdx)
 

Protected Attributes

bool VmUpToDate_ [numPhases]
 
Scalar Vm_ [numPhases]
 
OilPhaseParams oilPhaseParams_
 
GasPhaseParams gasPhaseParams_
 

Detailed Description

template<class Scalar, class FluidSystem>
class Opm::PTFlashParameterCache< Scalar, FluidSystem >

Specifies the parameter cache used by the SPE-5 fluid system.

Member Typedef Documentation

◆ GasPhaseParams

template<class Scalar , class FluidSystem >
using Opm::PTFlashParameterCache< Scalar, FluidSystem >::GasPhaseParams = Opm::PengRobinsonParamsMixture<Scalar, FluidSystem, gasPhaseIdx, false>

The cached parameters for the gas phase.

◆ OilPhaseParams

template<class Scalar , class FluidSystem >
using Opm::PTFlashParameterCache< Scalar, FluidSystem >::OilPhaseParams = Opm::PengRobinsonParamsMixture<Scalar, FluidSystem, oilPhaseIdx, false>

The cached parameters for the oil phase.

Member Enumeration Documentation

◆ ExceptQuantities

Constants for ORing the quantities of the fluid state that have not changed since the last update.

Constructor & Destructor Documentation

◆ PTFlashParameterCache()

template<class Scalar , class FluidSystem >
Opm::PTFlashParameterCache< Scalar, FluidSystem >::PTFlashParameterCache ( )
inline

Member Function Documentation

◆ a()

template<class Scalar , class FluidSystem >
Scalar Opm::PTFlashParameterCache< Scalar, FluidSystem >::a ( unsigned  phaseIdx) const
inline

The Peng-Robinson attractive parameter for a phase.

Parameters
phaseIdxThe fluid phase of interest

References Opm::PengRobinsonParams< Scalar >::a(), Opm::PTFlashParameterCache< Scalar, FluidSystem >::gasPhaseParams_, and Opm::PTFlashParameterCache< Scalar, FluidSystem >::oilPhaseParams_.

◆ aCache()

template<class Scalar , class FluidSystem >
Scalar Opm::PTFlashParameterCache< Scalar, FluidSystem >::aCache ( unsigned  phaseIdx,
unsigned  compIdx,
unsigned  compJIdx 
) const
inline

◆ aPure()

template<class Scalar , class FluidSystem >
Scalar Opm::PTFlashParameterCache< Scalar, FluidSystem >::aPure ( unsigned  phaseIdx,
unsigned  compIdx 
) const
inline

The Peng-Robinson attractive parameter for a pure component given the same temperature and pressure of the phase.

Parameters
phaseIdxThe fluid phase of interest
compIdxThe component phase of interest

References Opm::PengRobinsonParams< Scalar >::a(), Opm::PTFlashParameterCache< Scalar, FluidSystem >::gasPhaseParams_, Opm::PTFlashParameterCache< Scalar, FluidSystem >::oilPhaseParams_, and Opm::PengRobinsonParamsMixture< Scalar, FluidSystem, phaseIdx, useSpe5Relations >::pureParams().

◆ assignPersistentData()

void Opm::ParameterCacheBase< PTFlashParameterCache< Scalar, FluidSystem > >::assignPersistentData ( const OtherCache &  )
inlineinherited

Copy the data which is not dependent on the type of the Scalars from another parameter cache.

◆ b()

template<class Scalar , class FluidSystem >
Scalar Opm::PTFlashParameterCache< Scalar, FluidSystem >::b ( unsigned  phaseIdx) const
inline

◆ bPure()

template<class Scalar , class FluidSystem >
Scalar Opm::PTFlashParameterCache< Scalar, FluidSystem >::bPure ( unsigned  phaseIdx,
unsigned  compIdx 
) const
inline

The Peng-Robinson covolume for a pure component given the same temperature and pressure of the phase.

Parameters
phaseIdxThe fluid phase of interest
compIdxThe component phase of interest

References Opm::PengRobinsonParams< Scalar >::b(), Opm::PTFlashParameterCache< Scalar, FluidSystem >::gasPhaseParams_, Opm::PTFlashParameterCache< Scalar, FluidSystem >::oilPhaseParams_, and Opm::PengRobinsonParamsMixture< Scalar, FluidSystem, phaseIdx, useSpe5Relations >::pureParams().

◆ gasPhaseParams()

template<class Scalar , class FluidSystem >
const GasPhaseParams & Opm::PTFlashParameterCache< Scalar, FluidSystem >::gasPhaseParams ( ) const
inline

Returns the Peng-Robinson mixture parameters for the gas phase.

References Opm::PTFlashParameterCache< Scalar, FluidSystem >::gasPhaseParams_.

◆ molarVolume()

template<class Scalar , class FluidSystem >
Scalar Opm::PTFlashParameterCache< Scalar, FluidSystem >::molarVolume ( unsigned  phaseIdx) const
inline

◆ oilPhaseParams()

template<class Scalar , class FluidSystem >
const OilPhaseParams & Opm::PTFlashParameterCache< Scalar, FluidSystem >::oilPhaseParams ( ) const
inline

Returns the Peng-Robinson mixture parameters for the oil phase.

References Opm::PTFlashParameterCache< Scalar, FluidSystem >::oilPhaseParams_.

◆ updateAll()

void Opm::ParameterCacheBase< PTFlashParameterCache< Scalar, FluidSystem > >::updateAll ( const FluidState &  fluidState,
int  = None 
)
inlineinherited

Update the quantities of the parameter cache for all phases.

Parameters
fluidStateThe representation of the thermodynamic system of interest.
exceptQuantitiesThe quantities of the fluid state that have not changed since the last update.

◆ updateAllPressures()

void Opm::ParameterCacheBase< PTFlashParameterCache< Scalar, FluidSystem > >::updateAllPressures ( const FluidState &  fluidState)
inlineinherited

Update pressure dependent quantities of the parameter cache for all phases.

This method should be called if only the phase pressures changed since the last call to an update() method.

Parameters
fluidStateThe representation of the thermodynamic system of interest.

◆ updateAllTemperatures()

void Opm::ParameterCacheBase< PTFlashParameterCache< Scalar, FluidSystem > >::updateAllTemperatures ( const FluidState &  fluidState)
inlineinherited

Update temperature dependent quantities of the parameter cache for all phases.

This method should be called if only the phase temperatures changed since the last call to an update() method.

Parameters
fluidStateThe representation of the thermodynamic system of interest.

◆ updateComposition()

void Opm::ParameterCacheBase< PTFlashParameterCache< Scalar, FluidSystem > >::updateComposition ( const FluidState &  fluidState,
unsigned  phaseIdx 
)
inlineinherited

Update all cached parameters of a specific fluid phase which depend on composition.

Only use this method if neither the pressure nor the temperature of the phase changed between two update*() calls. If more changed, call updatePhase()!

Parameters
fluidStateThe representation of the thermodynamic system of interest.
phaseIdxThe index of the fluid phase of interest.

◆ updateEosParams()

template<class Scalar , class FluidSystem >
template<class FluidState >
void Opm::PTFlashParameterCache< Scalar, FluidSystem >::updateEosParams ( const FluidState &  fluidState,
unsigned  phaseIdx,
int  exceptQuantities = ParentType::None 
)
inline

Update all parameters required by the equation of state to calculate some quantities for the phase.

Parameters
fluidStateThe representation of the thermodynamic system of interest.
phaseIdxThe index of the fluid phase of interest.
exceptQuantitiesThe quantities of the fluid state that have not changed since the last update.

References Opm::ParameterCacheBase< Implementation >::Composition, Opm::ParameterCacheBase< Implementation >::Pressure, Opm::ParameterCacheBase< Implementation >::Temperature, Opm::PTFlashParameterCache< Scalar, FluidSystem >::updateMix_(), Opm::PTFlashParameterCache< Scalar, FluidSystem >::updatePure_(), and Opm::PTFlashParameterCache< Scalar, FluidSystem >::VmUpToDate_.

Referenced by Opm::PTFlashParameterCache< Scalar, FluidSystem >::updatePhase().

◆ updateMix_()

template<class Scalar , class FluidSystem >
template<class FluidState >
void Opm::PTFlashParameterCache< Scalar, FluidSystem >::updateMix_ ( const FluidState &  fluidState,
unsigned  phaseIdx 
)
inlineprotected

◆ updateMolarVolume_()

template<class Scalar , class FluidSystem >
template<class FluidState >
void Opm::PTFlashParameterCache< Scalar, FluidSystem >::updateMolarVolume_ ( const FluidState &  fluidState,
unsigned  phaseIdx 
)
inlineprotected

◆ updatePhase()

template<class Scalar , class FluidSystem >
template<class FluidState >
void Opm::PTFlashParameterCache< Scalar, FluidSystem >::updatePhase ( const FluidState &  fluidState,
unsigned  phaseIdx,
int  exceptQuantities = ParentType::None 
)
inline

Update all cached parameters of a specific fluid phase.

Parameters
fluidStateThe representation of the thermodynamic system of interest.
phaseIdxThe index of the fluid phase of interest.
exceptQuantitiesThe quantities of the fluid state that have not changed since the last update.

References Opm::PTFlashParameterCache< Scalar, FluidSystem >::updateEosParams(), and Opm::PTFlashParameterCache< Scalar, FluidSystem >::updateMolarVolume_().

◆ updatePressure()

void Opm::ParameterCacheBase< PTFlashParameterCache< Scalar, FluidSystem > >::updatePressure ( const FluidState &  fluidState,
unsigned  phaseIdx 
)
inlineinherited

Update all cached parameters of a specific fluid phase which depend on pressure.

Only use this method if only the pressure of a phase changed between two update*() calls. If more changed, call updatePhase()!

Parameters
fluidStateThe representation of the thermodynamic system of interest.
phaseIdxThe index of the fluid phase of interest.

◆ updatePure_()

template<class Scalar , class FluidSystem >
template<class FluidState >
void Opm::PTFlashParameterCache< Scalar, FluidSystem >::updatePure_ ( const FluidState &  fluidState,
unsigned  phaseIdx 
)
inlineprotected

◆ updateSingleMoleFraction()

template<class Scalar , class FluidSystem >
template<class FluidState >
void Opm::PTFlashParameterCache< Scalar, FluidSystem >::updateSingleMoleFraction ( const FluidState &  fluidState,
unsigned  phaseIdx,
unsigned  compIdx 
)
inline

Update all cached parameters of a specific fluid phase which depend on the mole fraction of a single component.

Only use this method if just a single component's concentration changed between two update*() calls. If more than one concentration changed, call updatePhaseComposition() of updatePhase()!

Parameters
fluidStateThe representation of the thermodynamic system of interest.
phaseIdxThe index of the fluid phase of interest.
compIdxThe component index of the component for which the mole fraction was modified in the fluid phase of interest.

References Opm::PTFlashParameterCache< Scalar, FluidSystem >::gasPhaseParams_, Opm::PTFlashParameterCache< Scalar, FluidSystem >::oilPhaseParams_, Opm::PTFlashParameterCache< Scalar, FluidSystem >::updateMolarVolume_(), and Opm::PengRobinsonParamsMixture< Scalar, FluidSystem, phaseIdx, useSpe5Relations >::updateSingleMoleFraction().

◆ updateTemperature()

void Opm::ParameterCacheBase< PTFlashParameterCache< Scalar, FluidSystem > >::updateTemperature ( const FluidState &  fluidState,
unsigned  phaseIdx 
)
inlineinherited

Update all cached parameters of a specific fluid phase which depend on temperature.

Only use this method if only the temperature of a phase changed between two update*() calls. If more changed, call updatePhase()!

Parameters
fluidStateThe representation of the thermodynamic system of interest.
phaseIdxThe index of the fluid phase of interest.

Member Data Documentation

◆ gasPhaseParams_

◆ oilPhaseParams_

◆ Vm_

◆ VmUpToDate_


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