24#ifndef DUMUX_2P_1C_FLUID_SYSTEM_HH
25#define DUMUX_2P_1C_FLUID_SYSTEM_HH
31#include <dune/common/exceptions.hh>
38namespace FluidSystems {
43template <
class Scalar,
class ComponentType>
45 :
public Base<Scalar, TwoPOneC<Scalar, ComponentType> >
49 using Component = ComponentType;
72 static std::string name[] = {
77 assert(0 <= phaseIdx && phaseIdx <
numPhases);
78 return name[phaseIdx];
92 static constexpr bool isGas(
int phaseIdx)
94 assert(0 <= phaseIdx && phaseIdx <
numPhases);
114 assert(0 <= phaseIdx && phaseIdx <
numPhases);
132 assert(0 <= phaseIdx && phaseIdx <
numPhases);
137 return Component::liquidIsCompressible();
148 assert(0 <= phaseIdx && phaseIdx <
numPhases);
152 return Component::gasIsIdeal();
168 return Component::name();
179 return Component::molarMass();
190 return Component::criticalTemperature();
201 return Component::criticalPressure();
211 DUNE_THROW(Dune::NotImplemented,
212 "TwoPOneC::criticalMolarVolume()");
224 return Component::acentricFactor();
261 if (Component::isTabulated)
263 Component::init(tempMin, tempMax, nTemp,
264 pressMin, pressMax, nPress);
275 template <
class Flu
idState>
279 assert(0 <= phaseIdx && phaseIdx <
numPhases);
293 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index.");
306 template <
class Flu
idState>
316 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index.");
326 template <
class Flu
idState>
330 assert(0 <= phaseIdx && phaseIdx <
numPhases);
341 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index.");
350 template <
class Flu
idState>
352 const unsigned int phaseIdx)
354 assert(0 <= phaseIdx && phaseIdx <
numPhases);
357 return Component::vaporTemperature(
pressure);
388 template <
class Flu
idState>
393 assert(0 <= phaseIdx && phaseIdx <
numPhases);
409 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index.");
422 template <
class Flu
idState>
428 DUNE_THROW(Dune::NotImplemented,
"Diffusion coefficients");
442 template <
class Flu
idState>
448 { DUNE_THROW(Dune::NotImplemented,
"Binary Diffusion coefficients"); }
457 template <
class Flu
idState>
461 assert(0 <= phaseIdx && phaseIdx <
numPhases);
465 return Component::liquidEnthalpy(fluidState.temperature(phaseIdx),
466 fluidState.pressure(phaseIdx));
469 return Component::gasEnthalpy(fluidState.temperature(phaseIdx),
470 fluidState.pressure(phaseIdx));
473 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index.");
485 template <
class Flu
idState>
489 assert(0 <= phaseIdx && phaseIdx <
numPhases);
492 return Component::liquidThermalConductivity(fluidState.temperature(phaseIdx),
493 fluidState.pressure(phaseIdx));
496 return Component::gasThermalConductivity(fluidState.temperature(phaseIdx),
497 fluidState.pressure(phaseIdx));
500 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index.");
511 template <
class Flu
idState>
515 assert(0 <= phaseIdx && phaseIdx <
numPhases);
518 return Component::liquidHeatCapacity(fluidState.temperature(phaseIdx),
519 fluidState.pressure(phaseIdx));
522 return Component::gasHeatCapacity(fluidState.temperature(phaseIdx),
523 fluidState.pressure(phaseIdx));
526 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index.");
A collection of input/output field names for common physical quantities.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:51
std::string gaseousPhase() noexcept
I/O name of gaseous phase.
Definition: name.hh:123
std::string liquidPhase() noexcept
I/O name of liquid phase.
Definition: name.hh:119
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:34
A two-phase fluid system with only one component.
Definition: 2p1c.hh:46
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Definition: 2p1c.hh:458
static Scalar molarMass(int compIdx)
Return the molar mass of a component in [kg/mol].
Definition: 2p1c.hh:176
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition: 2p1c.hh:84
static std::string componentName(int compIdx)
Return the human readable name of a component.
Definition: 2p1c.hh:165
static constexpr bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: 2p1c.hh:146
static Scalar criticalMolarVolume(int compIdx)
Molar volume of a component at the critical point [m^3/mol].
Definition: 2p1c.hh:209
static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, Scalar pressMin, Scalar pressMax, unsigned nPress)
Initialize the fluid system's static parameters using problem specific temperature and pressure range...
Definition: 2p1c.hh:258
static constexpr int comp0Idx
index of the only component
Definition: 2p1c.hh:60
static Scalar criticalTemperature(int compIdx)
Critical temperature of a component [K].
Definition: 2p1c.hh:187
static constexpr int numPhases
Number of phases in the fluid system.
Definition: 2p1c.hh:52
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: 2p1c.hh:130
static std::string phaseName(int phaseIdx)
Return the human readable name of a fluid phase.
Definition: 2p1c.hh:70
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Definition: 2p1c.hh:389
static Scalar criticalPressure(int compIdx)
Critical pressure of a component [Pa].
Definition: 2p1c.hh:198
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Definition: 2p1c.hh:512
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
The molar density of a fluid phase in .
Definition: 2p1c.hh:307
static Scalar binaryDiffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIIdx, int compJIdx)
Definition: 2p1c.hh:443
static constexpr int phase1Idx
index of the second phase
Definition: 2p1c.hh:58
static constexpr int liquidPhaseIdx
index of the liquid phase
Definition: 2p1c.hh:55
static constexpr int numComponents
Number of components in the fluid system.
Definition: 2p1c.hh:53
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Definition: 2p1c.hh:423
static constexpr int gasPhaseIdx
index of the gas phase
Definition: 2p1c.hh:56
static Scalar thermalConductivity(const FluidState &fluidState, const int phaseIdx)
Definition: 2p1c.hh:486
static Scalar vaporTemperature(const FluidState &fluidState, const unsigned int phaseIdx)
calculate the temperature of vapor at a given pressure on the vapor pressure curve.
Definition: 2p1c.hh:351
static Scalar density(const FluidState &fluidState, int phaseIdx)
Definition: 2p1c.hh:276
static constexpr bool isGas(int phaseIdx)
Return whether a phase is gaseous.
Definition: 2p1c.hh:92
static constexpr bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: 2p1c.hh:112
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Definition: 2p1c.hh:327
static void init()
Initialize the fluid system's static parameters generically.
Definition: 2p1c.hh:237
static constexpr int phase0Idx
index of the first phase
Definition: 2p1c.hh:57
static Scalar acentricFactor(int compIdx)
The acentric factor of a component [].
Definition: 2p1c.hh:221
Fluid system base class.
Definition: fluidsystems/base.hh:45
Scalar Scalar
export the scalar type
Definition: fluidsystems/base.hh:48
static Scalar density(const FluidState &fluidState, int phaseIdx)
Calculate the density of a fluid phase.
Definition: fluidsystems/base.hh:134
static Scalar thermalConductivity(const FluidState &fluidState, int phaseIdx)
Thermal conductivity of a fluid phase .
Definition: fluidsystems/base.hh:390
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the fugacity coefficient of an individual component in a fluid phase.
Definition: fluidsystems/base.hh:197
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase .
Definition: fluidsystems/base.hh:278
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 for c...
Definition: fluidsystems/base.hh:326
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy .
Definition: fluidsystems/base.hh:363
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
Calculate the molar density of a fluid phase.
Definition: fluidsystems/base.hh:160
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Calculate the dynamic viscosity of a fluid phase .
Definition: fluidsystems/base.hh:236
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Specific isobaric heat capacity of a fluid phase .
Definition: fluidsystems/base.hh:424