12#ifndef DUMUX_H2O_HEAVYOIL_FLUID_SYSTEM_HH
13#define DUMUX_H2O_HEAVYOIL_FLUID_SYSTEM_HH
33template <
class Scalar,
34 class H2OType = Dumux::Components::TabulatedComponent<Dumux::Components::H2O<Scalar> > >
36 :
public Base<Scalar, H2OHeavyOil<Scalar, H2OType> >
93 H2O::init(tempMin, tempMax, nTemp,
94 pressMin, pressMax, nPress);
125 static constexpr bool isGas(
int phaseIdx)
127 assert(0 <= phaseIdx && phaseIdx <
numPhases);
156 assert(0 <= phaseIdx && phaseIdx <
numPhases);
174 assert(0 <= phaseIdx && phaseIdx <
numPhases);
180 return H2O::liquidIsCompressible();
191 assert(0 <= phaseIdx && phaseIdx <
numPhases);
198 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
207 case H2OIdx:
return H2O::name();
210 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << compIdx);
219 case H2OIdx:
return H2O::molarMass();
222 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << compIdx);
227 template <
class Flu
idState>
238 return H2O::liquidMolarDensity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx))
255 return H2O::gasDensity(fluidState.temperature(phaseIdx), pH2O)
261 template <
class Flu
idState>
264 Scalar temperature = fluidState.temperature(phaseIdx);
265 Scalar pressure = fluidState.pressure(phaseIdx);
273 return H2O::liquidMolarDensity(temperature, pressure);
277 return H2O::gasMolarDensity(temperature, fluidState.partialPressure(
gPhaseIdx,
H2OIdx))
284 template <
class Flu
idState>
290 return H2O::liquidViscosity(fluidState.temperature(phaseIdx),
291 fluidState.pressure(phaseIdx));
296 fluidState.pressure(phaseIdx));
336 template <
class Flu
idState>
343 const Scalar T = fluidState.temperature(phaseIdx);
344 const Scalar p = fluidState.pressure(phaseIdx);
354 DUNE_THROW(Dune::InvalidStateException,
355 "Non-existent binary diffusion coefficient for phase index "
368 template <
class Flu
idState>
378 DUNE_THROW(Dune::InvalidStateException,
379 "Non-existent diffusion coefficient for phase index "<< phaseIdx);
388 template <
class Flu
idState>
393 assert(0 <= phaseIdx && phaseIdx <
numPhases);
396 const Scalar T = fluidState.temperature(phaseIdx);
405 DUNE_THROW(Dune::InvalidStateException,
"non-existent henry coefficient for phase index " << phaseIdx
406 <<
" and component index " << compIdx);
415 template <
class Flu
idState>
421 const Scalar T = fluidState.temperature(phaseIdx);
424 else if (compIdx ==
H2OIdx)
425 return H2O::vaporPressure(T);
427 DUNE_THROW(Dune::InvalidStateException,
"non-existent component index " << compIdx);
436 template <
class Flu
idState>
443 const Scalar pressure = fluidState.pressure(phaseIdx);
446 else if (compIdx ==
H2OIdx)
447 return H2O::vaporTemperature(pressure);
449 DUNE_THROW(Dune::InvalidStateException,
"non-existent component index " << compIdx);
462 template <
class Flu
idState>
467 return H2O::liquidEnthalpy(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx));
474 fluidState.pressure(phaseIdx));
475 Scalar hgw = H2O::gasEnthalpy(fluidState.temperature(phaseIdx),
476 fluidState.pressure(phaseIdx));
484 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
493 template <
class Flu
idState>
496 const Scalar T = fluidState.temperature(phaseIdx);
497 const Scalar p = fluidState.pressure(phaseIdx);
501 if (componentIdx ==
H2OIdx)
502 return H2O::liquidEnthalpy(T, p);
503 else if (componentIdx ==
NAPLIdx)
504 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for NAPL in water is not implemented.");
505 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
509 if (componentIdx ==
H2OIdx)
510 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for water in NAPL is not implemented.");
511 else if (componentIdx ==
NAPLIdx)
513 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
517 if (componentIdx ==
H2OIdx)
518 return H2O::gasEnthalpy(T, p);
519 else if (componentIdx ==
NAPLIdx)
521 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
523 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
528 template <
class Flu
idState>
532 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2ONAPL::heatCapacity()");
544 template <
class Flu
idState>
548 const Scalar temperature = fluidState.temperature(phaseIdx) ;
549 const Scalar pressure = fluidState.pressure(phaseIdx);
552 return H2O::liquidThermalConductivity(temperature, pressure);
560 return H2O::gasThermalConductivity(temperature, pressure);
562 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:77
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient [m^2/s] for molecular water and heavy oil.
Definition h2o_heavyoil.hh:64
static Scalar henryOilInWater(Scalar temperature)
Henry coefficient for heavy oil in liquid water.
Definition h2o_heavyoil.hh:34
static Scalar henryWaterInOil(Scalar temperature)
Henry coefficient for water in liquid heavy oil.
Definition h2o_heavyoil.hh:49
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
Fluid system base class.
Definition fluidsystems/base.hh:32
ScalarType Scalar
Definition fluidsystems/base.hh:35
A compositional fluid system with water and heavy oil components in both the liquid and the gas phase...
Definition h2oheavyoil.hh:37
static Scalar henryCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Henry coefficients of a component in a phase.
Definition h2oheavyoil.hh:389
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition h2oheavyoil.hh:172
static const int gPhaseIdx
Definition h2oheavyoil.hh:50
static std::string componentName(int compIdx)
Return the human readable name of a component (used in indices)
Definition h2oheavyoil.hh:204
static const int wCompIdx
Definition h2oheavyoil.hh:58
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
Calculate the molar density of a fluid phase.
Definition h2oheavyoil.hh:262
static bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition h2oheavyoil.hh:154
static const int numPhases
Definition h2oheavyoil.hh:45
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition h2oheavyoil.hh:117
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Calculate the dynamic viscosity of a fluid phase .
Definition h2oheavyoil.hh:285
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given all mole fractions in a phase, return the specific phase enthalpy .
Definition h2oheavyoil.hh:463
static const int H2OIdx
Definition h2oheavyoil.hh:52
static Scalar partialPressureGas(const FluidState &fluidState, int phaseIdx, int compIdx)
Partial pressures in the gas phase, taken from saturation vapor pressures.
Definition h2oheavyoil.hh:416
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy of a component in a specific phase.
Definition h2oheavyoil.hh:494
static const int nPhaseIdx
Definition h2oheavyoil.hh:49
static Scalar thermalConductivity(const FluidState &fluidState, int phaseIdx)
Thermal conductivity of a fluid phase .
Definition h2oheavyoil.hh:545
H2OType H2O
Definition h2oheavyoil.hh:42
static std::string phaseName(int phaseIdx)
Return the human readable name of a phase (used in indices)
Definition h2oheavyoil.hh:189
static const int numComponents
Definition h2oheavyoil.hh:46
static constexpr int getMainComponent(int phaseIdx)
Get the main component of a given phase.
Definition h2oheavyoil.hh:102
static constexpr bool isGas(int phaseIdx)
Return whether a phase is gaseous.
Definition h2oheavyoil.hh:125
Dumux::Components::HeavyOil< Scalar > HeavyOil
Definition h2oheavyoil.hh:41
static const int NAPLIdx
Definition h2oheavyoil.hh:53
static Scalar molarMass(int compIdx)
Return the molar mass of a component in [kg/mol].
Definition h2oheavyoil.hh:216
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:88
static Scalar density(const FluidState &fluidState, int phaseIdx)
Calculate the density of a fluid phase.
Definition h2oheavyoil.hh:228
static Scalar inverseVaporPressureCurve(const FluidState &fluidState, int phaseIdx, int compIdx)
Inverse vapor pressures, taken from inverse saturation vapor pressures.
Definition h2oheavyoil.hh:437
static const int nCompIdx
Definition h2oheavyoil.hh:59
static bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition h2oheavyoil.hh:137
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx)
Calculate the molecular diffusion coefficient for a component in a fluid phase .
Definition h2oheavyoil.hh:369
static const int wPhaseIdx
Definition h2oheavyoil.hh:48
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:337
static void init()
Initialize the fluid system's static parameters generically.
Definition h2oheavyoil.hh:67
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Specific isobaric heat capacity of a fluid phase .
Definition h2oheavyoil.hh:529
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:964
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
Tabulates all thermodynamic properties of a given untabulated chemical species.