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