3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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 * 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 *****************************************************************************/
24#ifndef DUMUX_H2O_N2_FLUID_SYSTEM_HH
25#define DUMUX_H2O_N2_FLUID_SYSTEM_HH
26
27#include <cassert>
28#include <iomanip>
29
31
33
38
39#include <dumux/io/name.hh>
40
41#include "base.hh"
42
43namespace Dumux {
44namespace FluidSystems {
49template<bool fastButSimplifiedRelations = false>
51{
52 static constexpr bool useH2ODensityAsLiquidMixtureDensity() { return fastButSimplifiedRelations; }
53 static constexpr bool useIdealGasDensity() { return fastButSimplifiedRelations; }
54 static constexpr bool useN2ViscosityAsGasMixtureViscosity() { return fastButSimplifiedRelations; }
55 static constexpr bool useN2HeatConductivityAsGasMixtureHeatConductivity() { return fastButSimplifiedRelations; }
56 static constexpr bool useIdealGasHeatCapacities() { return fastButSimplifiedRelations; }
57};
58
65template <class Scalar, class Policy = H2ON2DefaultPolicy<>>
66class H2ON2
67 : public Base<Scalar, H2ON2<Scalar, Policy> >
68{
71
72 // convenience using declarations
76
77public:
78 using H2O = TabulatedH2O;
79 using N2 = SimpleN2;
80
81 static constexpr int numPhases = 2;
82 static constexpr int numComponents = 2;
83
84 static constexpr int liquidPhaseIdx = 0;
85 static constexpr int gasPhaseIdx = 1;
86 static constexpr int phase0Idx = liquidPhaseIdx;
87 static constexpr int phase1Idx = gasPhaseIdx;
88
89 static constexpr int H2OIdx = 0;
90 static constexpr int N2Idx = 1;
91 static constexpr int comp0Idx = H2OIdx;
92 static constexpr int comp1Idx = N2Idx;
93 static constexpr int liquidCompIdx = H2OIdx;
94 static constexpr int gasCompIdx = N2Idx;
95
96 /****************************************
97 * Fluid phase related static parameters
98 ****************************************/
104 static std::string phaseName(int phaseIdx)
105 {
106 assert(0 <= phaseIdx && phaseIdx < numPhases);
107 switch (phaseIdx)
108 {
109 case liquidPhaseIdx: return IOName::liquidPhase();
110 case gasPhaseIdx: return IOName::gaseousPhase();
111 }
112 DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
113 }
114
118 static constexpr bool isMiscible()
119 { return true; }
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
184 if (phaseIdx == gasPhaseIdx)
185 // let the components decide
186 return H2O::gasIsIdeal() && N2::gasIsIdeal();
187 return false; // not a gas
188 }
189
190 /****************************************
191 * Component related static parameters
192 ****************************************/
198 static std::string componentName(int compIdx)
199 {
200 switch (compIdx)
201 {
202 case H2OIdx: return H2O::name();
203 case N2Idx: return N2::name();
204 }
205
206 DUNE_THROW(Dune::InvalidStateException, "Invalid component index " << compIdx);
207 }
208
214 static Scalar molarMass(int compIdx)
215 {
216 static const Scalar M[] = {
219 };
220
221 assert(0 <= compIdx && compIdx < numComponents);
222 return M[compIdx];
223 }
224
230 static Scalar criticalTemperature(int compIdx)
231 {
232 static const Scalar Tcrit[] = {
235 };
236
237 assert(0 <= compIdx && compIdx < numComponents);
238 return Tcrit[compIdx];
239 }
240
246 static Scalar criticalPressure(int compIdx)
247 {
248 static const Scalar pcrit[] = {
251 };
252
253 assert(0 <= compIdx && compIdx < numComponents);
254 return pcrit[compIdx];
255 }
256
266 template <class FluidState>
267 static Scalar kelvinVaporPressure(const FluidState &fluidState,
268 const int phaseIdx,
269 const int compIdx)
270 {
271 assert(compIdx == H2OIdx && phaseIdx == liquidPhaseIdx);
272
273 using std::exp;
274 return fugacityCoefficient(fluidState, phaseIdx, compIdx)
275 * fluidState.pressure(phaseIdx)
276 * exp(-(fluidState.pressure(gasPhaseIdx)-fluidState.pressure(liquidPhaseIdx))
277 / density(fluidState, phaseIdx)
279 / fluidState.temperature());
280 }
281
287 static Scalar criticalMolarVolume(int compIdx)
288 {
289 DUNE_THROW(Dune::NotImplemented,
290 "H2ON2FluidSystem::criticalMolarVolume()");
291 }
292
298 static Scalar acentricFactor(int compIdx)
299 {
300 static const Scalar accFac[] = {
301 H2O::acentricFactor(),
302 N2::acentricFactor()
303 };
304
305 assert(0 <= compIdx && compIdx < numComponents);
306 return accFac[compIdx];
307 }
308
309 /****************************************
310 * thermodynamic relations
311 ****************************************/
312
319 static void init()
320 {
321 init(/*tempMin=*/273.15,
322 /*tempMax=*/623.15,
323 /*numTemp=*/100,
324 /*pMin=*/0.0,
325 /*pMax=*/20e6,
326 /*numP=*/200);
327 }
328
340 static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp,
341 Scalar pressMin, Scalar pressMax, unsigned nPress)
342 {
343 std::cout << "The H2O-N2 fluid system was configured with the following policy:\n";
344 std::cout << " - use H2O density as liquid mixture density: " << std::boolalpha << Policy::useH2ODensityAsLiquidMixtureDensity() << "\n";
345 std::cout << " - use ideal gas density: " << std::boolalpha << Policy::useIdealGasDensity() << "\n";
346 std::cout << " - use N2 viscosity as gas mixture viscosity: " << std::boolalpha << Policy::useN2ViscosityAsGasMixtureViscosity() << "\n";
347 std::cout << " - use N2 heat conductivity as gas mixture heat conductivity: " << std::boolalpha << Policy::useN2HeatConductivityAsGasMixtureHeatConductivity() << "\n";
348 std::cout << " - use ideal gas heat capacities: " << std::boolalpha << Policy::useIdealGasHeatCapacities() << std::endl;
349
350 if constexpr (H2O::isTabulated)
351 H2O::init(tempMin, tempMax, nTemp, pressMin, pressMax, nPress);
352 }
353
354 using Base::density;
367 template <class FluidState>
368 static Scalar density(const FluidState &fluidState,
369 int phaseIdx)
370 {
371 assert(0 <= phaseIdx && phaseIdx < numPhases);
372
373 Scalar T = fluidState.temperature(phaseIdx);
374 Scalar p = fluidState.pressure(phaseIdx);
375
376 // liquid phase
377 if (phaseIdx == liquidPhaseIdx) {
378 if (Policy::useH2ODensityAsLiquidMixtureDensity())
379 // assume pure water
380 return H2O::liquidDensity(T, p);
381 else
382 {
383 // See: Eq. (7) in Class et al. (2002a)
384 // This assumes each gas molecule displaces exactly one
385 // molecule in the liquid.
386 return H2O::liquidMolarDensity(T, p)
387 * (H2O::molarMass()*fluidState.moleFraction(liquidPhaseIdx, H2OIdx)
388 + N2::molarMass()*fluidState.moleFraction(liquidPhaseIdx, N2Idx));
389 }
390 }
391
392 // gas phase
393 using std::max;
394 if (Policy::useIdealGasDensity())
395 // for the gas phase assume an ideal gas
396 {
397 const Scalar averageMolarMass = fluidState.averageMolarMass(gasPhaseIdx);
398 return IdealGas::density(averageMolarMass, T, p);
399 }
400
401 // assume ideal mixture: steam and nitrogen don't "see" each other
402 Scalar rho_gH2O = H2O::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, H2OIdx));
403 Scalar rho_gN2 = N2::gasDensity(T, fluidState.partialPressure(gasPhaseIdx, N2Idx));
404 return (rho_gH2O + rho_gN2);
405 }
406
407 using Base::molarDensity;
420 template <class FluidState>
421 static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
422 {
423 assert(0 <= phaseIdx && phaseIdx < numPhases);
424
425 Scalar T = fluidState.temperature(phaseIdx);
426 Scalar p = fluidState.pressure(phaseIdx);
427
428 // liquid phase
429 if (phaseIdx == liquidPhaseIdx)
430 {
431 // assume pure water or that each gas molecule displaces exactly one
432 // molecule in the liquid.
433 return H2O::liquidMolarDensity(T, p);
434 }
435
436 // gas phase
437 using std::max;
438 if (Policy::useIdealGasDensity())
439 // for the gas phase assume an ideal gas
440 {
441 return IdealGas::molarDensity(T, p);
442 }
443
444 // assume ideal mixture: steam and nitrogen don't "see" each other
445 Scalar rho_gH2O = H2O::gasMolarDensity(T, fluidState.partialPressure(gasPhaseIdx, H2OIdx));
446 Scalar rho_gN2 = N2::gasMolarDensity(T, fluidState.partialPressure(gasPhaseIdx, N2Idx));
447 return rho_gH2O + rho_gN2;
448 }
449
450 using Base::viscosity;
463 template <class FluidState>
464 static Scalar viscosity(const FluidState &fluidState,
465 int phaseIdx)
466 {
467 assert(0 <= phaseIdx && phaseIdx < numPhases);
468
469 Scalar T = fluidState.temperature(phaseIdx);
470 Scalar p = fluidState.pressure(phaseIdx);
471
472 // liquid phase
473 if (phaseIdx == liquidPhaseIdx) {
474 // assume pure water for the liquid phase
475 return H2O::liquidViscosity(T, p);
476 }
477
478 // gas phase
479 if (Policy::useN2ViscosityAsGasMixtureViscosity())
480 {
481 // assume pure nitrogen for the gas phase
482 return N2::gasViscosity(T, p);
483 }
484 else
485 {
486 // Wilke method (Reid et al.):
487 Scalar muResult = 0;
488 const Scalar mu[numComponents] = {
490 N2::gasViscosity(T, p)
491 };
492
493 Scalar sumx = 0.0;
494 using std::max;
495 for (int compIdx = 0; compIdx < numComponents; ++compIdx)
496 sumx += fluidState.moleFraction(phaseIdx, compIdx);
497 sumx = max(1e-10, sumx);
498
499 for (int i = 0; i < numComponents; ++i) {
500 Scalar divisor = 0;
501// using std::sqrt;
502// using std::pow;
503 for (int j = 0; j < numComponents; ++j) {
504 Scalar phiIJ = 1 + sqrt(mu[i]/mu[j]) * pow(molarMass(j)/molarMass(i), 1/4.0);
505 phiIJ *= phiIJ;
506 phiIJ /= sqrt(8*(1 + molarMass(i)/molarMass(j)));
507 divisor += fluidState.moleFraction(phaseIdx, j)/sumx * phiIJ;
508 }
509 muResult += fluidState.moleFraction(phaseIdx, i)/sumx * mu[i] / divisor;
510 }
511
512 return muResult;
513 }
514 }
515
544 template <class FluidState>
545 static Scalar fugacityCoefficient(const FluidState &fluidState,
546 int phaseIdx,
547 int compIdx)
548 {
549 assert(0 <= phaseIdx && phaseIdx < numPhases);
550 assert(0 <= compIdx && compIdx < numComponents);
551
552 Scalar T = fluidState.temperature(phaseIdx);
553 Scalar p = fluidState.pressure(phaseIdx);
554
555 // liquid phase
556 if (phaseIdx == liquidPhaseIdx) {
557 if (compIdx == H2OIdx)
558 return H2O::vaporPressure(T)/p;
559 return BinaryCoeff::H2O_N2::henry(T)/p;
560 }
561
562 // for the gas phase, assume an ideal gas when it comes to
563 // fugacity (-> fugacity == partial pressure)
564 return 1.0;
565 }
566
591 template <class FluidState>
592 static Scalar diffusionCoefficient(const FluidState &fluidState,
593 int phaseIdx,
594 int compIdx)
595 {
596 DUNE_THROW(Dune::NotImplemented, "Diffusion coefficients");
597 }
598
610 template <class FluidState>
611 static Scalar binaryDiffusionCoefficient(const FluidState &fluidState,
612 int phaseIdx,
613 int compIIdx,
614 int compJIdx)
615
616 {
617 if (compIIdx > compJIdx)
618 {
619 using std::swap;
620 swap(compIIdx, compJIdx);
621 }
622
623 const Scalar T = fluidState.temperature(phaseIdx);
624 const Scalar p = fluidState.pressure(phaseIdx);
625
626 if (phaseIdx == liquidPhaseIdx && compIIdx == H2OIdx && compJIdx == N2Idx)
628
629 else if (phaseIdx == gasPhaseIdx && compIIdx == H2OIdx && compJIdx == N2Idx)
631
632 else
633 DUNE_THROW(Dune::InvalidStateException,
634 "Binary diffusion coefficient of components "
635 << compIIdx << " and " << compJIdx
636 << " in phase " << phaseIdx << " is unavailable!\n");
637 }
638
639 using Base::enthalpy;
652 template <class FluidState>
653 static Scalar enthalpy(const FluidState &fluidState,
654 int phaseIdx)
655 {
656 const Scalar T = fluidState.temperature(phaseIdx);
657 const Scalar p = fluidState.pressure(phaseIdx);
658
659 // liquid phase
660 if (phaseIdx == liquidPhaseIdx) {
661 return H2O::liquidEnthalpy(T, p);
662 }
663 // gas phase
664 else {
665 // assume ideal mixture: which means
666 // that the total specific enthalpy is the sum of the
667 // "partial specific enthalpies" of the components.
668 Scalar hH2O =
669 fluidState.massFraction(gasPhaseIdx, H2OIdx)
670 * H2O::gasEnthalpy(T, p);
671 Scalar hN2 =
672 fluidState.massFraction(gasPhaseIdx, N2Idx)
673 * N2::gasEnthalpy(T, p);
674 return hH2O + hN2;
675 }
676 }
677
684 template <class FluidState>
685 static Scalar componentEnthalpy(const FluidState &fluidState,
686 int phaseIdx,
687 int componentIdx)
688 {
689 const Scalar T = fluidState.temperature(phaseIdx);
690 const Scalar p = fluidState.pressure(phaseIdx);
691
692 if (phaseIdx == liquidPhaseIdx)
693 {
694 if (componentIdx == H2OIdx)
695 return H2O::liquidEnthalpy(T, p);
696 else if (componentIdx == N2Idx)
697 DUNE_THROW(Dune::NotImplemented, "Component enthalpy of nitrogen in liquid phase");
698 else
699 DUNE_THROW(Dune::InvalidStateException, "Invalid component index " << componentIdx);
700 }
701 else if (phaseIdx == gasPhaseIdx)
702 {
703 if (componentIdx == H2OIdx)
704 return H2O::gasEnthalpy(T, p);
705 else if (componentIdx == N2Idx)
706 return N2::gasEnthalpy(T, p);
707 else
708 DUNE_THROW(Dune::InvalidStateException, "Invalid component index " << componentIdx);
709 }
710 else
711 DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
712 }
713
723 template <class FluidState>
724 static Scalar thermalConductivity(const FluidState &fluidState,
725 const int phaseIdx)
726 {
727 assert(0 <= phaseIdx && phaseIdx < numPhases);
728
729 const Scalar temperature = fluidState.temperature(phaseIdx) ;
730 const Scalar pressure = fluidState.pressure(phaseIdx);
731 if (phaseIdx == liquidPhaseIdx)
732 {
734 }
735 else
736 {
738 if (!Policy::useN2HeatConductivityAsGasMixtureHeatConductivity())
739 {
740 Scalar xN2 = fluidState.moleFraction(phaseIdx, N2Idx);
741 Scalar xH2O = fluidState.moleFraction(phaseIdx, H2OIdx);
742 Scalar lambdaN2 = xN2 * lambdaPureN2;
743 Scalar partialPressure = pressure * xH2O;
744 Scalar lambdaH2O = xH2O * H2O::gasThermalConductivity(temperature, partialPressure);
745 return lambdaN2 + lambdaH2O;
746 }
747 else
748 return lambdaPureN2;
749 }
750 }
751
752 using Base::heatCapacity;
760 template <class FluidState>
761 static Scalar heatCapacity(const FluidState &fluidState,
762 int phaseIdx)
763 {
764 if (phaseIdx == liquidPhaseIdx) {
765 return H2O::liquidHeatCapacity(fluidState.temperature(phaseIdx),
766 fluidState.pressure(phaseIdx));
767 }
768
769 // for the gas phase, assume ideal mixture
770 Scalar c_pN2;
771 Scalar c_pH2O;
772 // let the water and nitrogen components do things their own way
773 if (!Policy::useIdealGasHeatCapacities()) {
774 c_pN2 = N2::gasHeatCapacity(fluidState.temperature(phaseIdx),
775 fluidState.pressure(phaseIdx)
776 * fluidState.moleFraction(phaseIdx, N2Idx));
777
778 c_pH2O = H2O::gasHeatCapacity(fluidState.temperature(phaseIdx),
779 fluidState.pressure(phaseIdx)
780 * fluidState.moleFraction(phaseIdx, H2OIdx));
781 }
782 else {
783 // assume an ideal gas for both components. See:
784 // http://en.wikipedia.org/wiki/Heat_capacity
785 Scalar c_vN2molar = Constants<Scalar>::R*2.39;
786 Scalar c_pN2molar = Constants<Scalar>::R + c_vN2molar;
787
788 Scalar c_vH2Omolar = Constants<Scalar>::R*3.37; // <- correct??
789 Scalar c_pH2Omolar = Constants<Scalar>::R + c_vH2Omolar;
790
791 c_pN2 = c_pN2molar/molarMass(N2Idx);
792 c_pH2O = c_pH2Omolar/molarMass(H2OIdx);
793 }
794
795 // mangle both components together
796 return c_pH2O*fluidState.massFraction(gasPhaseIdx, H2OIdx)
797 + c_pN2*fluidState.massFraction(gasPhaseIdx, N2Idx);
798 }
799};
800
801} // end namespace FluidSystems
802
803} // end namespace Dumux
804
805#endif
Some exceptions thrown in DuMux
A collection of input/output field names for common physical quantities.
Binary coefficients for water and nitrogen.
Material properties of pure water .
Properties of pure molecular nitrogen .
Tabulates all thermodynamic properties of a given untabulated chemical species.
Relations valid for an ideal gas.
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
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
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
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 fluid system.
Definition: h2on2.hh:51
static constexpr bool useIdealGasHeatCapacities()
Definition: h2on2.hh:56
static constexpr bool useN2HeatConductivityAsGasMixtureHeatConductivity()
Definition: h2on2.hh:55
static constexpr bool useIdealGasDensity()
Definition: h2on2.hh:53
static constexpr bool useH2ODensityAsLiquidMixtureDensity()
Definition: h2on2.hh:52
static constexpr bool useN2ViscosityAsGasMixtureViscosity()
Definition: h2on2.hh:54
A two-phase fluid system with two components water Nitrogen for non-equilibrium models.
Definition: h2on2.hh:68
static constexpr bool isGas(int phaseIdx)
Return whether a phase is gaseous.
Definition: h2on2.hh:126
static constexpr int liquidPhaseIdx
index of the liquid phase
Definition: h2on2.hh:84
static bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: h2on2.hh:146
static Scalar molarMass(int compIdx)
Return the molar mass of a component in .
Definition: h2on2.hh:214
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Specific isobaric heat capacity of a fluid phase. .
Definition: h2on2.hh:761
static Scalar thermalConductivity(const FluidState &fluidState, const int phaseIdx)
Thermal conductivity of a fluid phase .
Definition: h2on2.hh:724
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:611
static constexpr int phase1Idx
index of the second phase
Definition: h2on2.hh:87
static constexpr int liquidCompIdx
index of the liquid component
Definition: h2on2.hh:93
static Scalar criticalMolarVolume(int compIdx)
Molar volume of a component at the critical point .
Definition: h2on2.hh:287
static constexpr int N2Idx
Definition: h2on2.hh:90
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: h2on2.hh:164
static constexpr int comp1Idx
index of the second component
Definition: h2on2.hh:92
static constexpr int gasPhaseIdx
index of the gas phase
Definition: h2on2.hh:85
static std::string componentName(int compIdx)
Return the human readable name of a component.
Definition: h2on2.hh:198
static constexpr int H2OIdx
Definition: h2on2.hh:89
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:340
static void init()
Initialize the fluid system's static parameters generically.
Definition: h2on2.hh:319
static constexpr int comp0Idx
index of the first component
Definition: h2on2.hh:91
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy of a component in the specified phase.
Definition: h2on2.hh:685
static Scalar acentricFactor(int compIdx)
The acentric factor of a component .
Definition: h2on2.hh:298
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:545
static constexpr int phase0Idx
index of the first phase
Definition: h2on2.hh:86
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:368
static Scalar kelvinVaporPressure(const FluidState &fluidState, const int phaseIdx, const int compIdx)
Vapor pressure including the Kelvin equation in .
Definition: h2on2.hh:267
static Scalar criticalPressure(int compIdx)
Critical pressure of a component .
Definition: h2on2.hh:246
static constexpr int numComponents
Number of components in the fluid system.
Definition: h2on2.hh:82
static constexpr int numPhases
Number of phases in the fluid system.
Definition: h2on2.hh:81
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition: h2on2.hh:118
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
The molar density of a fluid phase in .
Definition: h2on2.hh:421
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy .
Definition: h2on2.hh:653
static constexpr int gasCompIdx
index of the gas component
Definition: h2on2.hh:94
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the molecular diffusion coefficient for a component in a fluid phase .
Definition: h2on2.hh:592
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Calculate the dynamic viscosity of a fluid phase .
Definition: h2on2.hh:464
static bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: h2on2.hh:180
static Scalar criticalTemperature(int compIdx)
Critical temperature of a component .
Definition: h2on2.hh:230
static std::string phaseName(int phaseIdx)
Return the human readable name of a fluid phase.
Definition: h2on2.hh:104
Relations valid for an ideal gas.
Definition: idealgas.hh:37
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:49
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.