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
32namespace Opm
33{
44template <class Scalar>
45class Unit : public Component<Scalar, Unit<Scalar> >
46{
47
48public:
52 static const char* name()
53 { return "Unit"; }
54
59 { return 1.0; }
60
65 { return 1.0; }
66
71 { return 1.0; }
72
77 { return 1.0; }
78
83 { return 1.0; }
84
88 template <class Evaluation>
89 static Evaluation vaporPressure(const Evaluation& /* temperature */)
90 { return 1.0; }
91
96 { return false; }
97
101 static bool gasIsCompressible()
102 { return false; }
103
107 static bool gasIsIdeal()
108 { return false; }
109
113 template <class Evaluation>
114 static Evaluation liquidDensity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
115 { return 1.0; }
116
120 template <class Evaluation>
121 static Evaluation liquidViscosity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
122 { return 1.0; }
123
127 template <class Evaluation>
128 static Evaluation gasDensity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
129 { return 1.0; }
130
134 template <class Evaluation>
135 static Evaluation gasViscosity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
136 { return 1.0; }
137
138
142 template <class Evaluation>
143 static Evaluation gasEnthalpy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
144 { return 1.0; }
145
149 template <class Evaluation>
150 static Evaluation liquidEnthalpy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
151 { return 1.0; }
152
156 template <class Evaluation>
157 static Evaluation gasInternalEnergy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
158 { return 1.0; }
159
163 template <class Evaluation>
164 static Evaluation liquidInternalEnergy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
165 { return 1.0; }
166
170 template <class Evaluation>
171 static Evaluation gasThermalConductivity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
172 { return 1.0; }
173
177 template <class Evaluation>
178 static Evaluation liquidThermalConductivity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
179 { return 1.0; }
180
184 template <class Evaluation>
185 static Evaluation gasHeatCapacity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
186 { return 1.0; }
187
191 template <class Evaluation>
192 static Evaluation liquidHeatCapacity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
193 { return 1.0; }
194};
195
196} // namespace Opm
197
198#endif
Abstract base class of a pure chemical species.
Definition: Component.hpp:42
Scalar Scalar
Definition: Component.hpp:44
A component where all quantities are fixed at 1.0.
Definition: Unit.hpp:46
static Evaluation gasThermalConductivity(const Evaluation &, const Evaluation &)
Thermal conductivity of the component [W/(m^2 K/m)] as a gas.
Definition: Unit.hpp:171
static Scalar triplePressure()
Returns the pressure in at the component's triple point.
Definition: Unit.hpp:82
static Evaluation gasHeatCapacity(const Evaluation &, const Evaluation &)
Specific isobaric heat capacity of the component [J/kg] as a gas.
Definition: Unit.hpp:185
static Evaluation liquidViscosity(const Evaluation &, const Evaluation &)
The dynamic liquid viscosity of the pure component.
Definition: Unit.hpp:121
static Evaluation gasEnthalpy(const Evaluation &, const Evaluation &)
Specific enthalpy of the pure component in gas.
Definition: Unit.hpp:143
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: Unit.hpp:101
static Scalar tripleTemperature()
Returns the temperature in at the component's triple point.
Definition: Unit.hpp:76
static Evaluation liquidInternalEnergy(const Evaluation &, const Evaluation &)
Specific internal energy of pure the pure component in liquid.
Definition: Unit.hpp:164
static Evaluation gasInternalEnergy(const Evaluation &, const Evaluation &)
Specific internal energy of the pure component in gas.
Definition: Unit.hpp:157
static Scalar molarMass()
The molar mass in of the component.
Definition: Unit.hpp:58
static Evaluation liquidDensity(const Evaluation &, const Evaluation &)
The density of the liquid component at a given pressure in and temperature in .
Definition: Unit.hpp:114
static Evaluation gasDensity(const Evaluation &, const Evaluation &)
The density in of the component at a given pressure in and temperature in .
Definition: Unit.hpp:128
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: Unit.hpp:107
static Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition: Unit.hpp:64
static Evaluation liquidHeatCapacity(const Evaluation &, const Evaluation &)
Specific isobaric heat capacity of the component [J/kg] as a liquid.
Definition: Unit.hpp:192
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:135
static const char * name()
A human readable name for the component.
Definition: Unit.hpp:52
static Evaluation vaporPressure(const Evaluation &)
The vapor pressure in of the component at a given temperature in .
Definition: Unit.hpp:89
static Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition: Unit.hpp:70
static Evaluation liquidEnthalpy(const Evaluation &, const Evaluation &)
Specific enthalpy of the pure component in liquid.
Definition: Unit.hpp:150
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition: Unit.hpp:95
static Evaluation liquidThermalConductivity(const Evaluation &, const Evaluation &)
Thermal conductivity of the component [W/(m^2 K/m)] as a liquid.
Definition: Unit.hpp:178
Definition: Air_Mesitylene.hpp:34