version 3.10-dev
h2on2.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_H2O_N2_FLUID_SYSTEM_HH
13#define DUMUX_H2O_N2_FLUID_SYSTEM_HH
14
15#include <cassert>
16#include <iomanip>
17
19
21
26
27#include <dumux/io/name.hh>
28
29#include "base.hh"
30
31namespace Dumux {
32namespace FluidSystems {
33
38template<bool fastButSimplifiedRelations = false>
40{
41 static constexpr bool useH2ODensityAsLiquidMixtureDensity() { return fastButSimplifiedRelations; }
42 static constexpr bool useIdealGasDensity() { return fastButSimplifiedRelations; }
43 static constexpr bool useN2ViscosityAsGasMixtureViscosity() { return fastButSimplifiedRelations; }
44 static constexpr bool useN2HeatConductivityAsGasMixtureHeatConductivity() { return fastButSimplifiedRelations; }
45 static constexpr bool useIdealGasHeatCapacities() { return fastButSimplifiedRelations; }
46};
47
54template <class Scalar, class Policy = H2ON2DefaultPolicy<>>
55class H2ON2
56 : public Base<Scalar, H2ON2<Scalar, Policy> >
57{
59
60 // convenience aliases using declarations
64
65public:
66 using H2O = TabulatedH2O;
67 using N2 = SimpleN2;
68
69 static constexpr int numPhases = 2;
70 static constexpr int numComponents = 2;
71
72 static constexpr int liquidPhaseIdx = 0;
73 static constexpr int gasPhaseIdx = 1;
74 static constexpr int phase0Idx = liquidPhaseIdx;
75 static constexpr int phase1Idx = gasPhaseIdx;
76
77 static constexpr int H2OIdx = 0;
78 static constexpr int N2Idx = 1;
79 static constexpr int comp0Idx = H2OIdx;
80 static constexpr int comp1Idx = N2Idx;
81 static constexpr int liquidCompIdx = H2OIdx;
82 static constexpr int gasCompIdx = N2Idx;
83
84 /****************************************
85 * Fluid phase related static parameters
86 ****************************************/
92 static std::string phaseName(int phaseIdx)
93 {
94 assert(0 <= phaseIdx && phaseIdx < numPhases);
95 switch (phaseIdx)
96 {
98 case gasPhaseIdx: return IOName::gaseousPhase();
99 }
100 DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
101 }
102
106 static constexpr bool isMiscible()
107 { return true; }
108
114 static constexpr bool isGas(int phaseIdx)
115 {
116 assert(0 <= phaseIdx && phaseIdx < numPhases);
117 return phaseIdx == gasPhaseIdx;
118 }
119
134 static bool isIdealMixture(int phaseIdx)
135 {
136 assert(0 <= phaseIdx && phaseIdx < numPhases);
137 // we assume Henry's and Raoult's laws for the water phase and
138 // and no interaction between gas molecules of different
139 // components, so all phases are ideal mixtures!
140 return true;
141 }
142
152 static constexpr bool isCompressible(int phaseIdx)
153 {
154 assert(0 <= phaseIdx && phaseIdx < numPhases);
155 // gases are always compressible
156 if (phaseIdx == gasPhaseIdx)
157 return true;
158 // the water component decides for the liquid phase...
160 }
161
168 static bool isIdealGas(int phaseIdx)
169 {
170 assert(0 <= phaseIdx && phaseIdx < numPhases);
171
172 if (phaseIdx == gasPhaseIdx)
173 // let the components decide
174 return H2O::gasIsIdeal() && N2::gasIsIdeal();
175 return false; // not a gas
176 }
177
178 /****************************************
179 * Component related static parameters
180 ****************************************/
186 static std::string componentName(int compIdx)
187 {
188 switch (compIdx)
189 {
190 case H2OIdx: return H2O::name();
191 case N2Idx: return N2::name();
192 }
193
194 DUNE_THROW(Dune::InvalidStateException, "Invalid component index " << compIdx);
195 }
196
202 static Scalar molarMass(int compIdx)
203 {
204 static const Scalar M[] = {
207 };
208
209 assert(0 <= compIdx && compIdx < numComponents);
210 return M[compIdx];
211 }
212
218 static Scalar criticalTemperature(int compIdx)
219 {
220 static const Scalar Tcrit[] = {
223 };
224
225 assert(0 <= compIdx && compIdx < numComponents);
226 return Tcrit[compIdx];
227 }
228
234 static Scalar criticalPressure(int compIdx)
235 {
236 static const Scalar pcrit[] = {
239 };
240
241 assert(0 <= compIdx && compIdx < numComponents);
242 return pcrit[compIdx];
243 }
244
254 template <class FluidState>
255 static Scalar kelvinVaporPressure(const FluidState &fluidState,
256 const int phaseIdx,
257 const int compIdx)
258 {
259 assert(compIdx == H2OIdx && phaseIdx == liquidPhaseIdx);
260
261 using std::exp;
262 return fugacityCoefficient(fluidState, phaseIdx, compIdx)
263 * fluidState.pressure(phaseIdx)
264 * exp(-(fluidState.pressure(gasPhaseIdx)-fluidState.pressure(liquidPhaseIdx))
265 / density(fluidState, phaseIdx)
267 / fluidState.temperature());
268 }
269
275 static Scalar criticalMolarVolume(int compIdx)
276 {
277 DUNE_THROW(Dune::NotImplemented,
278 "H2ON2FluidSystem::criticalMolarVolume()");
279 }
280
286 static Scalar acentricFactor(int compIdx)
287 {
288 static const Scalar accFac[] = {
289 H2O::acentricFactor(),
290 N2::acentricFactor()
291 };
292
293 assert(0 <= compIdx && compIdx < numComponents);
294 return accFac[compIdx];
295 }
296
297 /****************************************
298 * thermodynamic relations
299 ****************************************/
300
307 static void init()
308 {
309 init(/*tempMin=*/273.15,
310 /*tempMax=*/623.15,
311 /*numTemp=*/100,
312 /*pMin=*/0.0,
313 /*pMax=*/20e6,
314 /*numP=*/200);
315 }
316
328 static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp,
329 Scalar pressMin, Scalar pressMax, unsigned nPress)
330 {
331 std::cout << "The H2O-N2 fluid system was configured with the following policy:\n";
332 std::cout << " - use H2O density as liquid mixture density: " << std::boolalpha << Policy::useH2ODensityAsLiquidMixtureDensity() << "\n";
333 std::cout << " - use ideal gas density: " << std::boolalpha << Policy::useIdealGasDensity() << "\n";
334 std::cout << " - use N2 viscosity as gas mixture viscosity: " << std::boolalpha << Policy::useN2ViscosityAsGasMixtureViscosity() << "\n";
335 std::cout << " - use N2 heat conductivity as gas mixture heat conductivity: " << std::boolalpha << Policy::useN2HeatConductivityAsGasMixtureHeatConductivity() << "\n";
336 std::cout << " - use ideal gas heat capacities: " << std::boolalpha << Policy::useIdealGasHeatCapacities() << std::endl;
337
338 if constexpr (H2O::isTabulated)
339 H2O::init(tempMin, tempMax, nTemp, pressMin, pressMax, nPress);
340 }
341
355 template <class FluidState>
356 static Scalar density(const FluidState &fluidState,
357 int phaseIdx)
358 {
359 assert(0 <= phaseIdx && phaseIdx < numPhases);
360
361 Scalar T = fluidState.temperature(phaseIdx);
362 Scalar p = fluidState.pressure(phaseIdx);
363
364 // liquid phase
365 if (phaseIdx == liquidPhaseIdx) {
366 if (Policy::useH2ODensityAsLiquidMixtureDensity())
367 // assume pure water
368 return H2O::liquidDensity(T, p);
369 else
370 {
371 // See: Eq. (7) in Class et al. (2002a)
372 // This assumes each gas molecule displaces exactly one
373 // molecule in the liquid.
374 return H2O::liquidMolarDensity(T, p)
375 * (H2O::molarMass()*fluidState.moleFraction(liquidPhaseIdx, H2OIdx)
376 + N2::molarMass()*fluidState.moleFraction(liquidPhaseIdx, N2Idx));
377 }
378 }
379
380 // gas phase
381 using std::max;
382 if (Policy::useIdealGasDensity())
383 // for the gas phase assume an ideal gas
384 {
385 const Scalar averageMolarMass = fluidState.averageMolarMass(gasPhaseIdx);
386 return IdealGas::density(averageMolarMass, T, p);
387 }
388
389 // assume ideal mixture: steam and nitrogen don't "see" each other
390 Scalar rho_gH2O = H2O::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, H2OIdx));
391 Scalar rho_gN2 = N2::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, N2Idx));
392 return (rho_gH2O + rho_gN2);
393 }
394
397 template <class FluidState>
398 static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
399 {
400 assert(0 <= phaseIdx && phaseIdx < numPhases);
401
402 Scalar T = fluidState.temperature(phaseIdx);
403 Scalar p = fluidState.pressure(phaseIdx);
404
405 // liquid phase
406 if (phaseIdx == liquidPhaseIdx)
407 {
408 // assume pure water or that each gas molecule displaces exactly one
409 // molecule in the liquid.
410 return H2O::liquidMolarDensity(T, p);
411 }
412
413 // gas phase
414 using std::max;
415 if (Policy::useIdealGasDensity())
416 // for the gas phase assume an ideal gas
417 {
418 return IdealGas::molarDensity(T, p);
419 }
420
421 // assume ideal mixture: steam and nitrogen don't "see" each other
422 Scalar rho_gH2O = H2O::gasMolarDensity(T, fluidState.partialPressure(gasPhaseIdx, H2OIdx));
423 Scalar rho_gN2 = N2::gasMolarDensity(T, fluidState.partialPressure(gasPhaseIdx, N2Idx));
424 return rho_gH2O + rho_gN2;
425 }
426
440 template <class FluidState>
441 static Scalar viscosity(const FluidState &fluidState,
442 int phaseIdx)
443 {
444 assert(0 <= phaseIdx && phaseIdx < numPhases);
445
446 Scalar T = fluidState.temperature(phaseIdx);
447 Scalar p = fluidState.pressure(phaseIdx);
448
449 // liquid phase
450 if (phaseIdx == liquidPhaseIdx) {
451 // assume pure water for the liquid phase
452 return H2O::liquidViscosity(T, p);
453 }
454
455 // gas phase
456 if (Policy::useN2ViscosityAsGasMixtureViscosity())
457 {
458 // assume pure nitrogen for the gas phase
459 return N2::gasViscosity(T, p);
460 }
461 else
462 {
463 // Wilke method (Reid et al.):
464 Scalar muResult = 0;
465 const Scalar mu[numComponents] = {
467 N2::gasViscosity(T, p)
468 };
469
470 Scalar sumx = 0.0;
471 using std::max;
472 for (int compIdx = 0; compIdx < numComponents; ++compIdx)
473 sumx += fluidState.moleFraction(phaseIdx, compIdx);
474 sumx = max(1e-10, sumx);
475
476 for (int i = 0; i < numComponents; ++i) {
477 Scalar divisor = 0;
478// using std::sqrt;
479// using std::pow;
480 for (int j = 0; j < numComponents; ++j) {
481 Scalar phiIJ = 1 + sqrt(mu[i]/mu[j]) * pow(molarMass(j)/molarMass(i), 1/4.0);
482 phiIJ *= phiIJ;
483 phiIJ /= sqrt(8*(1 + molarMass(i)/molarMass(j)));
484 divisor += fluidState.moleFraction(phaseIdx, j)/sumx * phiIJ;
485 }
486 muResult += fluidState.moleFraction(phaseIdx, i)/sumx * mu[i] / divisor;
487 }
488
489 return muResult;
490 }
491 }
492
495 template <class FluidState>
496 static Scalar fugacityCoefficient(const FluidState &fluidState,
497 int phaseIdx,
498 int compIdx)
499 {
500 assert(0 <= phaseIdx && phaseIdx < numPhases);
501 assert(0 <= compIdx && compIdx < numComponents);
502
503 Scalar T = fluidState.temperature(phaseIdx);
504 Scalar p = fluidState.pressure(phaseIdx);
505
506 // liquid phase
507 if (phaseIdx == liquidPhaseIdx) {
508 if (compIdx == H2OIdx)
509 return H2O::vaporPressure(T)/p;
510 return BinaryCoeff::H2O_N2::henry(T)/p;
511 }
512
513 // for the gas phase, assume an ideal gas when it comes to
514 // fugacity (-> fugacity == partial pressure)
515 return 1.0;
516 }
517
520 template <class FluidState>
521 static Scalar diffusionCoefficient(const FluidState &fluidState,
522 int phaseIdx,
523 int compIdx)
524 {
525 DUNE_THROW(Dune::NotImplemented, "Diffusion coefficients");
526 }
527
530 template <class FluidState>
531 static Scalar binaryDiffusionCoefficient(const FluidState &fluidState,
532 int phaseIdx,
533 int compIIdx,
534 int compJIdx)
535
536 {
537 if (compIIdx > compJIdx)
538 {
539 using std::swap;
540 swap(compIIdx, compJIdx);
541 }
542
543 const Scalar T = fluidState.temperature(phaseIdx);
544 const Scalar p = fluidState.pressure(phaseIdx);
545
546 if (phaseIdx == liquidPhaseIdx && compIIdx == H2OIdx && compJIdx == N2Idx)
548
549 else if (phaseIdx == gasPhaseIdx && compIIdx == H2OIdx && compJIdx == N2Idx)
551
552 else
553 DUNE_THROW(Dune::InvalidStateException,
554 "Binary diffusion coefficient of components "
555 << compIIdx << " and " << compJIdx
556 << " in phase " << phaseIdx << " is unavailable!\n");
557 }
558
572 template <class FluidState>
573 static Scalar enthalpy(const FluidState &fluidState,
574 int phaseIdx)
575 {
576 const Scalar T = fluidState.temperature(phaseIdx);
577 const Scalar p = fluidState.pressure(phaseIdx);
578
579 // liquid phase
580 if (phaseIdx == liquidPhaseIdx) {
581 return H2O::liquidEnthalpy(T, p);
582 }
583 // gas phase
584 else {
585 // assume ideal mixture: which means
586 // that the total specific enthalpy is the sum of the
587 // "partial specific enthalpies" of the components.
588 Scalar hH2O =
589 fluidState.massFraction(gasPhaseIdx, H2OIdx)
590 * H2O::gasEnthalpy(T, p);
591 Scalar hN2 =
592 fluidState.massFraction(gasPhaseIdx, N2Idx)
593 * N2::gasEnthalpy(T, p);
594 return hH2O + hN2;
595 }
596 }
597
604 template <class FluidState>
605 static Scalar componentEnthalpy(const FluidState &fluidState,
606 int phaseIdx,
607 int componentIdx)
608 {
609 const Scalar T = fluidState.temperature(phaseIdx);
610 const Scalar p = fluidState.pressure(phaseIdx);
611
612 if (phaseIdx == liquidPhaseIdx)
613 {
614 if (componentIdx == H2OIdx)
615 return H2O::liquidEnthalpy(T, p);
616 else if (componentIdx == N2Idx)
617 DUNE_THROW(Dune::NotImplemented, "Component enthalpy of nitrogen in liquid phase");
618 else
619 DUNE_THROW(Dune::InvalidStateException, "Invalid component index " << componentIdx);
620 }
621 else if (phaseIdx == gasPhaseIdx)
622 {
623 if (componentIdx == H2OIdx)
624 return H2O::gasEnthalpy(T, p);
625 else if (componentIdx == N2Idx)
626 return N2::gasEnthalpy(T, p);
627 else
628 DUNE_THROW(Dune::InvalidStateException, "Invalid component index " << componentIdx);
629 }
630 else
631 DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
632 }
633
643 template <class FluidState>
644 static Scalar thermalConductivity(const FluidState &fluidState,
645 const int phaseIdx)
646 {
647 assert(0 <= phaseIdx && phaseIdx < numPhases);
648
649 const Scalar temperature = fluidState.temperature(phaseIdx) ;
650 const Scalar pressure = fluidState.pressure(phaseIdx);
651 if (phaseIdx == liquidPhaseIdx)
652 {
654 }
655 else
656 {
658 if (!Policy::useN2HeatConductivityAsGasMixtureHeatConductivity())
659 {
660 Scalar xN2 = fluidState.moleFraction(phaseIdx, N2Idx);
661 Scalar xH2O = fluidState.moleFraction(phaseIdx, H2OIdx);
662 Scalar lambdaN2 = xN2 * lambdaPureN2;
663 Scalar partialPressure = pressure * xH2O;
664 Scalar lambdaH2O = xH2O * H2O::gasThermalConductivity(temperature, partialPressure);
665 return lambdaN2 + lambdaH2O;
666 }
667 else
668 return lambdaPureN2;
669 }
670 }
671
674 template <class FluidState>
675 static Scalar heatCapacity(const FluidState &fluidState,
676 int phaseIdx)
677 {
678 if (phaseIdx == liquidPhaseIdx) {
679 return H2O::liquidHeatCapacity(fluidState.temperature(phaseIdx),
680 fluidState.pressure(phaseIdx));
681 }
682
683 // for the gas phase, assume ideal mixture
684 Scalar c_pN2;
685 Scalar c_pH2O;
686 // let the water and nitrogen components do things their own way
687 if (!Policy::useIdealGasHeatCapacities()) {
688 c_pN2 = N2::gasHeatCapacity(fluidState.temperature(phaseIdx),
689 fluidState.pressure(phaseIdx)
690 * fluidState.moleFraction(phaseIdx, N2Idx));
691
692 c_pH2O = H2O::gasHeatCapacity(fluidState.temperature(phaseIdx),
693 fluidState.pressure(phaseIdx)
694 * fluidState.moleFraction(phaseIdx, H2OIdx));
695 }
696 else {
697 // assume an ideal gas for both components. See:
698 // http://en.wikipedia.org/wiki/Heat_capacity
699 Scalar c_vN2molar = Constants<Scalar>::R*2.39;
700 Scalar c_pN2molar = Constants<Scalar>::R + c_vN2molar;
701
702 Scalar c_vH2Omolar = Constants<Scalar>::R*3.37; // <- correct??
703 Scalar c_pH2Omolar = Constants<Scalar>::R + c_vH2Omolar;
704
705 c_pN2 = c_pN2molar/molarMass(N2Idx);
706 c_pH2O = c_pH2Omolar/molarMass(H2OIdx);
707 }
708
709 // mangle both components together
710 return c_pH2O*fluidState.massFraction(gasPhaseIdx, H2OIdx)
711 + c_pN2*fluidState.massFraction(gasPhaseIdx, N2Idx);
712 }
713};
714
715} // end namespace FluidSystems
716
717} // end namespace Dumux
718
719#endif
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient for molecular nitrogen in liquid water.
Definition: h2o_n2.hh:85
static Scalar henry(Scalar temperature)
Henry coefficient for molecular nitrogen in liquid water.
Definition: h2o_n2.hh:36
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for molecular water and nitrogen.
Definition: h2o_n2.hh:54
Properties of pure molecular nitrogen .
Definition: n2.hh:36
static Scalar criticalTemperature()
Returns the critical temperature of molecular nitrogen.
Definition: n2.hh:57
static Scalar criticalPressure()
Returns the critical pressure of molecular nitrogen.
Definition: n2.hh:63
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of at a given pressure and temperature.
Definition: n2.hh:221
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of gas in at a given pressure and temperature.
Definition: n2.hh:134
static std::string name()
A human readable name for nitrogen.
Definition: n2.hh:45
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of gas at a given pressure and temperature.
Definition: n2.hh:121
static constexpr Scalar molarMass()
The molar mass in of molecular nitrogen.
Definition: n2.hh:51
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of nitrogen.
Definition: n2.hh:259
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: n2.hh:146
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of pure nitrogen gas. Shomate Equation is used for a temperature range of 100K to ...
Definition: n2.hh:168
static const Scalar gasHeatCapacity(Scalar T, Scalar pressure)
Specific isobaric heat capacity of pure nitrogen gas. Shomate Equation is used for a temperature ran...
Definition: n2.hh:201
Tabulates all thermodynamic properties of a given component.
Definition: tabulatedcomponent.hh:672
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of the gas .
Definition: tabulatedcomponent.hh:817
static Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition: tabulatedcomponent.hh:763
static const Scalar gasHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the gas .
Definition: tabulatedcomponent.hh:853
static std::string name()
A human readable name for the component.
Definition: tabulatedcomponent.hh:751
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
The thermal conductivity of liquid water .
Definition: tabulatedcomponent.hh:1081
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of gas at a given pressure and temperature .
Definition: tabulatedcomponent.hh:967
static const Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of the liquid .
Definition: tabulatedcomponent.hh:835
static Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition: tabulatedcomponent.hh:769
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of liquid in at a given pressure and temperature.
Definition: tabulatedcomponent.hh:1018
static constexpr Scalar molarMass()
The molar mass in of the component.
Definition: tabulatedcomponent.hh:757
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of liquid.
Definition: tabulatedcomponent.hh:1045
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition: tabulatedcomponent.hh:950
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of liquid at a given pressure and temperature .
Definition: tabulatedcomponent.hh:997
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
The thermal conductivity of gaseous water .
Definition: tabulatedcomponent.hh:1063
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of gas in at a given pressure and temperature.
Definition: tabulatedcomponent.hh:987
static constexpr bool isTabulated
state that we are tabulated
Definition: tabulatedcomponent.hh:716
static Scalar vaporPressure(Scalar T)
The vapor pressure in of the component at a given temperature.
Definition: tabulatedcomponent.hh:790
static void init(Scalar tempMin, Scalar tempMax, std::size_t nTemp, Scalar pressMin, Scalar pressMax, std::size_t nPress)
Initialize the tables.
Definition: tabulatedcomponent.hh:728
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: tabulatedcomponent.hh:956
static const Scalar liquidHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the liquid .
Definition: tabulatedcomponent.hh:871
A central place for various physical constants occurring in some equations.
Definition: constants.hh:27
Fluid system base class.
Definition: fluidsystems/base.hh:33
Scalar Scalar
export the scalar type
Definition: fluidsystems/base.hh:36
A two-phase fluid system with two components water Nitrogen for non-equilibrium models.
Definition: h2on2.hh:57
static constexpr bool isGas(int phaseIdx)
Return whether a phase is gaseous.
Definition: h2on2.hh:114
static constexpr int liquidPhaseIdx
index of the liquid phase
Definition: h2on2.hh:72
static bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: h2on2.hh:134
static Scalar molarMass(int compIdx)
Return the molar mass of a component in .
Definition: h2on2.hh:202
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Specific isobaric heat capacity of a fluid phase .
Definition: h2on2.hh:675
static Scalar thermalConductivity(const FluidState &fluidState, const int phaseIdx)
Thermal conductivity of a fluid phase .
Definition: h2on2.hh:644
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: h2on2.hh:531
static constexpr int phase1Idx
index of the second phase
Definition: h2on2.hh:75
static constexpr int liquidCompIdx
index of the liquid component
Definition: h2on2.hh:81
static Scalar criticalMolarVolume(int compIdx)
Molar volume of a component at the critical point .
Definition: h2on2.hh:275
static constexpr int N2Idx
Definition: h2on2.hh:78
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: h2on2.hh:152
static constexpr int comp1Idx
index of the second component
Definition: h2on2.hh:80
static constexpr int gasPhaseIdx
index of the gas phase
Definition: h2on2.hh:73
static std::string componentName(int compIdx)
Return the human readable name of a component.
Definition: h2on2.hh:186
static constexpr int H2OIdx
Definition: h2on2.hh:77
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: h2on2.hh:328
static void init()
Initialize the fluid system's static parameters generically.
Definition: h2on2.hh:307
static constexpr int comp0Idx
index of the first component
Definition: h2on2.hh:79
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy of a component in the specified phase.
Definition: h2on2.hh:605
static Scalar acentricFactor(int compIdx)
The acentric factor of a component .
Definition: h2on2.hh:286
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the fugacity coefficient of an individual component in a fluid phase.
Definition: h2on2.hh:496
static constexpr int phase0Idx
index of the first phase
Definition: h2on2.hh:74
static Scalar density(const FluidState &fluidState, int phaseIdx)
Given a phase's composition, temperature, pressure, and the partial pressures of all components,...
Definition: h2on2.hh:356
static Scalar kelvinVaporPressure(const FluidState &fluidState, const int phaseIdx, const int compIdx)
Vapor pressure including the Kelvin equation in .
Definition: h2on2.hh:255
static Scalar criticalPressure(int compIdx)
Critical pressure of a component .
Definition: h2on2.hh:234
static constexpr int numComponents
Number of components in the fluid system.
Definition: h2on2.hh:70
static constexpr int numPhases
Number of phases in the fluid system.
Definition: h2on2.hh:69
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition: h2on2.hh:106
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
Calculate the molar density of a fluid phase.
Definition: h2on2.hh:398
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy .
Definition: h2on2.hh:573
static constexpr int gasCompIdx
index of the gas component
Definition: h2on2.hh:82
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase .
Definition: h2on2.hh:521
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Calculate the dynamic viscosity of a fluid phase .
Definition: h2on2.hh:441
static bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: h2on2.hh:168
static Scalar criticalTemperature(int compIdx)
Critical temperature of a component .
Definition: h2on2.hh:218
static std::string phaseName(int phaseIdx)
Return the human readable name of a fluid phase.
Definition: h2on2.hh:92
Relations valid for an ideal gas.
Definition: idealgas.hh:25
static constexpr Scalar density(Scalar avgMolarMass, Scalar temperature, Scalar pressure)
The density of the gas in , depending on pressure, temperature and average molar mass of the gas.
Definition: idealgas.hh:37
static constexpr Scalar molarDensity(Scalar temperature, Scalar pressure)
The molar density of the gas , depending on pressure and temperature.
Definition: idealgas.hh:58
Some exceptions thrown in DuMux
Fluid system base class.
Material properties of pure water .
Binary coefficients for water and nitrogen.
Relations valid for an ideal gas.
Properties of pure molecular nitrogen .
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 liquidPhase() noexcept
I/O name of liquid phase.
Definition: name.hh:107
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:22
Definition: adapt.hh:17
Policy for the H2O-N2 fluid system.
Definition: h2on2.hh:40
static constexpr bool useIdealGasHeatCapacities()
Definition: h2on2.hh:45
static constexpr bool useN2HeatConductivityAsGasMixtureHeatConductivity()
Definition: h2on2.hh:44
static constexpr bool useIdealGasDensity()
Definition: h2on2.hh:42
static constexpr bool useH2ODensityAsLiquidMixtureDensity()
Definition: h2on2.hh:41
static constexpr bool useN2ViscosityAsGasMixtureViscosity()
Definition: h2on2.hh:43
Tabulates all thermodynamic properties of a given untabulated chemical species.