24#ifndef DUMUX_COMPONENTS_CONSTANT_HH
25#define DUMUX_COMPONENTS_CONSTANT_HH
27#include <dune/common/exceptions.hh>
55template<
int id,
class Scalar>
98 static const std::string&
name()
176 static const Scalar dynamicViscosity = [&]
178 if (
hasParamInGroup(std::to_string(
id),
"Component.LiquidKinematicViscosity"))
180 if (
hasParamInGroup(std::to_string(
id),
"Component.LiquidDynamicViscosity"))
181 DUNE_THROW(Dune::InvalidStateException,
"Found both Component.LiquidKinematicViscosity and Component.LiquidDynamicViscosity."
182 <<
" Please only specify either the kinematic or the dynamic viscosity for all constant components to avoid ambiguities.");
190 return dynamicViscosity;
201 return thermalConductivity;
214 return heatCapacity * (temperature - tRef);
227 return u + pressure / rho;
278 static const Scalar dynamicViscosity = [&]
280 if (
hasParamInGroup(std::to_string(
id),
"Component.GasKinematicViscosity"))
282 if (
hasParamInGroup(std::to_string(
id),
"Component.GasDynamicViscosity"))
283 DUNE_THROW(Dune::InvalidStateException,
"Found both Component.GasKinematicViscosity and Component.GasDynamicViscosity."
284 <<
" Please only specify either the kinematic or the dynamic viscosity for all constant components to avoid ambiguities.");
292 return dynamicViscosity;
303 return thermalConductivity;
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Interface for components that have a gas state.
Interface for components that have a liquid state.
Interface for components that have a solid state.
Relations valid for an ideal gas.
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:161
bool hasParamInGroup(const std::string ¶mGroup, const std::string ¶m)
Check whether a key exists in the parameter tree with a model group prefix.
Definition parameters.hh:177
const Scalar PengRobinsonMixture< Scalar, StaticParameters >::u
Definition pengrobinsonmixture.hh:150
Base class for all components Components provide the thermodynamic relations for the liquid,...
Definition components/base.hh:59
Scalar Scalar
Definition components/base.hh:63
A component which returns run time specified values for all fluid properties.
Definition constant.hh:61
static Scalar solidDensity(Scalar temperature)
The density in of the component at a given pressure in and temperature in .
Definition constant.hh:376
static const std::string & name()
A human readable name for the component.
Definition constant.hh:98
static Scalar solidThermalConductivity(Scalar temperature)
Thermal conductivity of the component as a solid.
Definition constant.hh:386
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of the component as a gas.
Definition constant.hh:300
static Scalar triplePressure()
Returns the pressure at the component's triple point.
Definition constant.hh:125
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of the component as a liquid.
Definition constant.hh:198
static Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of the component as a liquid.
Definition constant.hh:223
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density in at a given pressure and temperature.
Definition constant.hh:160
static Scalar gasInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of the component as a gas.
Definition constant.hh:319
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition constant.hh:68
static Scalar liquidHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the component as a liquid.
Definition constant.hh:236
static Scalar gasHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the component as a gas.
Definition constant.hh:345
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density in at a given pressure and temperature.
Definition constant.hh:261
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of the component as a gas.
Definition constant.hh:333
static Scalar tripleTemperature()
Returns the temperature at the components's triple point.
Definition constant.hh:116
static Scalar solidHeatCapacity(Scalar temperature)
Specific isobaric heat capacity of the component as a solid.
Definition constant.hh:396
static constexpr bool gasViscosityIsConstant()
Returns true if the gas phase viscosity is constant.
Definition constant.hh:74
static Scalar liquidInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of the component as a liquid.
Definition constant.hh:209
static Scalar gasDensity(Scalar temperature, Scalar pressure)
Sets the gas density in .
Definition constant.hh:248
static constexpr bool liquidViscosityIsConstant()
Returns true if the liquid phase viscosity is constant.
Definition constant.hh:92
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition constant.hh:80
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
Sets the liquid density in .
Definition constant.hh:147
static Scalar molarMass()
The mass in of one mole of the component.
Definition constant.hh:107
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition constant.hh:86
static Scalar vaporPressure(Scalar T)
The vapor pressure in of a the component at a given temperature.
Definition constant.hh:359
static Scalar vaporizationEnthalpy()
The vaporization enthalpy in needed to vaporize one kilogram of the liquid component to the gaseous ...
Definition constant.hh:134
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
Sets the liquid dynamic viscosity in .
Definition constant.hh:174
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
Sets the gas dynamic viscosity in .
Definition constant.hh:276
Interface for components that have a gas state.
Definition gas.hh:41
Interface for components that have a liquid state.
Definition liquid.hh:41
Interface for components that have a solid state.
Definition solid.hh:41
Relations valid for an ideal gas.
Definition idealgas.hh:37
static constexpr Scalar R
The ideal gas constant .
Definition idealgas.hh:40
Base class for all components Components provide the thermodynamic relations for the liquid,...