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));
340 H2O::gasViscosity(fluidState.temperature(phaseIdx), H2O::vaporPressure(fluidState.temperature(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 "
410 template <
class Flu
idState>
420 DUNE_THROW(Dune::InvalidStateException,
421 "Non-existent diffusion coefficient for phase index "<< phaseIdx);
427 template <
class Flu
idState>
432 assert(0 <= phaseIdx && phaseIdx <
numPhases);
435 const Scalar T = fluidState.temperature(phaseIdx);
444 DUNE_THROW(Dune::InvalidStateException,
"non-existent henry coefficient for phase index " << phaseIdx
445 <<
" and component index " << compIdx);
451 template <
class Flu
idState>
457 const Scalar T = fluidState.temperature(phaseIdx);
460 else if (compIdx ==
H2OIdx)
461 return H2O::vaporPressure(T);
463 DUNE_THROW(Dune::InvalidStateException,
"non-existent component index " << compIdx);
469 template <
class Flu
idState>
479 else if (compIdx ==
H2OIdx)
480 return H2O::vaporTemperature(
pressure);
482 DUNE_THROW(Dune::InvalidStateException,
"non-existent component index " << compIdx);
495 template <
class Flu
idState>
500 return H2O::liquidEnthalpy(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx));
507 fluidState.pressure(phaseIdx));
508 Scalar hgw = H2O::gasEnthalpy(fluidState.temperature(phaseIdx),
509 fluidState.pressure(phaseIdx));
517 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
526 template <
class Flu
idState>
529 const Scalar T = fluidState.temperature(phaseIdx);
530 const Scalar p = fluidState.pressure(phaseIdx);
534 if (componentIdx ==
H2OIdx)
535 return H2O::liquidEnthalpy(T, p);
536 else if (componentIdx ==
NAPLIdx)
537 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for NAPL in water is not implemented.");
538 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
542 if (componentIdx ==
H2OIdx)
543 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for water in NAPL is not implemented.");
544 else if (componentIdx ==
NAPLIdx)
546 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
550 if (componentIdx ==
H2OIdx)
551 return H2O::gasEnthalpy(T, p);
552 else if (componentIdx ==
NAPLIdx)
554 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
556 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
560 template <
class Flu
idState>
564 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2ONAPL::heatCapacity()");
576 template <
class Flu
idState>
594 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.
make the local view function available whenever we use the grid geometry
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 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
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:48
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of pure heavyoil.
Definition: heavyoil.hh:439
static constexpr Scalar molarMass()
The molar mass in of heavyoil.
Definition: heavyoil.hh:61
static Scalar vaporPressure(Scalar temperature)
The saturation vapor pressure in of.
Definition: heavyoil.hh:229
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: heavyoil.hh:392
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure heavyoil in at a given pressure and temperature.
Definition: heavyoil.hh:380
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 vaporTemperature(Scalar pressure)
Definition: heavyoil.hh:241
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of heavy oil.
Definition: heavyoil.hh:479
static Scalar gasViscosity(Scalar temperature, Scalar pressure, bool regularize=true)
The dynamic viscosity of heavyoil vapor.
Definition: heavyoil.hh:408
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:398
static Scalar liquidEnthalpy(const Scalar temperature, const Scalar pressure)
Specific enthalpy of liquid heavyoil .
Definition: heavyoil.hh:259
static std::string name()
A human readable name for heavyoil.
Definition: heavyoil.hh:55
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:428
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:496
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:452
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy of a component in a specific phase.
Definition: h2oheavyoil.hh:527
static const int nPhaseIdx
Definition: h2oheavyoil.hh:63
static Scalar thermalConductivity(const FluidState &fluidState, int phaseIdx)
Definition: h2oheavyoil.hh:577
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:470
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:411
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:561