version 3.11-dev
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
Dumux::FluidSystems::Base< ScalarType, Implementation > Class Template Reference

Fluid system base class. More...

#include <dumux/material/fluidsystems/base.hh>

Inheritance diagram for Dumux::FluidSystems::Base< ScalarType, Implementation >:

Description

template<class ScalarType, class Implementation>
class Dumux::FluidSystems::Base< ScalarType, Implementation >
Note
Always derive your fluid system from this class to be sure that all basic functionality is available!

Public Types

using Scalar = ScalarType
 export the scalar type More...
 
using ParameterCache = NullParameterCache
 The type of parameter cache objects. More...
 

Static Public Member Functions

static constexpr bool isTracerFluidSystem ()
 Some properties of the fluid system. More...
 
template<class I = Implementation, std::enable_if_t<!I::isTracerFluidSystem(), int > = 0>
static constexpr int getMainComponent (int phaseIdx)
 Get the main component of a given phase if possible. More...
 
template<class T = Implementation>
static constexpr bool isCompressible (int phaseIdx)
 Returns true if and only if a fluid phase is assumed to be compressible. More...
 
template<class T = Implementation>
static constexpr bool isMiscible ()
 Returns whether the fluids are miscible. More...
 
static constexpr bool viscosityIsConstant (int phaseIdx)
 Returns true if and only if a fluid phase is assumed to have a constant viscosity. More...
 
static std::string phaseName (int phaseIdx)
 Return the human readable name of a fluid phase. More...
 
static std::string componentName (int phaseIdx)
 Return the human readable name of a fluid phase. More...
 
template<class FluidState >
static Scalar density (const FluidState &fluidState, int phaseIdx)
 Calculate the density [kg/m3] of a fluid phase. More...
 
template<class FluidState >
static Scalar density (const FluidState &fluidState, const ParameterCache &paramCache, int phaseIdx)
 Calculate the density [kg/m3] of a fluid phase. More...
 
template<class FluidState >
static Scalar molarDensity (const FluidState &fluidState, int phaseIdx)
 Calculate the molar density [mol/m3] of a fluid phase. More...
 
template<class FluidState >
static Scalar molarDensity (const FluidState &fluidState, const ParameterCache &paramCache, int phaseIdx)
 Calculate the molar density [mol/m3] of a fluid phase. More...
 
template<class FluidState >
static Scalar fugacityCoefficient (const FluidState &fluidState, int phaseIdx, int compIdx)
 Calculate the fugacity coefficient [Pa] of an individual component in a fluid phase. More...
 
template<class FluidState >
static Scalar fugacityCoefficient (const FluidState &fluidState, const ParameterCache &paramCache, int phaseIdx, int compIdx)
 Calculate the fugacity coefficient [Pa] of an individual component in a fluid phase. More...
 
template<class FluidState >
static Scalar viscosity (const FluidState &fluidState, int phaseIdx)
 Calculate the dynamic viscosity of a fluid phase [Pas]. More...
 
template<class FluidState >
static Scalar viscosity (const FluidState &fluidState, const ParameterCache &paramCache, int phaseIdx)
 Calculate the dynamic viscosity of a fluid phase [Pas]. More...
 
template<class FluidState >
static Scalar diffusionCoefficient (const FluidState &fluidState, int phaseIdx, int compIdx)
 Calculate the binary molecular diffusion coefficient for a component in a fluid phase [mol2s/(kgm3)]. More...
 
template<class FluidState >
static Scalar diffusionCoefficient (const FluidState &fluidState, const ParameterCache &paramCache, int phaseIdx, int compIdx)
 Calculate the binary molecular diffusion coefficient for a component in a fluid phase [mol2s/(kgm3)]. More...
 
template<class FluidState >
static Scalar binaryDiffusionCoefficient (const FluidState &fluidState, int phaseIdx, int compIIdx, int compJIdx)
 Given a phase's composition, temperature and pressure, return the binary diffusion coefficient [m2/s] for components i and j in this phase. More...
 
template<class FluidState >
static Scalar binaryDiffusionCoefficient (const FluidState &fluidState, const ParameterCache &paramCache, int phaseIdx, int compIIdx, int compJIdx)
 Given a phase's composition, temperature and pressure, return the binary diffusion coefficient [m2/s] for components i and j in this phase. More...
 
template<class FluidState >
static Scalar enthalpy (const FluidState &fluidState, int phaseIdx)
 Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy [J/kg]. More...
 
template<class FluidState >
static Scalar enthalpy (const FluidState &fluidState, const ParameterCache &paramCache, int phaseIdx)
 Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy [J/kg]. More...
 
template<class FluidState >
static Scalar thermalConductivity (const FluidState &fluidState, int phaseIdx)
 Thermal conductivity λα of a fluid phase [W/(mK)]. More...
 
template<class FluidState >
static Scalar thermalConductivity (const FluidState &fluidState, const ParameterCache &paramCache, int phaseIdx)
 Thermal conductivity λα of a fluid phase [W/(mK)]. More...
 
