opm-common
Unit.hpp
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  This file is part of the Open Porous Media project (OPM).
5 
6  OPM 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 2 of the License, or
9  (at your option) any later version.
10 
11  OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
18 
19  Consult the COPYING file in the top-level source directory of this
20  module for the precise wording of the license and the list of
21  copyright holders.
22 */
27 #ifndef OPM_UNIT_HPP
28 #define OPM_UNIT_HPP
29 
30 #include "Component.hpp"
31 
32 #include <string_view>
33 
34 namespace Opm
35 {
46 template <class Scalar>
47 class Unit : public Component<Scalar, Unit<Scalar> >
48 {
49 
50 public:
54  static std::string_view name()
55  { return "Unit"; }
56 
60  static Scalar molarMass()
61  { return 1.0; }
62 
66  static Scalar criticalTemperature()
67  { return 1.0; }
68 
72  static Scalar criticalPressure()
73  { return 1.0; }
74 
78  static Scalar tripleTemperature()
79  { return 1.0; }
80 
84  static Scalar triplePressure()
85  { return 1.0; }
86 
90  template <class Evaluation>
91  static Evaluation vaporPressure(const Evaluation& /* temperature */)
92  { return 1.0; }
93 
97  static bool liquidIsCompressible()
98  { return false; }
99 
103  static bool gasIsCompressible()
104  { return false; }
105 
109  static bool gasIsIdeal()
110  { return false; }
111 
115  template <class Evaluation>
116  static Evaluation liquidDensity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
117  { return 1.0; }
118 
122  template <class Evaluation>
123  static Evaluation liquidViscosity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
124  { return 1.0; }
125 
129  template <class Evaluation>
130  static Evaluation gasDensity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
131  { return 1.0; }
132 
136  template <class Evaluation>
137  static Evaluation gasViscosity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
138  { return 1.0; }
139 
140 
144  template <class Evaluation>
145  static Evaluation gasEnthalpy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
146  { return 1.0; }
147 
151  template <class Evaluation>
152  static Evaluation liquidEnthalpy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
153  { return 1.0; }
154 
158  template <class Evaluation>
159  static Evaluation gasInternalEnergy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
160  { return 1.0; }
161 
165  template <class Evaluation>
166  static Evaluation liquidInternalEnergy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
167  { return 1.0; }
168 
172  template <class Evaluation>
173  static Evaluation gasThermalConductivity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
174  { return 1.0; }
175 
179  template <class Evaluation>
180  static Evaluation liquidThermalConductivity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
181  { return 1.0; }
182 
186  template <class Evaluation>
187  static Evaluation gasHeatCapacity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
188  { return 1.0; }
189 
193  template <class Evaluation>
194  static Evaluation liquidHeatCapacity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
195  { return 1.0; }
196 };
197 
198 } // namespace Opm
199 
200 #endif
static Scalar molarMass()
The molar mass in of the component.
Definition: Unit.hpp:60
static std::string_view name()
A human readable name for the component.
Definition: Unit.hpp:54
static Evaluation liquidThermalConductivity(const Evaluation &, const Evaluation &)
Thermal conductivity of the component [W/(m^2 K/m)] as a liquid.
Definition: Unit.hpp:180
static Evaluation liquidInternalEnergy(const Evaluation &, const Evaluation &)
Specific internal energy of pure the pure component in liquid.
Definition: Unit.hpp:166
static Evaluation gasThermalConductivity(const Evaluation &, const Evaluation &)
Thermal conductivity of the component [W/(m^2 K/m)] as a gas.
Definition: Unit.hpp:173
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition: Unit.hpp:97
Abstract base class of a pure chemical species.
Definition: Component.hpp:43
static Evaluation gasViscosity(const Evaluation &, const Evaluation &)
The dynamic viscosity of the pure component at a given pressure in and temperature in ...
Definition: Unit.hpp:137
static Evaluation liquidDensity(const Evaluation &, const Evaluation &)
The density of the liquid component at a given pressure in and temperature in . ...
Definition: Unit.hpp:116
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: Unit.hpp:109
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
static Evaluation gasHeatCapacity(const Evaluation &, const Evaluation &)
Specific isobaric heat capacity of the component [J/kg] as a gas.
Definition: Unit.hpp:187
static Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition: Unit.hpp:72
static Evaluation gasDensity(const Evaluation &, const Evaluation &)
The density in of the component at a given pressure in and temperature in .
Definition: Unit.hpp:130
static Evaluation liquidViscosity(const Evaluation &, const Evaluation &)
The dynamic liquid viscosity of the pure component.
Definition: Unit.hpp:123
Abstract base class of a pure chemical species.
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: Unit.hpp:103
static Evaluation vaporPressure(const Evaluation &)
The vapor pressure in of the component at a given temperature in .
Definition: Unit.hpp:91
static Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition: Unit.hpp:66
static Evaluation liquidEnthalpy(const Evaluation &, const Evaluation &)
Specific enthalpy of the pure component in liquid.
Definition: Unit.hpp:152
static Scalar triplePressure()
Returns the pressure in at the component&#39;s triple point.
Definition: Unit.hpp:84
static Evaluation gasInternalEnergy(const Evaluation &, const Evaluation &)
Specific internal energy of the pure component in gas.
Definition: Unit.hpp:159
A component where all quantities are fixed at 1.0.
Definition: Unit.hpp:47
static Evaluation liquidHeatCapacity(const Evaluation &, const Evaluation &)
Specific isobaric heat capacity of the component [J/kg] as a liquid.
Definition: Unit.hpp:194
static Evaluation gasEnthalpy(const Evaluation &, const Evaluation &)
Specific enthalpy of the pure component in gas.
Definition: Unit.hpp:145
static Scalar tripleTemperature()
Returns the temperature in at the component&#39;s triple point.
Definition: Unit.hpp:78