12#ifndef DUMUX_H2O_HEAVYOIL_FLUID_SYSTEM_HH
13#define DUMUX_H2O_HEAVYOIL_FLUID_SYSTEM_HH
27namespace FluidSystems {
34template <
class Scalar,
37 :
public Base<Scalar, H2OHeavyOil<Scalar, H2OType> >
94 H2O::init(tempMin, tempMax, nTemp,
95 pressMin, pressMax, nPress);
126 static constexpr bool isGas(
int phaseIdx)
128 assert(0 <= phaseIdx && phaseIdx <
numPhases);
157 assert(0 <= phaseIdx && phaseIdx <
numPhases);
175 assert(0 <= phaseIdx && phaseIdx <
numPhases);
181 return H2O::liquidIsCompressible();
192 assert(0 <= phaseIdx && phaseIdx <
numPhases);
199 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
208 case H2OIdx:
return H2O::name();
211 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << compIdx);
220 case H2OIdx:
return H2O::molarMass();
223 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << compIdx);
228 template <
class Flu
idState>
239 return H2O::liquidMolarDensity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx))
256 return H2O::gasDensity(fluidState.temperature(phaseIdx), pH2O)
262 template <
class Flu
idState>
285 template <
class Flu
idState>
291 return H2O::liquidViscosity(fluidState.temperature(phaseIdx),
292 fluidState.pressure(phaseIdx));
297 fluidState.pressure(phaseIdx));
337 template <
class Flu
idState>
344 const Scalar T = fluidState.temperature(phaseIdx);
345 const Scalar p = fluidState.pressure(phaseIdx);
355 DUNE_THROW(Dune::InvalidStateException,
356 "Non-existent binary diffusion coefficient for phase index "
369 template <
class Flu
idState>
379 DUNE_THROW(Dune::InvalidStateException,
380 "Non-existent diffusion coefficient for phase index "<< phaseIdx);
389 template <
class Flu
idState>
394 assert(0 <= phaseIdx && phaseIdx <
numPhases);
397 const Scalar T = fluidState.temperature(phaseIdx);
406 DUNE_THROW(Dune::InvalidStateException,
"non-existent henry coefficient for phase index " << phaseIdx
407 <<
" and component index " << compIdx);
416 template <
class Flu
idState>
422 const Scalar T = fluidState.temperature(phaseIdx);
425 else if (compIdx ==
H2OIdx)
426 return H2O::vaporPressure(T);
428 DUNE_THROW(Dune::InvalidStateException,
"non-existent component index " << compIdx);
437 template <
class Flu
idState>
447 else if (compIdx ==
H2OIdx)
448 return H2O::vaporTemperature(
pressure);
450 DUNE_THROW(Dune::InvalidStateException,
"non-existent component index " << compIdx);
463 template <
class Flu
idState>
468 return H2O::liquidEnthalpy(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx));
475 fluidState.pressure(phaseIdx));
476 Scalar hgw = H2O::gasEnthalpy(fluidState.temperature(phaseIdx),
477 fluidState.pressure(phaseIdx));
485 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
494 template <
class Flu
idState>
497 const Scalar T = fluidState.temperature(phaseIdx);
498 const Scalar p = fluidState.pressure(phaseIdx);
502 if (componentIdx ==
H2OIdx)
503 return H2O::liquidEnthalpy(T, p);
504 else if (componentIdx ==
NAPLIdx)
505 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for NAPL in water is not implemented.");
506 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
510 if (componentIdx ==
H2OIdx)
511 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for water in NAPL is not implemented.");
512 else if (componentIdx ==
NAPLIdx)
514 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
518 if (componentIdx ==
H2OIdx)
519 return H2O::gasEnthalpy(T, p);
520 else if (componentIdx ==
NAPLIdx)
522 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
524 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
529 template <
class Flu
idState>
533 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2ONAPL::heatCapacity()");
545 template <
class Flu
idState>
563 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient [m^2/s] for heavy oil in liquid water.
Definition: h2o_heavyoil.hh:78
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient [m^2/s] for molecular water and heavy oil.
Definition: h2o_heavyoil.hh:65
static Scalar henryOilInWater(Scalar temperature)
Henry coefficient for heavy oil in liquid water.
Definition: h2o_heavyoil.hh:35
static Scalar henryWaterInOil(Scalar temperature)
Henry coefficient for water in liquid heavy oil.
Definition: h2o_heavyoil.hh:50
Properties of the component heavyoil.
Definition: heavyoil.hh:38
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of pure heavyoil.
Definition: heavyoil.hh:422
static constexpr Scalar molarMass()
The molar mass in of heavyoil.
Definition: heavyoil.hh:51
static Scalar vaporPressure(Scalar temperature)
The saturation vapor pressure in of.
Definition: heavyoil.hh:219
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: heavyoil.hh:378
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure heavyoil in at a given pressure and temperature.
Definition: heavyoil.hh:366
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure heavyoil in , depending on pressure and temperature.
Definition: heavyoil.hh:339
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of heavyoil vapor.
Definition: heavyoil.hh:393
static Scalar vaporTemperature(Scalar pressure)
Definition: heavyoil.hh:231
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of heavy oil.
Definition: heavyoil.hh:463
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The (ideal) gas density of heavyoil vapor at a given temperature and pressure .
Definition: heavyoil.hh:328
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition: heavyoil.hh:384
static Scalar liquidEnthalpy(const Scalar temperature, const Scalar pressure)
Specific enthalpy of liquid heavyoil .
Definition: heavyoil.hh:249
static std::string name()
A human readable name for heavyoil.
Definition: heavyoil.hh:45
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of heavyoil vapor .
Definition: heavyoil.hh:317
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of pure heavyoil at a given pressure and temperature .
Definition: heavyoil.hh:348
Tabulates all thermodynamic properties of a given component.
Definition: tabulatedcomponent.hh:672
Fluid system base class.
Definition: fluidsystems/base.hh:33
Scalar Scalar
export the scalar type
Definition: fluidsystems/base.hh:36
A compositional fluid system with water and heavy oil components in both the liquid and the gas phase...
Definition: h2oheavyoil.hh:38
static Scalar henryCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Henry coefficients of a component in a phase.
Definition: h2oheavyoil.hh:390
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: h2oheavyoil.hh:173
static const int gPhaseIdx
Definition: h2oheavyoil.hh:51
static std::string componentName(int compIdx)
Return the human readable name of a component (used in indices)
Definition: h2oheavyoil.hh:205
static const int wCompIdx
Definition: h2oheavyoil.hh:59
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
Calculate the molar density of a fluid phase.
Definition: h2oheavyoil.hh:263
static bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: h2oheavyoil.hh:155
static const int numPhases
Definition: h2oheavyoil.hh:46
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition: h2oheavyoil.hh:118
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Calculate the dynamic viscosity of a fluid phase .
Definition: h2oheavyoil.hh:286
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given all mole fractions in a phase, return the specific phase enthalpy .
Definition: h2oheavyoil.hh:464
static const int H2OIdx
Definition: h2oheavyoil.hh:53
static Scalar partialPressureGas(const FluidState &fluidState, int phaseIdx, int compIdx)
Partial pressures in the gas phase, taken from saturation vapor pressures.
Definition: h2oheavyoil.hh:417
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy of a component in a specific phase.
Definition: h2oheavyoil.hh:495
static const int nPhaseIdx
Definition: h2oheavyoil.hh:50
static Scalar thermalConductivity(const FluidState &fluidState, int phaseIdx)
Thermal conductivity of a fluid phase .
Definition: h2oheavyoil.hh:546
H2OType H2O
Definition: h2oheavyoil.hh:43
static std::string phaseName(int phaseIdx)
Return the human readable name of a phase (used in indices)
Definition: h2oheavyoil.hh:190
static const int numComponents
Definition: h2oheavyoil.hh:47
static constexpr int getMainComponent(int phaseIdx)
Get the main component of a given phase.
Definition: h2oheavyoil.hh:103
static constexpr bool isGas(int phaseIdx)
Return whether a phase is gaseous.
Definition: h2oheavyoil.hh:126
static const int NAPLIdx
Definition: h2oheavyoil.hh:54
static Scalar molarMass(int compIdx)
Return the molar mass of a component in [kg/mol].
Definition: h2oheavyoil.hh:217
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: h2oheavyoil.hh:89
static Scalar density(const FluidState &fluidState, int phaseIdx)
Calculate the density of a fluid phase.
Definition: h2oheavyoil.hh:229
static Scalar inverseVaporPressureCurve(const FluidState &fluidState, int phaseIdx, int compIdx)
Inverse vapor pressures, taken from inverse saturation vapor pressures.
Definition: h2oheavyoil.hh:438
static const int nCompIdx
Definition: h2oheavyoil.hh:60
static bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: h2oheavyoil.hh:138
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx)
Calculate the molecular diffusion coefficient for a component in a fluid phase .
Definition: h2oheavyoil.hh:370
static const int wPhaseIdx
Definition: h2oheavyoil.hh:49
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: h2oheavyoil.hh:338
static void init()
Initialize the fluid system's static parameters generically.
Definition: h2oheavyoil.hh:68
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Specific isobaric heat capacity of a fluid phase .
Definition: h2oheavyoil.hh:530
Material properties of pure water .
Binary coefficients for water and heavy oil.
Properties of the component heavyoil.
Relations valid for an ideal gas.
A collection of input/output field names for common physical quantities.
Scalar h2oGasViscosityInMixture(Scalar temperature, Scalar pressure)
The dynamic viscosity of steam in a gas mixture.
Definition: h2o.hh:961
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:39
std::string gaseousPhase() noexcept
I/O name of gaseous phase.
Definition: name.hh:111
std::string naplPhase() noexcept
I/O name of napl phase.
Definition: name.hh:119
std::string aqueousPhase() noexcept
I/O name of aqueous phase.
Definition: name.hh:115
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:22
Tabulates all thermodynamic properties of a given untabulated chemical species.