template<class FluidState >
static Scalar heatCapacity (const FluidState &fluidState, int phaseIdx)
 Specific isobaric heat capacity cp,α of a fluid phase [J/(kgK)]. More...
 
template<class FluidState >
static Scalar heatCapacity (const FluidState &fluidState, const ParameterCache &paramCache, int phaseIdx)
 Specific isobaric heat capacity cp,α of a fluid phase [J/(kgK)]. More...
 

Member Typedef Documentation

◆ ParameterCache

template<class ScalarType , class Implementation >
using Dumux::FluidSystems::Base< ScalarType, Implementation >::ParameterCache = NullParameterCache

◆ Scalar

template<class ScalarType , class Implementation >
using Dumux::FluidSystems::Base< ScalarType, Implementation >::Scalar = ScalarType

Member Function Documentation

◆ binaryDiffusionCoefficient() [1/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::binaryDiffusionCoefficient ( const FluidState &  fluidState,
const ParameterCache paramCache,
int  phaseIdx,
int  compIIdx,
int  compJIdx 
)
inlinestatic
Parameters
fluidStateThe fluid state
paramCachemutable parameters
phaseIdxIndex of the fluid phase
compIIdxIndex of the component i
compJIdxIndex of the component j

◆ binaryDiffusionCoefficient() [2/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::binaryDiffusionCoefficient ( const FluidState &  fluidState,
int  phaseIdx,
int  compIIdx,
int  compJIdx 
)
inlinestatic
Parameters
fluidStateThe fluid state
phaseIdxIndex of the fluid phase
compIIdxIndex of the component i
compJIdxIndex of the component j

◆ componentName()

template<class ScalarType , class Implementation >
static std::string Dumux::FluidSystems::Base< ScalarType, Implementation >::componentName ( int  phaseIdx)
inlinestatic
Parameters
phaseIdxThe index of the fluid phase to consider

◆ density() [1/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::density ( const FluidState &  fluidState,
const ParameterCache paramCache,
int  phaseIdx 
)
inlinestatic
Parameters
fluidStateThe fluid state
paramCachemutable parameters
phaseIdxIndex of the fluid phase

◆ density() [2/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::density ( const FluidState &  fluidState,
int  phaseIdx 
)
inlinestatic
Parameters
fluidStateThe fluid state
phaseIdxIndex of the fluid phase

◆ diffusionCoefficient() [1/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::diffusionCoefficient ( const FluidState &  fluidState,
const ParameterCache paramCache,
int  phaseIdx,
int  compIdx 
)
inlinestatic

Molecular diffusion of a component κ is caused by a gradient of the chemical potential and follows the law

J=Dμκ

where μκ is the component's chemical potential, D is the diffusion coefficient and J is the diffusive flux. μκ is connected to the component's fugacity fκ by the relation

μκ=RTαlnfκpα

where pα and Tα are the fluid phase' pressure and temperature.

Parameters
fluidStateThe fluid state
paramCachemutable parameters
phaseIdxIndex of the fluid phase
compIdxIndex of the component

◆ diffusionCoefficient() [2/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::diffusionCoefficient ( const FluidState &  fluidState,
int  phaseIdx,
int  compIdx 
)
inlinestatic

Molecular diffusion of a component κ is caused by a gradient of the chemical potential and follows the law

J=Dμκ

where μκ is the component's chemical potential, D is the diffusion coefficient and J is the diffusive flux. μκ is connected to the component's fugacity fκ by the relation

μκ=RTαlnfκpα

where pα and Tα are the fluid phase' pressure and temperature.

Parameters
fluidStateThe fluid state
phaseIdxIndex of the fluid phase
compIdxIndex of the component

◆ enthalpy() [1/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::enthalpy ( const FluidState &  fluidState,
const ParameterCache paramCache,
int  phaseIdx 
)
inlinestatic
Parameters
fluidStateThe fluid state
paramCachemutable parameters
phaseIdxIndex of the fluid phase

◆ enthalpy() [2/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::enthalpy ( const FluidState &  fluidState,
int  phaseIdx 
)
inlinestatic
Parameters
fluidStateThe fluid state
phaseIdxIndex of the fluid phase

◆ fugacityCoefficient() [1/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::fugacityCoefficient ( const FluidState &  fluidState,
const ParameterCache paramCache,
int  phaseIdx,
int  compIdx 
)
inlinestatic

The fugacity coefficient ϕακ is connected to the fugacity fακ and the component's mole fraction xακ by means of the relation

fακ=ϕακxακpα

Parameters
fluidStateThe fluid state
paramCachemutable parameters
phaseIdxIndex of the fluid phase
compIdxIndex of the component

◆ fugacityCoefficient() [2/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::fugacityCoefficient ( const FluidState &  fluidState,
int  phaseIdx,
int  compIdx 
)
inlinestatic

The fugacity coefficient ϕακ is connected to the fugacity fακ and the component's mole fraction xακ by means of the relation

fακ=ϕακxακpα

Parameters
fluidStateThe fluid state
phaseIdxIndex of the fluid phase
compIdxIndex of the component

◆ getMainComponent()

template<class ScalarType , class Implementation >
template<class I = Implementation, std::enable_if_t<!I::isTracerFluidSystem(), int > = 0>
static constexpr int Dumux::FluidSystems::Base< ScalarType, Implementation >::getMainComponent ( int  phaseIdx)
inlinestaticconstexpr
Parameters
phaseIdxThe index of the fluid phase to consider
Note
This only makes sense if this is not a tracer fluid system (then the bulk component is not balanced)

◆ heatCapacity() [1/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::heatCapacity ( const FluidState &  fluidState,
const ParameterCache paramCache,
int  phaseIdx 
)
inlinestatic

Given a fluid state, an up-to-date parameter cache and a phase index, this method computes the isobaric heat capacity cp,α of the fluid phase. The isobaric heat capacity is defined as the partial derivative of the specific enthalpy hα to the fluid pressure pα:

cp,α=hαpα

Parameters
fluidStaterepresents all relevant thermodynamic quantities of a fluid system
paramCachemutable parameters
phaseIdxIndex of the fluid phase

◆ heatCapacity() [2/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::heatCapacity ( const FluidState &  fluidState,
int  phaseIdx 
)
inlinestatic
Parameters
fluidStaterepresents all relevant thermodynamic quantities of a fluid system
phaseIdxIndex of the fluid phase

Given a fluid state, an up-to-date parameter cache and a phase index, this method computes the isobaric heat capacity cp,α of the fluid phase. The isobaric heat capacity is defined as the partial derivative of the specific enthalpy hα to the fluid pressure pα:

cp,α=hαpα

◆ isCompressible()

template<class ScalarType , class Implementation >
template<class T = Implementation>
static constexpr bool Dumux::FluidSystems::Base< ScalarType, Implementation >::isCompressible ( int  phaseIdx)
inlinestaticconstexpr

Compressible means that the partial derivative of the density to the fluid pressure is always larger than zero.

Parameters
phaseIdxThe index of the fluid phase to consider

◆ isMiscible()

template<class ScalarType , class Implementation >
template<class T = Implementation>
static constexpr bool Dumux::FluidSystems::Base< ScalarType, Implementation >::isMiscible ( )
inlinestaticconstexpr

◆ isTracerFluidSystem()

template<class ScalarType , class Implementation >
static constexpr bool Dumux::FluidSystems::Base< ScalarType, Implementation >::isTracerFluidSystem ( )
inlinestaticconstexpr

If the fluid system only contains tracer components

◆ molarDensity() [1/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::molarDensity ( const FluidState &  fluidState,
const ParameterCache paramCache,
int  phaseIdx 
)
inlinestatic

The molar density is defined by the mass density ρα and the component molar mass Mα after

ρmol,α=ραMα.

Parameters
fluidStateThe fluid state
paramCachemutable parameters
phaseIdxIndex of the fluid phase

◆ molarDensity() [2/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::molarDensity ( const FluidState &  fluidState,
int  phaseIdx 
)
inlinestatic
Parameters
fluidStateThe fluid state
phaseIdxIndex of the fluid phase

◆ phaseName()

template<class ScalarType , class Implementation >
static std::string Dumux::FluidSystems::Base< ScalarType, Implementation >::phaseName ( int  phaseIdx)
inlinestatic
Parameters
phaseIdxThe index of the fluid phase to consider

◆ thermalConductivity() [1/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::thermalConductivity ( const FluidState &  fluidState,
const ParameterCache paramCache,
int  phaseIdx 
)
inlinestatic
Parameters
fluidStateThe fluid state
paramCachemutable parameters
phaseIdxIndex of the fluid phase

◆ thermalConductivity() [2/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::thermalConductivity ( const FluidState &  fluidState,
int  phaseIdx 
)
inlinestatic
Parameters
fluidStateThe fluid state
phaseIdxIndex of the fluid phase

◆ viscosity() [1/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::viscosity ( const FluidState &  fluidState,
const ParameterCache paramCache,
int  phaseIdx 
)
inlinestatic
Parameters
fluidStateThe fluid state
paramCachemutable parameters
phaseIdxIndex of the fluid phase

◆ viscosity() [2/2]

template<class ScalarType , class Implementation >
template<class FluidState >
static Scalar Dumux::FluidSystems::Base< ScalarType, Implementation >::viscosity ( const FluidState &  fluidState,
int  phaseIdx 
)
inlinestatic
Parameters
fluidStateThe fluid state
phaseIdxIndex of the fluid phase

◆ viscosityIsConstant()

template<class ScalarType , class Implementation >
static constexpr bool Dumux::FluidSystems::Base< ScalarType, Implementation >::viscosityIsConstant ( int  phaseIdx)
inlinestaticconstexpr
Parameters
phaseIdxThe index of the fluid phase to consider

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