3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
19
25#ifndef DUMUX_H2O_N2_O2_FLUID_SYSTEM_HH
26#define DUMUX_H2O_N2_O2_FLUID_SYSTEM_HH
27
28#include <cassert>
29#include <iomanip>
30
32
36
40
45
46#include <dumux/io/name.hh>
47
48namespace Dumux {
49namespace FluidSystems {
54template<bool fastButSimplifiedRelations = false>
56{
57 static constexpr bool useH2ODensityAsLiquidMixtureDensity() { return fastButSimplifiedRelations; }
58 static constexpr bool useIdealGasDensity() { return fastButSimplifiedRelations; }
59 static constexpr bool useN2ViscosityAsGasMixtureViscosity() { return fastButSimplifiedRelations; }
60 static constexpr bool useN2HeatConductivityAsGasMixtureHeatConductivity() { return fastButSimplifiedRelations; }
61 static constexpr bool useIdealGasHeatCapacities() { return fastButSimplifiedRelations; }
62};
63
74template <class Scalar, class Policy = H2ON2O2DefaultPolicy<>>
76 : public Base<Scalar, H2ON2O2<Scalar, Policy> >
77{
80
86
88 using H2O = TabulatedH2O;
89
91 using N2 = SimpleN2;
92
93public:
94 static constexpr int numPhases = 2;
95 static constexpr int numComponents = 3;
96 static constexpr int numSPhases = 0; // TODO: Remove
97
98 static constexpr int liquidPhaseIdx = 0;
99 static constexpr int gasPhaseIdx = 1;
100 static constexpr int phase0Idx = liquidPhaseIdx;
101 static constexpr int phase1Idx = gasPhaseIdx;
102
103 static constexpr int H2OIdx = 0;
104 static constexpr int N2Idx = 1;
105 static constexpr int O2Idx = 2;
106
107 static constexpr int comp0Idx = H2OIdx; // first major component
108 static constexpr int comp1Idx = N2Idx; // second major component
109 static constexpr int comp2Idx = O2Idx; // secondary component
110
111 // main component at 20°C and 1 bar
112 static constexpr int liquidPhaseMainCompIdx = H2OIdx;
113 static constexpr int gasPhaseMainCompIdx = N2Idx;
114
115 /****************************************
116 * Fluid phase related static parameters
117 ****************************************/
123 static std::string phaseName(int phaseIdx)
124 {
125 assert(0 <= phaseIdx && phaseIdx < numPhases);
126 switch (phaseIdx)
127 {
128 case liquidPhaseIdx: return IOName::liquidPhase();
129 case gasPhaseIdx: return IOName::gaseousPhase();
130 }
131 DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
132 }
133
139 static constexpr bool isGas(int phaseIdx)
140 {
141 assert(0 <= phaseIdx && phaseIdx < numPhases);
142 return phaseIdx == gasPhaseIdx;
143 }
144
159 static bool isIdealMixture(int phaseIdx)
160 {
161 assert(0 <= phaseIdx && phaseIdx < numPhases);
162 // we assume Henry's and Raoult's laws for the water phase and
163 // and no interaction between gas molecules of different
164 // components, so all phases are ideal mixtures!
165 return true;
166 }
167
177 static constexpr bool isCompressible(int phaseIdx)
178 {
179 assert(0 <= phaseIdx && phaseIdx < numPhases);
180 // gases are always compressible
181 if (phaseIdx == gasPhaseIdx)
182 return true;
183 // the water component decides for the liquid phase...
185 }
186
193 static bool isIdealGas(int phaseIdx)
194 {
195 assert(0 <= phaseIdx && phaseIdx < numPhases);
196 if (phaseIdx == gasPhaseIdx)
197 // let the components decide
199 return false; // not a gas
200 }
201
205 static constexpr bool isMiscible()
206 { return true; }
207
208 /****************************************
209 * Component related static parameters
210 ****************************************/
216 static std::string componentName(int compIdx)
217 {
218 switch (compIdx)
219 {
220 case H2OIdx: return H2O::name();
221 case N2Idx: return N2::name();
222 case O2Idx: return O2::name();
223 }
224
225 DUNE_THROW(Dune::InvalidStateException, "Invalid component index " << compIdx);
226 }
227
233 static Scalar molarMass(int compIdx)
234 {
235 static const Scalar M[] = {
239 };
240
241 assert(0 <= compIdx && compIdx < numComponents);
242 return M[compIdx];
243 }
244
250 static Scalar criticalTemperature(int compIdx)
251 {
252 static const Scalar Tcrit[] = {
256 };
257
258 assert(0 <= compIdx && compIdx < numComponents);
259 return Tcrit[compIdx];
260 }
261
267 static Scalar criticalPressure(int compIdx)
268 {
269 static const Scalar pcrit[] = {
273 };
274
275 assert(0 <= compIdx && compIdx < numComponents);
276 return pcrit[compIdx];
277 }
278
284 static Scalar criticalMolarVolume(int compIdx)
285 {
286 DUNE_THROW(Dune::NotImplemented,
287 "H2ON2O2FluidSystem::criticalMolarVolume()");
288 }
289
295 static Scalar acentricFactor(int compIdx)
296 {
297 static const Scalar accFac[] = {
298 H2O::acentricFactor(),
299 N2::acentricFactor(),
300 O2::acentricFactor()
301 };
302
303 assert(0 <= compIdx && compIdx < numComponents);
304 return accFac[compIdx];
305 }
306
318 template <class FluidState>
319 static Scalar kelvinVaporPressure(const FluidState &fluidState,
320 const int phaseIdx,
321 const int compIdx,
322 const Scalar radius)
323 {
324 assert(0 <= phaseIdx && phaseIdx == liquidPhaseIdx);
325 assert(0 <= compIdx && compIdx == liquidPhaseMainCompIdx);
326
327 Scalar T = fluidState.temperature(phaseIdx);
328
329 Scalar vaporPressure = H2O::vaporPressure(T);
330 Scalar exponent = molarMass(compIdx)/(density(fluidState, phaseIdx) * Constants::R * T);
331 exponent *= (2 * surfaceTension(fluidState) / radius);
332 using std::exp;
333 Scalar kelvinVaporPressure = vaporPressure * exp(exponent);
334
335 return kelvinVaporPressure;
336 }
337
347 template <class FluidState>
348 static Scalar kelvinVaporPressure(const FluidState &fluidState,
349 const int phaseIdx,
350 const int compIdx)
351 {
352 assert(compIdx == liquidPhaseMainCompIdx && phaseIdx == liquidPhaseIdx);
353
354 using std::exp;
355 return fugacityCoefficient(fluidState, phaseIdx, compIdx)
356 * fluidState.pressure(phaseIdx)
357 * exp(-(fluidState.pressure(gasPhaseIdx)-fluidState.pressure(liquidPhaseIdx))
358 / density(fluidState, phaseIdx)
360 / fluidState.temperature());
361 }
362
370 template <class FluidState>
371 static Scalar surfaceTension(const FluidState &fluidState)
372 {
373 const Scalar T = fluidState.temperature(); //K
374 const Scalar B = 0.2358 ; // [N/m]
375 const Scalar T_c = H2O::criticalTemperature(); //K
376 const Scalar mu = 1.256;
377 const Scalar b = -0.625;
378 //Equation to calculate surface Tension of Water According to IAPWS Release on Surface Tension from September 1994
379 using std::pow;
380 const Scalar surfaceTension = B*pow((1.-(T/T_c)),mu)*(1.+b*(1.-(T/T_c)));
381 return surfaceTension; //surface Tension [N/m]
382 }
383 /****************************************
384 * thermodynamic relations
385 ****************************************/
386
393 static void init()
394 {
395 init(/*tempMin=*/273.15,
396 /*tempMax=*/623.15,
397 /*numTemp=*/100,
398 /*pMin=*/0.0,
399 /*pMax=*/20e6,
400 /*numP=*/200);
401 }
402
414 static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp,
415 Scalar pressMin, Scalar pressMax, unsigned nPress)
416 {
417 std::cout << "The H2O-N2-O2 fluid system was configured with the following policy:\n";
418 std::cout << " - use H2O density as liquid mixture density: " << std::boolalpha << Policy::useH2ODensityAsLiquidMixtureDensity() << "\n";
419 std::cout << " - use ideal gas density: " << std::boolalpha << Policy::useIdealGasDensity() << "\n";
420 std::cout << " - use N2 viscosity as gas mixture viscosity: " << std::boolalpha << Policy::useN2ViscosityAsGasMixtureViscosity() << "\n";
421 std::cout << " - use N2 heat conductivity as gas mixture heat conductivity: " << std::boolalpha << Policy::useN2HeatConductivityAsGasMixtureHeatConductivity() << "\n";
422 std::cout << " - use ideal gas heat capacities: " << std::boolalpha << Policy::useIdealGasHeatCapacities() << std::endl;
423
425 {
426 TabulatedH2O::init(tempMin, tempMax, nTemp,
427 pressMin, pressMax, nPress);
428 }
429 }
430
431 using Base::density;
444 template <class FluidState>
445 static Scalar density(const FluidState &fluidState,
446 int phaseIdx)
447 {
448 assert(0 <= phaseIdx && phaseIdx < numPhases);
449
450 Scalar T = fluidState.temperature(phaseIdx);
451 Scalar p = fluidState.pressure(phaseIdx);
452
453 // liquid phase
454 if (phaseIdx == liquidPhaseIdx)
455 {
456 // assume pure water
457 if (Policy::useH2ODensityAsLiquidMixtureDensity())
458 return H2O::liquidDensity(T, p);
459
460 // See: Eq. (7) in Class et al. (2002a)
461 // This assumes each gas molecule displaces exactly one
462 // molecule in the liquid.
463 else
464 return H2O::liquidMolarDensity(T, p)
465 * (fluidState.moleFraction(liquidPhaseIdx, H2OIdx)*H2O::molarMass()
466 + fluidState.moleFraction(liquidPhaseIdx, N2Idx)*N2::molarMass()
467 + fluidState.moleFraction(liquidPhaseIdx, O2Idx)*O2::molarMass());
468 }
469
470 // gas phase
471 else if (phaseIdx == gasPhaseIdx)
472 {
473
474 // for the gas phase assume an ideal gas
475 using std::max;
476 if (Policy::useIdealGasDensity())
477 return IdealGas::molarDensity(T, p) * fluidState.averageMolarMass(gasPhaseIdx);
478
479 // assume ideal mixture: steam, nitrogen and oxygen don't "see" each other
480 else
481 return H2O::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, H2OIdx))
482 + N2::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, N2Idx))
483 + O2::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, O2Idx));
484 }
485
486 DUNE_THROW(Dune::InvalidStateException, "Unknown phase index " << phaseIdx);
487 }
488
489 using Base::molarDensity;
502 template <class FluidState>
503 static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
504 {
505 const Scalar T = fluidState.temperature(phaseIdx);
506 const Scalar p = fluidState.pressure(phaseIdx);
507
508 if (phaseIdx == liquidPhaseIdx)
509 {
510 // assume pure water or that each gas molecule displaces exactly one
511 // molecule in the liquid.
512 return H2O::liquidMolarDensity(T, p);
513 }
514 else
515 {
516 if (Policy::useIdealGasDensity())
517 { //assume ideal gas
518 return IdealGas::molarDensity(T,p);
519 }
520
521 return H2O::gasMolarDensity(T, fluidState.partialPressure(gasPhaseIdx, H2OIdx))
522 + N2::gasMolarDensity(T, fluidState.partialPressure(gasPhaseIdx, N2Idx))
523 + O2::gasMolarDensity(T, fluidState.partialPressure(gasPhaseIdx, O2Idx));
524 }
525 }
526
527 using Base::viscosity;
540 template <class FluidState>
541 static Scalar viscosity(const FluidState &fluidState,
542 int phaseIdx)
543 {
544 assert(0 <= phaseIdx && phaseIdx < numPhases);
545
546 Scalar T = fluidState.temperature(phaseIdx);
547 Scalar p = fluidState.pressure(phaseIdx);
548
549 // liquid phase
550 if (phaseIdx == liquidPhaseIdx) {
551 // assume pure water for the liquid phase
552 return H2O::liquidViscosity(T, p);
553 }
554
555 // gas phase
556 if (Policy::useN2ViscosityAsGasMixtureViscosity())
557 {
558 // assume pure nitrogen for the gas phase
559 return N2::gasViscosity(T, p);
560 }
561 else
562 {
563 // Wilke method (Reid et al.):
564 Scalar muResult = 0;
565 const Scalar mu[numComponents] = {
567 N2::gasViscosity(T, p),
568 O2::gasViscosity(T, p)
569 };
570
571 Scalar sumx = 0.0;
572 using std::max;
573 for (int compIdx = 0; compIdx < numComponents; ++compIdx)
574 sumx += fluidState.moleFraction(phaseIdx, compIdx);
575 sumx = max(1e-10, sumx);
576
577 for (int i = 0; i < numComponents; ++i) {
578 Scalar divisor = 0;
579 using std::pow;
580 using std::sqrt;
581 for (int j = 0; j < numComponents; ++j) {
582 Scalar phiIJ = 1 + sqrt(mu[i]/mu[j]) * pow(molarMass(j)/molarMass(i), 1/4.0);
583 phiIJ *= phiIJ;
584 phiIJ /= sqrt(8*(1 + molarMass(i)/molarMass(j)));
585 divisor += fluidState.moleFraction(phaseIdx, j)/sumx * phiIJ;
586 }
587 muResult += fluidState.moleFraction(phaseIdx, i)/sumx * mu[i] / divisor;
588 }
589 return muResult;
590 }
591 }
592
612 template <class FluidState>
613 static Scalar fugacityCoefficient(const FluidState &fluidState,
614 int phaseIdx,
615 int compIdx)
616 {
617 assert(0 <= phaseIdx && phaseIdx < numPhases);
618 assert(0 <= compIdx && compIdx < numComponents);
619
620 Scalar T = fluidState.temperature(phaseIdx);
621 Scalar p = fluidState.pressure(phaseIdx);
622
623 // liquid phase
624 if (phaseIdx == liquidPhaseIdx)
625 {
626 switch(compIdx){
627 case H2OIdx: return H2O::vaporPressure(T)/p;
628 case N2Idx: return BinaryCoeff::H2O_N2::henry(T)/p;
629 case O2Idx: return BinaryCoeff::H2O_O2::henry(T)/p;
630 };
631 }
632
633 // for the gas phase, assume an ideal gas when it comes to
634 // fugacity (-> fugacity == partial pressure)
635 return 1.0;
636 }
637
662 template <class FluidState>
663 static Scalar diffusionCoefficient(const FluidState &fluidState,
664 int phaseIdx,
665 int compIdx)
666 {
667 DUNE_THROW(Dune::NotImplemented, "Diffusion coefficients");
668 }
669
681 template <class FluidState>
682 static Scalar binaryDiffusionCoefficient(const FluidState &fluidState,
683 int phaseIdx,
684 int compIIdx,
685 int compJIdx)
686
687 {
688 if (compIIdx > compJIdx)
689 {
690 using std::swap;
691 swap(compIIdx, compJIdx);
692 }
693
694#ifndef NDEBUG
695 if (compIIdx == compJIdx ||
696 phaseIdx > numPhases - 1 ||
697 compJIdx > numComponents - 1)
698 {
699 DUNE_THROW(Dune::InvalidStateException,
700 "Binary diffusion coefficient of components "
701 << compIIdx << " and " << compJIdx
702 << " in phase " << phaseIdx << " is undefined!\n");
703 }
704#endif
705
706 Scalar T = fluidState.temperature(phaseIdx);
707 Scalar p = fluidState.pressure(phaseIdx);
708
709 // liquid phase
710 if (phaseIdx == liquidPhaseIdx) {
711 if (compIIdx == H2OIdx && compJIdx == N2Idx)
713 if (compIIdx == H2OIdx && compJIdx == O2Idx)
715 DUNE_THROW(Dune::InvalidStateException,
716 "Binary diffusion coefficient of components "
717 << compIIdx << " and " << compJIdx
718 << " in phase " << phaseIdx << " is undefined!\n");
719 }
720 // gas phase
721 if (phaseIdx == gasPhaseIdx) {
722 if (compIIdx == H2OIdx && compJIdx == N2Idx)
724 if (compIIdx == H2OIdx && compJIdx == O2Idx)
726 if(compIIdx == N2Idx && compJIdx == O2Idx)
728 DUNE_THROW(Dune::InvalidStateException,
729 "Binary diffusion coefficient of components "
730 << compIIdx << " and " << compJIdx
731 << " in phase " << phaseIdx << " is undefined!\n");
732 }
733
734 DUNE_THROW(Dune::InvalidStateException,
735 "Binary diffusion coefficient of components "
736 << compIIdx << " and " << compJIdx
737 << " in phase " << phaseIdx << " is undefined!\n");
738 }
739
740 using Base::enthalpy;
753 template <class FluidState>
754 static Scalar enthalpy(const FluidState &fluidState,
755 int phaseIdx)
756 {
757 Scalar T = fluidState.temperature(phaseIdx);
758 Scalar p = fluidState.pressure(phaseIdx);
759
760 // liquid phase
761 if (phaseIdx == liquidPhaseIdx) {
762 return H2O::liquidEnthalpy(T, p);
763 }
764 // gas phase
765 else if (phaseIdx == gasPhaseIdx)
766 {
767 // assume ideal mixture: which means
768 // that the total specific enthalpy is the sum of the
769 // "partial specific enthalpies" of the components.
770 Scalar hH2O =
771 fluidState.massFraction(gasPhaseIdx, H2OIdx)
772 * H2O::gasEnthalpy(T, p);
773 Scalar hN2 =
774 fluidState.massFraction(gasPhaseIdx, N2Idx)
775 * N2::gasEnthalpy(T,p);
776 Scalar hO2 =
777 fluidState.massFraction(gasPhaseIdx, O2Idx)
778 * O2::gasEnthalpy(T,p);
779 return hH2O + hN2 + hO2;
780 }
781 else
782 DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
783 }
787 template <class FluidState>
788 static Scalar componentEnthalpy(const FluidState &fluidState,
789 int phaseIdx,
790 int componentIdx)
791 {
792 const Scalar T = fluidState.temperature(phaseIdx);
793 const Scalar p = fluidState.pressure(phaseIdx);
794
795 if (phaseIdx == phase0Idx)
796 {
797 if (componentIdx == H2OIdx)
798 return H2O::liquidEnthalpy(T, p);
799 else if (componentIdx == N2Idx)
800 DUNE_THROW(Dune::NotImplemented, "Component enthalpy of nitrogen in liquid phase");
801 else if (componentIdx == O2Idx)
802 DUNE_THROW(Dune::NotImplemented, "Component enthalpy of oxygen in liquid phase");
803 else
804 DUNE_THROW(Dune::InvalidStateException, "Invalid component index " << componentIdx);
805 }
806 else if (phaseIdx == phase1Idx)
807 {
808 if (componentIdx == H2OIdx)
809 return H2O::gasEnthalpy(T, p);
810 else if (componentIdx == N2Idx)
811 return N2::gasEnthalpy(T, p);
812 else if (componentIdx == O2Idx)
813 return O2::gasEnthalpy(T, p);
814 DUNE_THROW(Dune::InvalidStateException, "Invalid component index " << componentIdx);
815 }
816 DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
817 }
818
829 template <class FluidState>
830 static Scalar thermalConductivity(const FluidState &fluidState,
831 const int phaseIdx)
832 {
833 assert(0 <= phaseIdx && phaseIdx < numPhases);
834 Scalar temperature = fluidState.temperature(phaseIdx) ;
835 Scalar pressure = fluidState.pressure(phaseIdx);
836
837 if (phaseIdx == liquidPhaseIdx)
838 {
840 }
841 else
842 {
845 if (!Policy::useN2HeatConductivityAsGasMixtureHeatConductivity())
846 {
847 Scalar xN2 = fluidState.moleFraction(phaseIdx, N2Idx);
848 Scalar xO2 = fluidState.moleFraction(phaseIdx, O2Idx);
849 Scalar xH2O = fluidState.moleFraction(phaseIdx, H2OIdx);
850 Scalar lambdaN2 = xN2 * lambdaPureN2;
851 Scalar lambdaO2 = xO2 * lambdaPureO2;
852 Scalar partialPressure = pressure * xH2O;
853 Scalar lambdaH2O = xH2O * H2O::gasThermalConductivity(temperature, partialPressure);
854 return lambdaN2 + lambdaH2O + lambdaO2;
855 }
856 else
857 return lambdaPureN2;
858 }
859 }
860
861 using Base::heatCapacity;
869 template <class FluidState>
870 static Scalar heatCapacity(const FluidState &fluidState,
871 int phaseIdx)
872 {
873 if (phaseIdx == liquidPhaseIdx) {
874 return H2O::liquidHeatCapacity(fluidState.temperature(phaseIdx),
875 fluidState.pressure(phaseIdx));
876 }
877
878 Scalar c_pN2;
879 Scalar c_pO2;
880 Scalar c_pH2O;
881 // let the water and nitrogen components do things their own way
882 if (!Policy::useIdealGasHeatCapacities()) {
883 c_pN2 = N2::gasHeatCapacity(fluidState.temperature(phaseIdx),
884 fluidState.pressure(phaseIdx)
885 * fluidState.moleFraction(phaseIdx, N2Idx));
886
887 c_pH2O = H2O::gasHeatCapacity(fluidState.temperature(phaseIdx),
888 fluidState.pressure(phaseIdx)
889 * fluidState.moleFraction(phaseIdx, H2OIdx));
890 c_pO2 = O2::gasHeatCapacity(fluidState.temperature(phaseIdx),
891 fluidState.pressure(phaseIdx)
892 * fluidState.moleFraction(phaseIdx, O2Idx));
893 }
894 else {
895 // assume an ideal gas for both components. See:
896 //
897 //http://en.wikipedia.org/wiki/Heat_capacity
898 Scalar c_vN2molar = Constants::R*2.39;
899 Scalar c_pN2molar = Constants::R + c_vN2molar;
900
901 Scalar c_vO2molar = Constants::R*2.43;
902 Scalar c_pO2molar = Constants::R + c_vO2molar;
903
904 Scalar c_vH2Omolar = Constants::R*3.37; // <- correct??
905 Scalar c_pH2Omolar = Constants::R + c_vH2Omolar;
906
907 c_pN2 = c_pN2molar/molarMass(N2Idx);
908 c_pO2 = c_pO2molar/molarMass(O2Idx);
909 c_pH2O = c_pH2Omolar/molarMass(H2OIdx);
910 }
911
912 // mangle all components together
913 return
914 c_pH2O*fluidState.massFraction(gasPhaseIdx, H2OIdx)
915 + c_pN2*fluidState.massFraction(gasPhaseIdx, N2Idx)
916 + c_pO2*fluidState.massFraction(gasPhaseIdx, O2Idx);
917 }
918
919};
920
921} // end namespace FluidSystems
922} // end namespace Dumux
923
924#endif
Some exceptions thrown in DuMux
A collection of input/output field names for common physical quantities.
Relations valid for an ideal gas.
A central place for various physical constants occurring in some equations.
Material properties of pure water .
Tabulates all thermodynamic properties of a given untabulated chemical species.
Properties of pure molecular oxygen .
Properties of pure molecular nitrogen .
Binary coefficients for water and oxygen.
Binary coefficients for nitrogen and oxygen.
Binary coefficients for water and nitrogen.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
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 liquidPhase() noexcept
I/O name of liquid phase.
Definition: name.hh:119
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:34
Scalar h2oGasViscosityInMixture(Scalar temperature, Scalar pressure)
The dynamic viscosity of steam in a gas mixture.
Definition: h2o.hh:973
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient for molecular nitrogen in liquid water.
Definition: h2o_n2.hh:97
static Scalar henry(Scalar temperature)
Henry coefficient for molecular nitrogen in liquid water.
Definition: h2o_n2.hh:48
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for molecular water and nitrogen.
Definition: h2o_n2.hh:66
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for molecular water and oxygen.
Definition: h2o_o2.hh:66
static Scalar henry(Scalar temperature)
Henry coefficient for molecular oxygen in liquid water.
Definition: h2o_o2.hh:48
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient for molecular oxygen in liquid water.
Definition: h2o_o2.hh:97
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for molecular oxygen in liquid nitrogen.
Definition: n2_o2.hh:61
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 Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of at a given pressure and temperature.
Definition: n2.hh:243
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of gas in at a given pressure and temperature.
Definition: n2.hh:143
static std::string name()
A human readable name for nitrogen.
Definition: n2.hh:54
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of gas at a given pressure and temperature.
Definition: n2.hh:130
static constexpr Scalar molarMass()
The molar mass in of molecular nitrogen.
Definition: n2.hh:60
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of nitrogen.
Definition: n2.hh:281
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: n2.hh:155
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of pure nitrogen gas.
Definition: n2.hh:176
static const Scalar gasHeatCapacity(Scalar T, Scalar pressure)
Specific isobaric heat capacity of pure nitrogen gas.
Definition: n2.hh:213
Properties of pure molecular oxygen .
Definition: o2.hh:47
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of pure oxygen gas.
Definition: o2.hh:173
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure in , depending on pressure and temperature.
Definition: o2.hh:146
static constexpr Scalar criticalTemperature()
Returns the critical temperature in of molecular oxygen.
Definition: o2.hh:66
static std::string name()
A human readable name for the .
Definition: o2.hh:54
static constexpr Scalar molarMass()
The molar mass in of molecular oxygen.
Definition: o2.hh:60
static Scalar gasHeatCapacity(Scalar T, Scalar pressure)
Specific isobaric heat capacity of pure oxygen gas.
Definition: o2.hh:190
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of at a given pressure and temperature.
Definition: o2.hh:217
static constexpr Scalar criticalPressure()
Returns the critical pressure in of molecular oxygen.
Definition: o2.hh:72
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: o2.hh:152
static constexpr Scalar gasDensity(Scalar temperature, Scalar pressure)
The density in of pure at a given pressure and temperature.
Definition: o2.hh:134
static constexpr Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of nitrogen.
Definition: o2.hh:256
Tabulates all thermodynamic properties of a given component.
Definition: tabulatedcomponent.hh:684
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of the gas .
Definition: tabulatedcomponent.hh:829
static Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition: tabulatedcomponent.hh:775
static const Scalar gasHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the gas .
Definition: tabulatedcomponent.hh:865
static std::string name()
A human readable name for the component.
Definition: tabulatedcomponent.hh:763
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
The thermal conductivity of liquid water .
Definition: tabulatedcomponent.hh:1093
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of gas at a given pressure and temperature .
Definition: tabulatedcomponent.hh:979
static const Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of the liquid .
Definition: tabulatedcomponent.hh:847
static Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition: tabulatedcomponent.hh:781
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of liquid in at a given pressure and temperature.
Definition: tabulatedcomponent.hh:1030
static constexpr Scalar molarMass()
The molar mass in of the component.
Definition: tabulatedcomponent.hh:769
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of liquid.
Definition: tabulatedcomponent.hh:1057
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition: tabulatedcomponent.hh:962
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of liquid at a given pressure and temperature .
Definition: tabulatedcomponent.hh:1009
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
The thermal conductivity of gaseous water .
Definition: tabulatedcomponent.hh:1075
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of gas in at a given pressure and temperature.
Definition: tabulatedcomponent.hh:999
static constexpr bool isTabulated
state that we are tabulated
Definition: tabulatedcomponent.hh:728
static Scalar vaporPressure(Scalar T)
The vapor pressure in of the component at a given temperature.
Definition: tabulatedcomponent.hh:802
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:740
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: tabulatedcomponent.hh:968
static const Scalar liquidHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the liquid .
Definition: tabulatedcomponent.hh:883
A central place for various physical constants occurring in some equations.
Definition: constants.hh:39
static constexpr Scalar R
The ideal gas constant .
Definition: constants.hh:44
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 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
Policy for the H2O-N2-O2 fluid system.
Definition: h2on2o2.hh:56
static constexpr bool useIdealGasDensity()
Definition: h2on2o2.hh:58
static constexpr bool useIdealGasHeatCapacities()
Definition: h2on2o2.hh:61
static constexpr bool useH2ODensityAsLiquidMixtureDensity()
Definition: h2on2o2.hh:57
static constexpr bool useN2ViscosityAsGasMixtureViscosity()
Definition: h2on2o2.hh:59
static constexpr bool useN2HeatConductivityAsGasMixtureHeatConductivity()
Definition: h2on2o2.hh:60
A two-phase (water and air) fluid system with water, nitrogen and oxygen as components.
Definition: h2on2o2.hh:77
static std::string phaseName(int phaseIdx)
Return the human readable name of a fluid phase.
Definition: h2on2o2.hh:123
static constexpr int comp1Idx
Definition: h2on2o2.hh:108
static Scalar criticalTemperature(int compIdx)
Critical temperature of a component .
Definition: h2on2o2.hh:250
static constexpr int numSPhases
Definition: h2on2o2.hh:96
static constexpr bool isGas(int phaseIdx)
Return whether a phase is gaseous.
Definition: h2on2o2.hh:139
static constexpr int N2Idx
Definition: h2on2o2.hh:104
static constexpr int H2OIdx
Definition: h2on2o2.hh:103
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:682
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy of a component in a specific phase.
Definition: h2on2o2.hh:788
static Scalar molarMass(int compIdx)
Return the molar mass of a component in .
Definition: h2on2o2.hh:233
static bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: h2on2o2.hh:193
static constexpr int phase1Idx
index of the second phase
Definition: h2on2o2.hh:101
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition: h2on2o2.hh:205
static std::string componentName(int compIdx)
Return the human readable name of a component.
Definition: h2on2o2.hh:216
static constexpr int liquidPhaseIdx
index of the liquid phase
Definition: h2on2o2.hh:98
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Returns the fugacity coefficient of a component in a phase.
Definition: h2on2o2.hh:613
static constexpr int gasPhaseMainCompIdx
Definition: h2on2o2.hh:113
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: h2on2o2.hh:177
static Scalar kelvinVaporPressure(const FluidState &fluidState, const int phaseIdx, const int compIdx, const Scalar radius)
Kelvin equation in .
Definition: h2on2o2.hh:319
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:445
static Scalar acentricFactor(int compIdx)
The acentric factor of a component .
Definition: h2on2o2.hh:295
static constexpr int phase0Idx
index of the first phase
Definition: h2on2o2.hh:100
static void init()
Initialize the fluid system's static parameters generically.
Definition: h2on2o2.hh:393
static constexpr int numPhases
Number of phases in the fluid system.
Definition: h2on2o2.hh:94
static constexpr int liquidPhaseMainCompIdx
Definition: h2on2o2.hh:112
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
The molar density of a fluid phase in .
Definition: h2on2o2.hh:503
static Scalar kelvinVaporPressure(const FluidState &fluidState, const int phaseIdx, const int compIdx)
Vapor pressure including the Kelvin equation in .
Definition: h2on2o2.hh:348
static bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: h2on2o2.hh:159
static constexpr int gasPhaseIdx
index of the gas phase
Definition: h2on2o2.hh:99
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Specific isobaric heat capacity of a fluid phase. .
Definition: h2on2o2.hh:870
static Scalar thermalConductivity(const FluidState &fluidState, const int phaseIdx)
Thermal conductivity of a fluid phase .
Definition: h2on2o2.hh:830
static Scalar criticalPressure(int compIdx)
Critical pressure of a component .
Definition: h2on2o2.hh:267
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the molecular diffusion coefficient for a component in a fluid phase .
Definition: h2on2o2.hh:663
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Calculate the dynamic viscosity of a fluid phase .
Definition: h2on2o2.hh:541
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy .
Definition: h2on2o2.hh:754
static constexpr int O2Idx
Definition: h2on2o2.hh:105
static constexpr int comp0Idx
Definition: h2on2o2.hh:107
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:371
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:414
static constexpr int comp2Idx
Definition: h2on2o2.hh:109
static constexpr int numComponents
Number of components in the fluid system.
Definition: h2on2o2.hh:95
static Scalar criticalMolarVolume(int compIdx)
Molar volume of a component at the critical point .
Definition: h2on2o2.hh:284
Relations valid for an ideal 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:70
Fluid system base class.