24#ifndef DUMUX_H2O_HEAVYOIL_FLUID_SYSTEM_HH
25#define DUMUX_H2O_HEAVYOIL_FLUID_SYSTEM_HH
39namespace FluidSystems {
46template <
class Scalar,
49 :
public Base<Scalar, H2OHeavyOil<Scalar, H2OType> >
105 if (H2O::isTabulated)
107 H2O::init(tempMin, tempMax, nTemp,
108 pressMin, pressMax, nPress);
139 static constexpr bool isGas(
int phaseIdx)
141 assert(0 <= phaseIdx && phaseIdx <
numPhases);
170 assert(0 <= phaseIdx && phaseIdx <
numPhases);
188 assert(0 <= phaseIdx && phaseIdx <
numPhases);
194 return H2O::liquidIsCompressible();
205 assert(0 <= phaseIdx && phaseIdx <
numPhases);
212 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
221 case H2OIdx:
return H2O::name();
224 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << compIdx);
233 case H2OIdx:
return H2O::molarMass();
236 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << compIdx);
244 template <
class Flu
idState>
255 return H2O::liquidMolarDensity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx))
272 return H2O::gasDensity(fluidState.temperature(phaseIdx), pH2O)
286 template <
class Flu
idState>
311 template <
class Flu
idState>
317 return H2O::liquidViscosity(fluidState.temperature(phaseIdx),
318 fluidState.pressure(phaseIdx));
323 fluidState.pressure(phaseIdx));
363 template <
class Flu
idState>
370 const Scalar T = fluidState.temperature(phaseIdx);
371 const Scalar p = fluidState.pressure(phaseIdx);
381 DUNE_THROW(Dune::InvalidStateException,
382 "Non-existent binary diffusion coefficient for phase index "
408 template <
class Flu
idState>
418 DUNE_THROW(Dune::InvalidStateException,
419 "Non-existent diffusion coefficient for phase index "<< phaseIdx);
425 template <
class Flu
idState>
430 assert(0 <= phaseIdx && phaseIdx <
numPhases);
433 const Scalar T = fluidState.temperature(phaseIdx);
442 DUNE_THROW(Dune::InvalidStateException,
"non-existent henry coefficient for phase index " << phaseIdx
443 <<
" and component index " << compIdx);
449 template <
class Flu
idState>
455 const Scalar T = fluidState.temperature(phaseIdx);
458 else if (compIdx ==
H2OIdx)
459 return H2O::vaporPressure(T);
461 DUNE_THROW(Dune::InvalidStateException,
"non-existent component index " << compIdx);
467 template <
class Flu
idState>
477 else if (compIdx ==
H2OIdx)
478 return H2O::vaporTemperature(
pressure);
480 DUNE_THROW(Dune::InvalidStateException,
"non-existent component index " << compIdx);
493 template <
class Flu
idState>
498 return H2O::liquidEnthalpy(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx));
505 fluidState.pressure(phaseIdx));
506 Scalar hgw = H2O::gasEnthalpy(fluidState.temperature(phaseIdx),
507 fluidState.pressure(phaseIdx));
515 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
524 template <
class Flu
idState>
527 const Scalar T = fluidState.temperature(phaseIdx);
528 const Scalar p = fluidState.pressure(phaseIdx);
532 if (componentIdx ==
H2OIdx)
533 return H2O::liquidEnthalpy(T, p);
534 else if (componentIdx ==
NAPLIdx)
535 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for NAPL in water is not implemented.");
536 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
540 if (componentIdx ==
H2OIdx)
541 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for water in NAPL is not implemented.");
542 else if (componentIdx ==
NAPLIdx)
544 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
548 if (componentIdx ==
H2OIdx)
549 return H2O::gasEnthalpy(T, p);
550 else if (componentIdx ==
NAPLIdx)
552 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
554 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
558 template <
class Flu
idState>
562 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2ONAPL::heatCapacity()");
574 template <
class Flu
idState>
592 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
A collection of input/output field names for common physical quantities.
Binary coefficients for water and heavy oil.
Material properties of pure water .
Properties of the component heavyoil.
Tabulates all thermodynamic properties of a given untabulated chemical species.
Relations valid for an ideal gas.
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 naplPhase() noexcept
I/O name of napl phase.
Definition: name.hh:131
std::string aqueousPhase() noexcept
I/O name of aqueous phase.
Definition: name.hh:127
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:34
Scalar h2oGasViscosityInMixture(Scalar temperature, Scalar pressure)
The dynamic viscosity of steam in a gas mixture.
Definition: h2o.hh:977
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient [m^2/s] for heavy oil in liquid water.
Definition: h2o_heavyoil.hh:90
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient [m^2/s] for molecular water and heavy oil.
Definition: h2o_heavyoil.hh:77
static Scalar henryOilInWater(Scalar temperature)
Henry coefficient for heavy oil in liquid water.
Definition: h2o_heavyoil.hh:47
static Scalar henryWaterInOil(Scalar temperature)
Henry coefficient for water in liquid heavy oil.
Definition: h2o_heavyoil.hh:62
Properties of the component heavyoil.
Definition: heavyoil.hh:50
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of pure heavyoil.
Definition: heavyoil.hh:434
static constexpr Scalar molarMass()
The molar mass in of heavyoil.
Definition: heavyoil.hh:63
static Scalar vaporPressure(Scalar temperature)
The saturation vapor pressure in of.
Definition: heavyoil.hh:231
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: heavyoil.hh:390
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure heavyoil in at a given pressure and temperature.
Definition: heavyoil.hh:378
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure heavyoil in , depending on pressure and temperature.
Definition: heavyoil.hh:351
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of heavyoil vapor.
Definition: heavyoil.hh:405
static Scalar vaporTemperature(Scalar pressure)
Definition: heavyoil.hh:243
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of heavy oil.
Definition: heavyoil.hh:475
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The (ideal) gas density of heavyoil vapor at a given temperature and pressure .
Definition: heavyoil.hh:340
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition: heavyoil.hh:396
static Scalar liquidEnthalpy(const Scalar temperature, const Scalar pressure)
Specific enthalpy of liquid heavyoil .
Definition: heavyoil.hh:261
static std::string name()
A human readable name for heavyoil.
Definition: heavyoil.hh:57
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of heavyoil vapor .
Definition: heavyoil.hh:329
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of pure heavyoil at a given pressure and temperature .
Definition: heavyoil.hh:360
Tabulates all thermodynamic properties of a given untabulated chemical species.
Definition: tabulatedcomponent.hh:82
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 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
A compositional fluid system with water and heavy oil components in both the liquid and the gas phase...
Definition: h2oheavyoil.hh:50
static Scalar henryCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Henry coefficients of a component in a phase.
Definition: h2oheavyoil.hh:426
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: h2oheavyoil.hh:186
static const int gPhaseIdx
Definition: h2oheavyoil.hh:64
static std::string componentName(int compIdx)
Return the human readable name of a component (used in indices)
Definition: h2oheavyoil.hh:218
static const int wCompIdx
Definition: h2oheavyoil.hh:72
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
The molar density of a fluid phase in .
Definition: h2oheavyoil.hh:287
static bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: h2oheavyoil.hh:168
static const int numPhases
Definition: h2oheavyoil.hh:59
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition: h2oheavyoil.hh:131
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Definition: h2oheavyoil.hh:312
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Definition: h2oheavyoil.hh:494
static const int H2OIdx
Definition: h2oheavyoil.hh:66
static Scalar partialPressureGas(const FluidState &fluidState, int phaseIdx, int compIdx)
Partial pressures in the gas phase, taken from saturation vapor pressures.
Definition: h2oheavyoil.hh:450
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy of a component in a specific phase.
Definition: h2oheavyoil.hh:525
static const int nPhaseIdx
Definition: h2oheavyoil.hh:63
static Scalar thermalConductivity(const FluidState &fluidState, int phaseIdx)
Definition: h2oheavyoil.hh:575
H2OType H2O
Definition: h2oheavyoil.hh:56
static std::string phaseName(int phaseIdx)
Return the human readable name of a phase (used in indices)
Definition: h2oheavyoil.hh:203
static const int numComponents
Definition: h2oheavyoil.hh:60
static constexpr int getMainComponent(int phaseIdx)
Get the main component of a given phase.
Definition: h2oheavyoil.hh:116
static constexpr bool isGas(int phaseIdx)
Return whether a phase is gaseous.
Definition: h2oheavyoil.hh:139
static const int NAPLIdx
Definition: h2oheavyoil.hh:67
static Scalar molarMass(int compIdx)
Return the molar mass of a component in [kg/mol].
Definition: h2oheavyoil.hh:230
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:102
static Scalar density(const FluidState &fluidState, int phaseIdx)
Definition: h2oheavyoil.hh:245
static Scalar inverseVaporPressureCurve(const FluidState &fluidState, int phaseIdx, int compIdx)
Inverse vapor pressures, taken from inverse saturation vapor pressures.
Definition: h2oheavyoil.hh:468
static const int nCompIdx
Definition: h2oheavyoil.hh:73
static bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: h2oheavyoil.hh:151
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase .
Definition: h2oheavyoil.hh:409
static const int wPhaseIdx
Definition: h2oheavyoil.hh:62
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:364
static void init()
Initialize the fluid system's static parameters generically.
Definition: h2oheavyoil.hh:81
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Definition: h2oheavyoil.hh:559