Line | Branch | Exec | Source |
---|---|---|---|
1 | // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- | ||
2 | // vi: set et ts=4 sw=4 sts=4: | ||
3 | // | ||
4 | // SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder | ||
5 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
6 | // | ||
7 | /*! | ||
8 | * \file | ||
9 | * \ingroup FluidSystems | ||
10 | * \brief @copydoc Dumux::FluidSystems::H2ON2Kinetic | ||
11 | */ | ||
12 | #ifndef DUMUX_H2O_N2_FLUID_SYSTEM_KINETIC_HH | ||
13 | #define DUMUX_H2O_N2_FLUID_SYSTEM_KINETIC_HH | ||
14 | |||
15 | #include <dumux/material/components/simpleh2o.hh> | ||
16 | #include <dumux/material/components/h2o.hh> | ||
17 | #include <dumux/material/components/n2.hh> | ||
18 | #include <dumux/material/components/tabulatedcomponent.hh> | ||
19 | #include <dumux/material/idealgas.hh> | ||
20 | |||
21 | #include <dumux/material/binarycoefficients/h2o_n2.hh> | ||
22 | |||
23 | #include <dumux/material/fluidsystems/base.hh> | ||
24 | #include <dumux/material/fluidsystems/h2on2.hh> | ||
25 | |||
26 | namespace Dumux { | ||
27 | namespace FluidSystems { | ||
28 | |||
29 | /*! | ||
30 | * \ingroup FluidSystems | ||
31 | * \brief A two-phase fluid system with two components water \f$(\mathrm{H_2O})\f$ | ||
32 | * Nitrogen \f$(\mathrm{N_2})\f$ for non-equilibrium models. TODO: Is this fluid system necessary?? | ||
33 | */ | ||
34 | template <class Scalar, class Policy = H2ON2DefaultPolicy<>> | ||
35 | class H2ON2Kinetic : | ||
36 | public FluidSystems::H2ON2<Scalar, Policy> | ||
37 | { | ||
38 | private: | ||
39 | using ParentType = FluidSystems::H2ON2<Scalar, Policy>; | ||
40 | |||
41 | using IdealGas = Dumux::IdealGas<Scalar>; | ||
42 | public: | ||
43 | //! The type of parameter cache objects | ||
44 | using ParameterCache = NullParameterCache; | ||
45 | |||
46 | /*! | ||
47 | * \brief Return the enthalpy of a component in a phase. | ||
48 | * \param fluidState A container with the current (physical) state of the fluid | ||
49 | * \param phaseIdx The index of the phase to consider | ||
50 | * \param compIdx The index of the component to consider | ||
51 | */ | ||
52 | template <class FluidState> | ||
53 | 9448320 | static Scalar componentEnthalpy(FluidState &fluidState, | |
54 | const int phaseIdx, | ||
55 | const int compIdx) | ||
56 | { | ||
57 |
2/3✓ Branch 0 taken 4724160 times.
✓ Branch 1 taken 4724160 times.
✗ Branch 2 not taken.
|
9448320 | const Scalar T = fluidState.temperature(phaseIdx); |
58 |
2/3✓ Branch 0 taken 4724160 times.
✓ Branch 1 taken 4724160 times.
✗ Branch 2 not taken.
|
9448320 | const Scalar p = fluidState.pressure(phaseIdx); |
59 | |||
60 |
2/3✓ Branch 0 taken 4724160 times.
✓ Branch 1 taken 4724160 times.
✗ Branch 2 not taken.
|
9448320 | switch (phaseIdx) { |
61 | 4724160 | case ParentType::liquidPhaseIdx: | |
62 |
2/3✓ Branch 0 taken 2362080 times.
✓ Branch 1 taken 2362080 times.
✗ Branch 2 not taken.
|
4724160 | switch(compIdx) { |
63 | 2362080 | case ParentType::H2OIdx: | |
64 | 2362080 | return ParentType::H2O::liquidEnthalpy(T, p); | |
65 | case ParentType::N2Idx: | ||
66 | 2362080 | return ParentType::N2::gasEnthalpy(T, p); // TODO: should be liquid enthalpy | |
67 | ✗ | default: | |
68 | ✗ | DUNE_THROW(Dune::NotImplemented, "wrong index"); | |
69 | } | ||
70 | 4724160 | case ParentType::gasPhaseIdx: | |
71 |
2/3✓ Branch 0 taken 2362080 times.
✓ Branch 1 taken 2362080 times.
✗ Branch 2 not taken.
|
4724160 | switch(compIdx) { |
72 | 2362080 | case ParentType::H2OIdx: | |
73 | 2362080 | return ParentType::H2O::gasEnthalpy(T, p); | |
74 | case ParentType::N2Idx: | ||
75 | 2362080 | return ParentType::N2::gasEnthalpy(T, p); | |
76 | ✗ | default: | |
77 | ✗ | DUNE_THROW(Dune::NotImplemented, "wrong index"); | |
78 | } | ||
79 | ✗ | default: | |
80 | ✗ | DUNE_THROW(Dune::NotImplemented, "wrong index"); | |
81 | } | ||
82 | } | ||
83 | |||
84 | /*! | ||
85 | * \brief Return the Henry constant for a component in a phase. \f$\mathrm{[Pa]}\f$ | ||
86 | * \param temperature The given temperature | ||
87 | */ | ||
88 | static Scalar henry(Scalar temperature) | ||
89 | { | ||
90 | return BinaryCoeff::H2O_N2::henry(temperature); | ||
91 | } | ||
92 | |||
93 | /*! | ||
94 | * \brief Return the vapor pressure of a component above one phase. \f$\mathrm{[Pa]}\f$ | ||
95 | * \param temperature The given temperature | ||
96 | */ | ||
97 | static Scalar vaporPressure(Scalar temperature) | ||
98 | { | ||
99 | return ParentType::H2O::vaporPressure(temperature); | ||
100 | } | ||
101 | }; | ||
102 | } // end namespace Fluidsystem | ||
103 | } // end namespace Dumux | ||
104 | |||
105 | #endif | ||
106 |