24#ifndef DUMUX_PURE_WATER_FLUID_SYSTEM_HH
25#define DUMUX_PURE_WATER_FLUID_SYSTEM_HH
49template <
class Scalar>
51 :
public Base<Scalar, CombustionFluidsystem<Scalar> >
89 assert(0 <= phaseIdx && phaseIdx <
numPhases);
95 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
103 static constexpr bool isGas(
int phaseIdx)
105 assert(0 <= phaseIdx && phaseIdx <
numPhases);
125 assert(0 <= phaseIdx && phaseIdx <
numPhases);
143 assert(0 <= phaseIdx && phaseIdx <
numPhases);
159 assert(0 <= phaseIdx && phaseIdx <
numPhases);
190 static std::string name[] = {
196 return name[compIdx];
206 static const Scalar M[] = {
222 static const Scalar Tcrit[] = {
228 return Tcrit[compIdx];
238 static const Scalar pcrit[] = {
244 return pcrit[compIdx];
254 DUNE_THROW(Dune::NotImplemented,
"criticalMolarVolume()");
264 static const Scalar accFac[] = {
265 H2O::acentricFactor(),
270 return accFac[compIdx];
307 std::cout <<
"Using very simple pure water fluid system\n";
317 template <
class Flu
idState>
321 assert(0 <= phaseIdx && phaseIdx <
numPhases);
332 else DUNE_THROW(Dune::NotImplemented,
"Wrong phase index");
342 template <
class Flu
idState>
347 return density(fluidState, phaseIdx)/fluidState.averageMolarMass(phaseIdx);
351 return density(fluidState, phaseIdx)/fluidState.averageMolarMass(phaseIdx);
353 else DUNE_THROW(Dune::NotImplemented,
"Wrong phase index");
363 template <
class Flu
idState>
367 assert(0 <= phaseIdx && phaseIdx <
numPhases);
372 return 2.694e-7 *
density(fluidState, phaseIdx);
376 return 7.16e-6 *
density(fluidState, phaseIdx);
378 else DUNE_THROW(Dune::NotImplemented,
"Wrong phase index");
387 template <
class Flu
idState>
389 const unsigned int phaseIdx)
391 assert(0 <= phaseIdx && phaseIdx <
numPhases);
425 template <
class Flu
idState>
430 assert(0 <= phaseIdx && phaseIdx <
numPhases);
433 Scalar T = fluidState.temperature(phaseIdx);
434 Scalar p = fluidState.pressure(phaseIdx);
458 template <
class Flu
idState>
463 DUNE_THROW(Dune::NotImplemented,
"Diffusion coefficients");
477 template <
class Flu
idState>
484 DUNE_THROW(Dune::NotImplemented,
"Binary Diffusion coefficients");
494 template <
class Flu
idState>
498 assert(0 <= phaseIdx && phaseIdx <
numPhases);
499 Scalar temperature = fluidState.temperature(phaseIdx);
506 return cp * (temperature - 373.15);
510 return cp * (temperature - 373.15) + 2.257e6;
512 else DUNE_THROW(Dune::NotImplemented,
"Wrong phase index");
524 template <
class Flu
idState>
528 assert(0 <= phaseIdx && phaseIdx <
numPhases);
538 else DUNE_THROW(Dune::NotImplemented,
"Wrong phase index");
549 template <
class Flu
idState>
553 assert(0 <= phaseIdx && phaseIdx <
numPhases);
563 else DUNE_THROW(Dune::NotImplemented,
"Wrong phase index");
Some exceptions thrown in DuMux.
Some templates to wrap the valgrind macros.
Binary coefficients for water and nitrogen.
Properties of pure molecular nitrogen .
A much simpler (and thus potentially less buggy) version of pure water.
Relations valid for an ideal gas.
make the local view function available whenever we use the grid geometry
Definition adapt.hh:29
Definition 1padapter.hh:35
static Scalar henry(Scalar temperature)
Henry coefficient for molecular nitrogen in liquid water.
Definition h2o_n2.hh:48
static Scalar vaporTemperature(Scalar pressure)
Returns the saturation temperature in of pure water at a given pressure.
Definition region4.hh:94
Properties of pure molecular nitrogen .
Definition n2.hh:47
static Scalar criticalTemperature()
Returns the critical temperature of molecular nitrogen.
Definition n2.hh:66
static Scalar criticalPressure()
Returns the critical pressure of molecular nitrogen.
Definition n2.hh:72
static std::string name()
A human readable name for nitrogen.
Definition n2.hh:54
static constexpr Scalar molarMass()
The molar mass in of molecular nitrogen.
Definition n2.hh:60
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition n2.hh:155
A much simpler (and thus potentially less buggy) version of pure water.
Definition simpleh2o.hh:51
static Scalar criticalTemperature()
Returns the critical temperature of water.
Definition simpleh2o.hh:72
static std::string name()
A human readable name for the water.
Definition simpleh2o.hh:60
static Scalar criticalPressure()
Returns the critical pressure of water.
Definition simpleh2o.hh:78
static constexpr Scalar molarMass()
The molar mass in of water.
Definition simpleh2o.hh:66
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition simpleh2o.hh:198
static Scalar vaporPressure(Scalar T)
The vapor pressure in of pure water at a given temperature.
Definition simpleh2o.hh:105
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition simpleh2o.hh:238
Fluid system base class.
Definition fluidsystems/base.hh:45
Scalar Scalar
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
Relations valid for an ideal gas.
Definition idealgas.hh:37
A two-phase fluid system with water as sole component.
Definition combustionfluidsystem.hh:52
static std::string phaseName(int phaseIdx)
Returns the human readable name of a fluid phase.
Definition combustionfluidsystem.hh:87
static Scalar criticalPressure(int compIdx)
Critical pressure of a component .
Definition combustionfluidsystem.hh:236
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Specific isobaric heat capacity of a fluid phase. .
Definition combustionfluidsystem.hh:550
static void init()
Initializes the fluid system's static parameters generically.
Definition combustionfluidsystem.hh:283
static constexpr int numPhases
Definition combustionfluidsystem.hh:67
static constexpr int nPhaseIdx
Definition combustionfluidsystem.hh:70
static constexpr int comp0Idx
Definition combustionfluidsystem.hh:79
static constexpr int nCompIdx
Definition combustionfluidsystem.hh:78
static bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition combustionfluidsystem.hh:123
static constexpr int H2OIdx
Definition combustionfluidsystem.hh:174
static constexpr int comp1Idx
Definition combustionfluidsystem.hh:80
static constexpr int phase0Idx
Definition combustionfluidsystem.hh:71
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition combustionfluidsystem.hh:141
static Scalar acentricFactor(int compIdx)
The acentric factor of a component .
Definition combustionfluidsystem.hh:262
static Scalar criticalMolarVolume(int compIdx)
Molar volume of a component at the critical point .
Definition combustionfluidsystem.hh:252
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculates the fugacity coefficient of an individual component in a fluid phase.
Definition combustionfluidsystem.hh:426
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculates the molecular diffusion coefficient for a component in a fluid phase .
Definition combustionfluidsystem.hh:459
static Scalar binaryDiffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIIdx, int compJIdx)
Given a phase's composition, temperature and pressure, returns the binary diffusion coefficient for ...
Definition combustionfluidsystem.hh:478
static Scalar criticalTemperature(int compIdx)
Critical temperature of a component .
Definition combustionfluidsystem.hh:220
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Calculates specific enthalpy .
Definition combustionfluidsystem.hh:495
static constexpr int phase1Idx
Definition combustionfluidsystem.hh:72
static constexpr int N2Idx
Definition combustionfluidsystem.hh:175
static Scalar thermalConductivity(const FluidState &fluidState, const int phaseIdx)
Thermal conductivity of a fluid phase .
Definition combustionfluidsystem.hh:525
static constexpr int wPhaseIdx
Definition combustionfluidsystem.hh:69
SimpleH2O H2O
The components for pure water.
Definition combustionfluidsystem.hh:178
static Scalar molarMass(int compIdx)
Returns the molar mass of a component in .
Definition combustionfluidsystem.hh:204
static constexpr bool isGas(int phaseIdx)
Returns whether a phase is gaseous.
Definition combustionfluidsystem.hh:103
static Scalar density(const FluidState &fluidState, int phaseIdx)
Calculates the density of a fluid phase.
Definition combustionfluidsystem.hh:318
static constexpr int wCompIdx
Definition combustionfluidsystem.hh:77
static std::string componentName(int compIdx)
Returns the human readable name of a component.
Definition combustionfluidsystem.hh:188
static constexpr int numComponents
Definition combustionfluidsystem.hh:172
static Scalar vaporTemperature(const FluidState &fluidState, const unsigned int phaseIdx)
Calculates the temperature of vapor at a given pressure on the vapor pressure curve.
Definition combustionfluidsystem.hh:388
static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, Scalar pressMin, Scalar pressMax, unsigned nPress)
Initializes the fluid system's static parameters using problem specific temperature and pressure rang...
Definition combustionfluidsystem.hh:304
SimpleN2 N2
The components for pure nitrogen.
Definition combustionfluidsystem.hh:181
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
The molar density of a fluid phase in .
Definition combustionfluidsystem.hh:343
static bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition combustionfluidsystem.hh:157
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Calculates the dynamic viscosity of a fluid phase .
Definition combustionfluidsystem.hh:364