version 3.10-dev
h2on2o2.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//
7
13#ifndef DUMUX_H2O_N2_O2_FLUID_SYSTEM_HH
14#define DUMUX_H2O_N2_O2_FLUID_SYSTEM_HH
15
16#include <cassert>
17#include <iomanip>
18
20
24
28
33
34#include <dumux/io/name.hh>
35
36namespace Dumux {
37namespace FluidSystems {
42template<bool fastButSimplifiedRelations = false>
44{
45 static constexpr bool useH2ODensityAsLiquidMixtureDensity() { return fastButSimplifiedRelations; }
46 static constexpr bool useIdealGasDensity() { return fastButSimplifiedRelations; }
47 static constexpr bool useN2ViscosityAsGasMixtureViscosity() { return fastButSimplifiedRelations; }
48 static constexpr bool useN2HeatConductivityAsGasMixtureHeatConductivity() { return fastButSimplifiedRelations; }
49 static constexpr bool useIdealGasHeatCapacities() { return fastButSimplifiedRelations; }
50};
51
62template <class Scalar, class Policy = H2ON2O2DefaultPolicy<>>
64 : public Base<Scalar, H2ON2O2<Scalar, Policy> >
65{
67
73
75 using H2O = TabulatedH2O;
76
78 using N2 = SimpleN2;
79
80public:
81 static constexpr int numPhases = 2;
82 static constexpr int numComponents = 3;
83 static constexpr int numSPhases = 0; // TODO: Remove
84
85 static constexpr int liquidPhaseIdx = 0;
86 static constexpr int gasPhaseIdx = 1;
87 static constexpr int phase0Idx = liquidPhaseIdx;
88 static constexpr int phase1Idx = gasPhaseIdx;
89
90 static constexpr int H2OIdx = 0;
91 static constexpr int N2Idx = 1;
92 static constexpr int O2Idx = 2;
93
94 static constexpr int comp0Idx = H2OIdx; // first major component
95 static constexpr int comp1Idx = N2Idx; // second major component
96 static constexpr int comp2Idx = O2Idx; // secondary component
97
98 // main component at 20°C and 1 bar
99 static constexpr int liquidPhaseMainCompIdx = H2OIdx;
100 static constexpr int gasPhaseMainCompIdx = N2Idx;
101
102 /****************************************
103 * Fluid phase related static parameters
104 ****************************************/
110 static std::string phaseName(int phaseIdx)
111 {
112 assert(0 <= phaseIdx && phaseIdx < numPhases);
113 switch (phaseIdx)
114 {
115 case liquidPhaseIdx: return IOName::liquidPhase();
116 case gasPhaseIdx: return IOName::gaseousPhase();
117 }
118 DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
119 }
120
126 static constexpr bool isGas(int phaseIdx)
127 {
128 assert(0 <= phaseIdx && phaseIdx < numPhases);
129 return phaseIdx == gasPhaseIdx;
130 }
131
146 static bool isIdealMixture(int phaseIdx)
147 {
148 assert(0 <= phaseIdx && phaseIdx < numPhases);
149 // we assume Henry's and Raoult's laws for the water phase and
150 // and no interaction between gas molecules of different
151 // components, so all phases are ideal mixtures!
152 return true;
153 }
154
164 static constexpr bool isCompressible(int phaseIdx)
165 {
166 assert(0 <= phaseIdx && phaseIdx < numPhases);
167 // gases are always compressible
168 if (phaseIdx == gasPhaseIdx)
169 return true;
170 // the water component decides for the liquid phase...
172 }
173
180 static bool isIdealGas(int phaseIdx)
181 {
182 assert(0 <= phaseIdx && phaseIdx < numPhases);
183 if (phaseIdx == gasPhaseIdx)
184 // let the components decide
186 return false; // not a gas
187 }
188
192 static constexpr bool isMiscible()
193 { return true; }
194
195 /****************************************
196 * Component related static parameters
197 ****************************************/
203 static std::string componentName(int compIdx)
204 {
205 switch (compIdx)
206 {
207 case H2OIdx: return H2O::name();
208 case N2Idx: return N2::name();
209 case O2Idx: return O2::name();
210 }
211
212 DUNE_THROW(Dune::InvalidStateException, "Invalid component index " << compIdx);
213 }
214
220 static Scalar molarMass(int compIdx)
221 {
222 static const Scalar M[] = {
226 };
227
228 assert(0 <= compIdx && compIdx < numComponents);
229 return M[compIdx];
230 }
231
237 static Scalar criticalTemperature(int compIdx)
238 {
239 static const Scalar Tcrit[] = {
243 };
244
245 assert(0 <= compIdx && compIdx < numComponents);
246 return Tcrit[compIdx];
247 }
248
254 static Scalar criticalPressure(int compIdx)
255 {
256 static const Scalar pcrit[] = {
260 };
261
262 assert(0 <= compIdx && compIdx < numComponents);
263 return pcrit[compIdx];
264 }
265
271 static Scalar criticalMolarVolume(int compIdx)
272 {
273 DUNE_THROW(Dune::NotImplemented,
274 "H2ON2O2FluidSystem::criticalMolarVolume()");
275 }
276
282 static Scalar acentricFactor(int compIdx)
283 {
284 static const Scalar accFac[] = {
285 H2O::acentricFactor(),
286 N2::acentricFactor(),
287 O2::acentricFactor()
288 };
289
290 assert(0 <= compIdx && compIdx < numComponents);
291 return accFac[compIdx];
292 }
293
305 template <class FluidState>
306 static Scalar kelvinVaporPressure(const FluidState &fluidState,
307 const int phaseIdx,
308 const int compIdx,
309 const Scalar radius)
310 {
311 assert(0 <= phaseIdx && phaseIdx == liquidPhaseIdx);
312 assert(0 <= compIdx && compIdx == liquidPhaseMainCompIdx);
313
314 Scalar T = fluidState.temperature(phaseIdx);
315
316 Scalar vaporPressure = H2O::vaporPressure(T);
317 Scalar exponent = molarMass(compIdx)/(density(fluidState, phaseIdx) * Constants::R * T);
318 exponent *= (2 * surfaceTension(fluidState) / radius);
319 using std::exp;
320 Scalar kelvinVaporPressure = vaporPressure * exp(exponent);
321
322 return kelvinVaporPressure;
323 }
324
334 template <class FluidState>
335 static Scalar kelvinVaporPressure(const FluidState &fluidState,
336 const int phaseIdx,
337 const int compIdx)
338 {
339 assert(compIdx == liquidPhaseMainCompIdx && phaseIdx == liquidPhaseIdx);
340
341 using std::exp;
342 return fugacityCoefficient(fluidState, phaseIdx, compIdx)
343 * fluidState.pressure(phaseIdx)
344 * exp(-(fluidState.pressure(gasPhaseIdx)-fluidState.pressure(liquidPhaseIdx))
345 / density(fluidState, phaseIdx)
347 / fluidState.temperature());
348 }
349
357 template <class FluidState>
358 static Scalar surfaceTension(const FluidState &fluidState)
359 {
360 const Scalar T = fluidState.temperature(); //K
361 const Scalar B = 0.2358 ; // [N/m]
362 const Scalar T_c = H2O::criticalTemperature(); //K
363 const Scalar mu = 1.256;
364 const Scalar b = -0.625;
365 //Equation to calculate surface Tension of Water According to IAPWS Release on Surface Tension from September 1994
366 using std::pow;
367 const Scalar surfaceTension = B*pow((1.-(T/T_c)),mu)*(1.+b*(1.-(T/T_c)));
368 return surfaceTension; //surface Tension [N/m]
369 }
370 /****************************************
371 * thermodynamic relations
372 ****************************************/
373
380 static void init()
381 {
382 init(/*tempMin=*/273.15,
383 /*tempMax=*/623.15,
384 /*numTemp=*/100,
385 /*pMin=*/0.0,
386 /*pMax=*/20e6,
387 /*numP=*/200);
388 }
389
401 static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp,
402 Scalar pressMin, Scalar pressMax, unsigned nPress)
403 {
404 std::cout << "The H2O-N2-O2 fluid system was configured with the following policy:\n";
405 std::cout << " - use H2O density as liquid mixture density: " << std::boolalpha << Policy::useH2ODensityAsLiquidMixtureDensity() << "\n";
406 std::cout << " - use ideal gas density: " << std::boolalpha << Policy::useIdealGasDensity() << "\n";
407 std::cout << " - use N2 viscosity as gas mixture viscosity: " << std::boolalpha << Policy::useN2ViscosityAsGasMixtureViscosity() << "\n";
408 std::cout << " - use N2 heat conductivity as gas mixture heat conductivity: " << std::boolalpha << Policy::useN2HeatConductivityAsGasMixtureHeatConductivity() << "\n";
409 std::cout << " - use ideal gas heat capacities: " << std::boolalpha << Policy::useIdealGasHeatCapacities() << std::endl;
410
412 {
413 TabulatedH2O::init(tempMin, tempMax, nTemp,
414 pressMin, pressMax, nPress);
415 }
416 }
417
431 template <class FluidState>
432 static Scalar density(const FluidState &fluidState,
433 int phaseIdx)
434 {
435 assert(0 <= phaseIdx && phaseIdx < numPhases);
436
437 Scalar T = fluidState.temperature(phaseIdx);
438 Scalar p = fluidState.pressure(phaseIdx);
439
440 // liquid phase
441 if (phaseIdx == liquidPhaseIdx)
442 {
443 // assume pure water
444 if (Policy::useH2ODensityAsLiquidMixtureDensity())
445 return H2O::liquidDensity(T, p);
446
447 // See: Eq. (7) in Class et al. (2002a)
448 // This assumes each gas molecule displaces exactly one
449 // molecule in the liquid.
450 else
451 return H2O::liquidMolarDensity(T, p)
452 * (fluidState.moleFraction(liquidPhaseIdx, H2OIdx)*H2O::molarMass()
453 + fluidState.moleFraction(liquidPhaseIdx, N2Idx)*N2::molarMass()
454 + fluidState.moleFraction(liquidPhaseIdx, O2Idx)*O2::molarMass());
455 }
456
457 // gas phase
458 else if (phaseIdx == gasPhaseIdx)
459 {
460
461 // for the gas phase assume an ideal gas
462 using std::max;
463 if (Policy::useIdealGasDensity())
464 return IdealGas::molarDensity(T, p) * fluidState.averageMolarMass(gasPhaseIdx);
465
466 // assume ideal mixture: steam, nitrogen and oxygen don't "see" each other
467 else
468 return H2O::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, H2OIdx))
469 + N2::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, N2Idx))
470 + O2::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, O2Idx));
471 }
472
473 DUNE_THROW(Dune::InvalidStateException, "Unknown phase index " << phaseIdx);
474 }
475
478 template <class FluidState>
479 static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
480 {
481 const Scalar T = fluidState.temperature(phaseIdx);
482 const Scalar p = fluidState.pressure(phaseIdx);
483
484 if (phaseIdx == liquidPhaseIdx)
485 {
486 // assume pure water or that each gas molecule displaces exactly one
487 // molecule in the liquid.
488 return H2O::liquidMolarDensity(T, p);
489 }
490 else
491 {
492 if (Policy::useIdealGasDensity())
493 { //assume ideal gas
494 return IdealGas::molarDensity(T,p);
495 }
496
497 return H2O::gasMolarDensity(T, fluidState.partialPressure(gasPhaseIdx, H2OIdx))
498 + N2::gasMolarDensity(T, fluidState.partialPressure(gasPhaseIdx, N2Idx))
499 + O2::gasMolarDensity(T, fluidState.partialPressure(gasPhaseIdx, O2Idx));
500 }
501 }
502
516 template <class FluidState>
517 static Scalar viscosity(const FluidState &fluidState,
518 int phaseIdx)
519 {
520 assert(0 <= phaseIdx && phaseIdx < numPhases);
521
522 Scalar T = fluidState.temperature(phaseIdx);
523 Scalar p = fluidState.pressure(phaseIdx);
524
525 // liquid phase
526 if (phaseIdx == liquidPhaseIdx) {
527 // assume pure water for the liquid phase
528 return H2O::liquidViscosity(T, p);
529 }
530
531 // gas phase
532 if (Policy::useN2ViscosityAsGasMixtureViscosity())
533 {
534 // assume pure nitrogen for the gas phase
535 return N2::gasViscosity(T, p);
536 }
537 else
538 {
539 // Wilke method (Reid et al.):
540 Scalar muResult = 0;
541 const Scalar mu[numComponents] = {
543 N2::gasViscosity(T, p),
544 O2::gasViscosity(T, p)
545 };
546
547 Scalar sumx = 0.0;
548 using std::max;
549 for (int compIdx = 0; compIdx < numComponents; ++compIdx)
550 sumx += fluidState.moleFraction(phaseIdx, compIdx);
551 sumx = max(1e-10, sumx);
552
553 for (int i = 0; i < numComponents; ++i) {
554 Scalar divisor = 0;
555 using std::pow;
556 using std::sqrt;
557 for (int j = 0; j < numComponents; ++j) {
558 Scalar phiIJ = 1 + sqrt(mu[i]/mu[j]) * pow(molarMass(j)/molarMass(i), 1/4.0);
559 phiIJ *= phiIJ;
560 phiIJ /= sqrt(8*(1 + molarMass(i)/molarMass(j)));
561 divisor += fluidState.moleFraction(phaseIdx, j)/sumx * phiIJ;
562 }
563 muResult += fluidState.moleFraction(phaseIdx, i)/sumx * mu[i] / divisor;
564 }
565 return muResult;
566 }
567 }
568
591 template <class FluidState>
592 static Scalar fugacityCoefficient(const FluidState &fluidState,
593 int phaseIdx,
594 int compIdx)
595 {
596 assert(0 <= phaseIdx && phaseIdx < numPhases);
597 assert(0 <= compIdx && compIdx < numComponents);
598
599 Scalar T = fluidState.temperature(phaseIdx);
600 Scalar p = fluidState.pressure(phaseIdx);
601
602 // liquid phase
603 if (phaseIdx == liquidPhaseIdx)
604 {
605 switch(compIdx){
606 case H2OIdx: return H2O::vaporPressure(T)/p;
607 case N2Idx: return BinaryCoeff::H2O_N2::henry(T)/p;
608 case O2Idx: return BinaryCoeff::H2O_O2::henry(T)/p;
609 };
610 }
611
612 // for the gas phase, assume an ideal gas when it comes to
613 // fugacity (-> fugacity == partial pressure)
614 return 1.0;
615 }
616
619 template <class FluidState>
620 static Scalar diffusionCoefficient(const FluidState &fluidState,
621 int phaseIdx,
622 int compIdx)
623 {
624 DUNE_THROW(Dune::NotImplemented, "Diffusion coefficients");
625 }
626
629 template <class FluidState>
630 static Scalar binaryDiffusionCoefficient(const FluidState &fluidState,
631 int phaseIdx,
632 int compIIdx,
633 int compJIdx)
634
635 {
636 if (compIIdx > compJIdx)
637 {
638 using std::swap;
639 swap(compIIdx, compJIdx);
640 }
641
642#ifndef NDEBUG
643 if (compIIdx == compJIdx ||
644 phaseIdx > numPhases - 1 ||
645 compJIdx > numComponents - 1)
646 {
647 DUNE_THROW(Dune::InvalidStateException,
648 "Binary diffusion coefficient of components "
649 << compIIdx << " and " << compJIdx
650 << " in phase " << phaseIdx << " is undefined!\n");
651 }
652#endif
653
654 Scalar T = fluidState.temperature(phaseIdx);
655 Scalar p = fluidState.pressure(phaseIdx);
656
657 // liquid phase
658 if (phaseIdx == liquidPhaseIdx) {
659 if (compIIdx == H2OIdx && compJIdx == N2Idx)
661 if (compIIdx == H2OIdx && compJIdx == O2Idx)
663 DUNE_THROW(Dune::InvalidStateException,
664 "Binary diffusion coefficient of components "
665 << compIIdx << " and " << compJIdx
666 << " in phase " << phaseIdx << " is undefined!\n");
667 }
668 // gas phase
669 if (phaseIdx == gasPhaseIdx) {
670 if (compIIdx == H2OIdx && compJIdx == N2Idx)
672 if (compIIdx == H2OIdx && compJIdx == O2Idx)
674 if(compIIdx == N2Idx && compJIdx == O2Idx)
676 DUNE_THROW(Dune::InvalidStateException,
677 "Binary diffusion coefficient of components "
678 << compIIdx << " and " << compJIdx
679 << " in phase " << phaseIdx << " is undefined!\n");
680 }
681
682 DUNE_THROW(Dune::InvalidStateException,
683 "Binary diffusion coefficient of components "
684 << compIIdx << " and " << compJIdx
685 << " in phase " << phaseIdx << " is undefined!\n");
686 }
687
701 template <class FluidState>
702 static Scalar enthalpy(const FluidState &fluidState,
703 int phaseIdx)
704 {
705 Scalar T = fluidState.temperature(phaseIdx);
706 Scalar p = fluidState.pressure(phaseIdx);
707
708 // liquid phase
709 if (phaseIdx == liquidPhaseIdx) {
710 return H2O::liquidEnthalpy(T, p);
711 }
712 // gas phase
713 else if (phaseIdx == gasPhaseIdx)
714 {
715 // assume ideal mixture: which means
716 // that the total specific enthalpy is the sum of the
717 // "partial specific enthalpies" of the components.
718 Scalar hH2O =
719 fluidState.massFraction(gasPhaseIdx, H2OIdx)
720 * H2O::gasEnthalpy(T, p);
721 Scalar hN2 =
722 fluidState.massFraction(gasPhaseIdx, N2Idx)
723 * N2::gasEnthalpy(T,p);
724 Scalar hO2 =
725 fluidState.massFraction(gasPhaseIdx, O2Idx)
726 * O2::gasEnthalpy(T,p);
727 return hH2O + hN2 + hO2;
728 }
729 else
730 DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
731 }
732
739 template <class FluidState>
740 static Scalar componentEnthalpy(const FluidState &fluidState,
741 int phaseIdx,
742 int componentIdx)
743 {
744 const Scalar T = fluidState.temperature(phaseIdx);
745 const Scalar p = fluidState.pressure(phaseIdx);
746
747 if (phaseIdx == phase0Idx)
748 {
749 if (componentIdx == H2OIdx)
750 return H2O::liquidEnthalpy(T, p);
751 else if (componentIdx == N2Idx)
752 DUNE_THROW(Dune::NotImplemented, "Component enthalpy of nitrogen in liquid phase");
753 else if (componentIdx == O2Idx)
754 DUNE_THROW(Dune::NotImplemented, "Component enthalpy of oxygen in liquid phase");
755 else
756 DUNE_THROW(Dune::InvalidStateException, "Invalid component index " << componentIdx);
757 }
758 else if (phaseIdx == phase1Idx)
759 {
760 if (componentIdx == H2OIdx)
761 return H2O::gasEnthalpy(T, p);
762 else if (componentIdx == N2Idx)
763 return N2::gasEnthalpy(T, p);
764 else if (componentIdx == O2Idx)
765 return O2::gasEnthalpy(T, p);
766 DUNE_THROW(Dune::InvalidStateException, "Invalid component index " << componentIdx);
767 }
768 DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
769 }
770
781 template <class FluidState>
782 static Scalar thermalConductivity(const FluidState &fluidState,
783 const int phaseIdx)
784 {
785 assert(0 <= phaseIdx && phaseIdx < numPhases);
786 Scalar temperature = fluidState.temperature(phaseIdx) ;
787 Scalar pressure = fluidState.pressure(phaseIdx);
788
789 if (phaseIdx == liquidPhaseIdx)
790 {
792 }
793 else
794 {
797 if (!Policy::useN2HeatConductivityAsGasMixtureHeatConductivity())
798 {
799 Scalar xN2 = fluidState.moleFraction(phaseIdx, N2Idx);
800 Scalar xO2 = fluidState.moleFraction(phaseIdx, O2Idx);
801 Scalar xH2O = fluidState.moleFraction(phaseIdx, H2OIdx);
802 Scalar lambdaN2 = xN2 * lambdaPureN2;
803 Scalar lambdaO2 = xO2 * lambdaPureO2;
804 Scalar partialPressure = pressure * xH2O;
805 Scalar lambdaH2O = xH2O * H2O::gasThermalConductivity(temperature, partialPressure);
806 return lambdaN2 + lambdaH2O + lambdaO2;
807 }
808 else
809 return lambdaPureN2;
810 }
811 }
812
815 template <class FluidState>
816 static Scalar heatCapacity(const FluidState &fluidState,
817 int phaseIdx)
818 {
819 if (phaseIdx == liquidPhaseIdx) {
820 return H2O::liquidHeatCapacity(fluidState.temperature(phaseIdx),
821 fluidState.pressure(phaseIdx));
822 }
823
824 Scalar c_pN2;
825 Scalar c_pO2;
826 Scalar c_pH2O;
827 // let the water and nitrogen components do things their own way
828 if (!Policy::useIdealGasHeatCapacities()) {
829 c_pN2 = N2::gasHeatCapacity(fluidState.temperature(phaseIdx),
830 fluidState.pressure(phaseIdx)
831 * fluidState.moleFraction(phaseIdx, N2Idx));
832
833 c_pH2O = H2O::gasHeatCapacity(fluidState.temperature(phaseIdx),
834 fluidState.pressure(phaseIdx)
835 * fluidState.moleFraction(phaseIdx, H2OIdx));
836 c_pO2 = O2::gasHeatCapacity(fluidState.temperature(phaseIdx),
837 fluidState.pressure(phaseIdx)
838 * fluidState.moleFraction(phaseIdx, O2Idx));
839 }
840 else {
841 // assume an ideal gas for both components. See:
842 //
843 //http://en.wikipedia.org/wiki/Heat_capacity
844 Scalar c_vN2molar = Constants::R*2.39;
845 Scalar c_pN2molar = Constants::R + c_vN2molar;
846
847 Scalar c_vO2molar = Constants::R*2.43;
848 Scalar c_pO2molar = Constants::R + c_vO2molar;
849
850 Scalar c_vH2Omolar = Constants::R*3.37; // <- correct??
851 Scalar c_pH2Omolar = Constants::R + c_vH2Omolar;
852
853 c_pN2 = c_pN2molar/molarMass(N2Idx);
854 c_pO2 = c_pO2molar/molarMass(O2Idx);
855 c_pH2O = c_pH2Omolar/molarMass(H2OIdx);
856 }
857
858 // mangle all components together
859 return
860 c_pH2O*fluidState.massFraction(gasPhaseIdx, H2OIdx)
861 + c_pN2*fluidState.massFraction(gasPhaseIdx, N2Idx)
862 + c_pO2*fluidState.massFraction(gasPhaseIdx, O2Idx);
863 }
864
865};
866
867} // end namespace FluidSystems
868} // end namespace Dumux
869
870#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
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for molecular water and oxygen.
Definition: h2o_o2.hh:54
static Scalar henry(Scalar temperature)
Henry coefficient for molecular oxygen in liquid water.
Definition: h2o_o2.hh:36
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient for molecular oxygen in liquid water.
Definition: h2o_o2.hh:85
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for molecular oxygen in liquid nitrogen.
Definition: n2_o2.hh:49
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
Properties of pure molecular oxygen .
Definition: o2.hh:36
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of pure oxygen gas. Shomate Equation is used for a temperature range of 100K to 60...
Definition: o2.hh:166
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure in , depending on pressure and temperature.
Definition: o2.hh:138
static constexpr Scalar criticalTemperature()
Returns the critical temperature in of molecular oxygen.
Definition: o2.hh:58
static std::string name()
A human readable name for the .
Definition: o2.hh:46
static constexpr Scalar molarMass()
The molar mass in of molecular oxygen.
Definition: o2.hh:52
static Scalar gasHeatCapacity(Scalar T, Scalar pressure)
Specific isobaric heat capacity of pure oxygen gas. Shomate Equation is used for a temperature range...
Definition: o2.hh:182
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of at a given pressure and temperature.
Definition: o2.hh:199
static constexpr Scalar criticalPressure()
Returns the critical pressure in of molecular oxygen.
Definition: o2.hh:64
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: o2.hh:144
static constexpr Scalar gasDensity(Scalar temperature, Scalar pressure)
The density in of pure at a given pressure and temperature.
Definition: o2.hh:126
static constexpr Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of nitrogen.
Definition: o2.hh:238
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
static constexpr Scalar R
The ideal gas constant .
Definition: constants.hh:32
Fluid system base class.
Definition: fluidsystems/base.hh:33
Scalar Scalar
export the scalar type
Definition: fluidsystems/base.hh:36
A two-phase (water and air) fluid system with water, nitrogen and oxygen as components.
Definition: h2on2o2.hh:65
static std::string phaseName(int phaseIdx)
Return the human readable name of a fluid phase.
Definition: h2on2o2.hh:110
static constexpr int comp1Idx
Definition: h2on2o2.hh:95
static Scalar criticalTemperature(int compIdx)
Critical temperature of a component .
Definition: h2on2o2.hh:237
static constexpr int numSPhases
Definition: h2on2o2.hh:83
static constexpr bool isGas(int phaseIdx)
Return whether a phase is gaseous.
Definition: h2on2o2.hh:126
static constexpr int N2Idx
Definition: h2on2o2.hh:91
static constexpr int H2OIdx
Definition: h2on2o2.hh:90
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: h2on2o2.hh:630
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy of a component in a specific phase.
Definition: h2on2o2.hh:740
static Scalar molarMass(int compIdx)
Return the molar mass of a component in .
Definition: h2on2o2.hh:220
static bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: h2on2o2.hh:180
static constexpr int phase1Idx
index of the second phase
Definition: h2on2o2.hh:88
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition: h2on2o2.hh:192
static std::string componentName(int compIdx)
Return the human readable name of a component.
Definition: h2on2o2.hh:203
static constexpr int liquidPhaseIdx
index of the liquid phase
Definition: h2on2o2.hh:85
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Returns the fugacity coefficient of a component in a phase.
Definition: h2on2o2.hh:592
static constexpr int gasPhaseMainCompIdx
Definition: h2on2o2.hh:100
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: h2on2o2.hh:164
static Scalar kelvinVaporPressure(const FluidState &fluidState, const int phaseIdx, const int compIdx, const Scalar radius)
Kelvin equation in .
Definition: h2on2o2.hh:306
static Scalar density(const FluidState &fluidState, int phaseIdx)
Given a phase's composition, temperature, pressure, and the partial pressures of all components,...
Definition: h2on2o2.hh:432
static Scalar acentricFactor(int compIdx)
The acentric factor of a component .
Definition: h2on2o2.hh:282
static constexpr int phase0Idx
index of the first phase
Definition: h2on2o2.hh:87
static void init()
Initialize the fluid system's static parameters generically.
Definition: h2on2o2.hh:380
static constexpr int numPhases
Number of phases in the fluid system.
Definition: h2on2o2.hh:81
static constexpr int liquidPhaseMainCompIdx
Definition: h2on2o2.hh:99
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
Calculate the molar density of a fluid phase.
Definition: h2on2o2.hh:479
static Scalar kelvinVaporPressure(const FluidState &fluidState, const int phaseIdx, const int compIdx)
Vapor pressure including the Kelvin equation in .
Definition: h2on2o2.hh:335
static bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: h2on2o2.hh:146
static constexpr int gasPhaseIdx
index of the gas phase
Definition: h2on2o2.hh:86
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Specific isobaric heat capacity of a fluid phase .
Definition: h2on2o2.hh:816
static Scalar thermalConductivity(const FluidState &fluidState, const int phaseIdx)
Thermal conductivity of a fluid phase .
Definition: h2on2o2.hh:782
static Scalar criticalPressure(int compIdx)
Critical pressure of a component .
Definition: h2on2o2.hh:254
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase .
Definition: h2on2o2.hh:620
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Calculate the dynamic viscosity of a fluid phase .
Definition: h2on2o2.hh:517
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy .
Definition: h2on2o2.hh:702
static constexpr int O2Idx
Definition: h2on2o2.hh:92
static constexpr int comp0Idx
Definition: h2on2o2.hh:94
static Scalar surfaceTension(const FluidState &fluidState)
Calculate the surface tension between water and air in , according to IAPWS Release on Surface Tensio...
Definition: h2on2o2.hh:358
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: h2on2o2.hh:401
static constexpr int comp2Idx
Definition: h2on2o2.hh:96
static constexpr int numComponents
Number of components in the fluid system.
Definition: h2on2o2.hh:82
static Scalar criticalMolarVolume(int compIdx)
Molar volume of a component at the critical point .
Definition: h2on2o2.hh:271
Relations valid for an ideal gas.
Definition: idealgas.hh:25
static constexpr Scalar molarDensity(Scalar temperature, Scalar pressure)
The molar density of the gas , depending on pressure and temperature.
Definition: idealgas.hh:58
A central place for various physical constants occurring in some equations.
Some exceptions thrown in DuMux
Fluid system base class.
Material properties of pure water .
Binary coefficients for water and nitrogen.
Binary coefficients for water and oxygen.
Relations valid for an ideal gas.
Properties of pure molecular nitrogen .
Binary coefficients for nitrogen and oxygen.
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
Properties of pure molecular oxygen .
Policy for the H2O-N2-O2 fluid system.
Definition: h2on2o2.hh:44
static constexpr bool useIdealGasDensity()
Definition: h2on2o2.hh:46
static constexpr bool useIdealGasHeatCapacities()
Definition: h2on2o2.hh:49
static constexpr bool useH2ODensityAsLiquidMixtureDensity()
Definition: h2on2o2.hh:45
static constexpr bool useN2ViscosityAsGasMixtureViscosity()
Definition: h2on2o2.hh:47
static constexpr bool useN2HeatConductivityAsGasMixtureHeatConductivity()
Definition: h2on2o2.hh:48
Tabulates all thermodynamic properties of a given untabulated chemical species.