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  Copyright (C) 2011-2013 by Andreas Lauser
5 
6  This file is part of the Open Porous Media project (OPM).
7 
8  OPM is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 2 of the License, or
11  (at your option) any later version.
12 
13  OPM is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with OPM. If not, see <http://www.gnu.org/licenses/>.
20 */
25 #ifndef OPM_UNIT_HPP
26 #define OPM_UNIT_HPP
27 
28 #include "Component.hpp"
29 
30 namespace Opm
31 {
42 template <class Scalar>
43 class Unit : public Component<Scalar, Unit<Scalar> >
44 {
45 
46 public:
50  static const char *name()
51  { return "Unit"; }
52 
56  static Scalar molarMass()
57  { return 1.0; }
58 
63  { return 1.0; }
64 
69  { return 1.0; }
70 
75  { return 1.0; }
76 
81  { return 1.0; }
82 
86  template <class Evaluation>
87  static Evaluation vaporPressure(const Evaluation& /* temperature */)
88  { return 1.0; }
89 
93  static bool liquidIsCompressible()
94  { return false; }
95 
99  static bool gasIsCompressible()
100  { return false; }
101 
105  static bool gasIsIdeal()
106  { return false; }
107 
111  template <class Evaluation>
112  static Evaluation liquidDensity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
113  { return 1.0; }
114 
118  template <class Evaluation>
119  static Evaluation liquidViscosity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
120  { return 1.0; }
121 
125  template <class Evaluation>
126  static Evaluation gasDensity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
127  { return 1.0; }
128 
132  template <class Evaluation>
133  static Evaluation gasViscosity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
134  { return 1.0; }
135 
136 
140  template <class Evaluation>
141  static Evaluation gasEnthalpy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
142  { return 1.0; }
143 
147  template <class Evaluation>
148  static Evaluation liquidEnthalpy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
149  { return 1.0; }
150 
154  template <class Evaluation>
155  static Evaluation gasInternalEnergy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
156  { return 1.0; }
157 
161  template <class Evaluation>
162  static Evaluation liquidInternalEnergy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
163  { return 1.0; }
164 
168  template <class Evaluation>
169  static Evaluation gasThermalConductivity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
170  { return 1.0; }
171 
175  template <class Evaluation>
176  static Evaluation liquidThermalConductivity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
177  { return 1.0; }
178 
182  template <class Evaluation>
183  static Evaluation gasHeatCapacity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
184  { return 1.0; }
185 
189  template <class Evaluation>
190  static Evaluation liquidHeatCapacity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
191  { return 1.0; }
192 };
193 
194 } // namespace Opm
195 
196 #endif
static Evaluation liquidThermalConductivity(const Evaluation &, const Evaluation &)
Thermal conductivity of the component [W/(m^2 K/m)] as a liquid.
Definition: Unit.hpp:176
Abstract base class of a pure chemical species.
Definition: Component.hpp:42
static Evaluation liquidViscosity(const Evaluation &, const Evaluation &)
The dynamic liquid viscosity of the pure component.
Definition: Unit.hpp:119
static Evaluation liquidInternalEnergy(const Evaluation &, const Evaluation &)
Specific internal energy of pure the pure component in liquid.
Definition: Unit.hpp:162
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:133
Definition: Air_Mesitylene.hpp:31
Scalar Scalar
Definition: Component.hpp:45
static Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition: Unit.hpp:62
static Evaluation gasHeatCapacity(const Evaluation &, const Evaluation &)
Specific isobaric heat capacity of the component [J/kg] as a gas.
Definition: Unit.hpp:183
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: Unit.hpp:105
static Evaluation vaporPressure(const Evaluation &)
The vapor pressure in of the component at a given temperature in .
Definition: Unit.hpp:87
static Evaluation liquidEnthalpy(const Evaluation &, const Evaluation &)
Specific enthalpy of the pure component in liquid.
Definition: Unit.hpp:148
static const char * name()
A human readable name for the component.
Definition: Unit.hpp:50
static Evaluation gasDensity(const Evaluation &, const Evaluation &)
The density in of the component at a given pressure in and temperature in .
Definition: Unit.hpp:126
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: Unit.hpp:99
static Evaluation gasInternalEnergy(const Evaluation &, const Evaluation &)
Specific internal energy of the pure component in gas.
Definition: Unit.hpp:155
static Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition: Unit.hpp:68
Abstract base class of a pure chemical species.
static Scalar molarMass()
The molar mass in of the component.
Definition: Unit.hpp:56
static Scalar tripleTemperature()
Returns the temperature in at the component's triple point.
Definition: Unit.hpp:74
static Scalar triplePressure()
Returns the pressure in at the component's triple point.
Definition: Unit.hpp:80
static Evaluation gasThermalConductivity(const Evaluation &, const Evaluation &)
Thermal conductivity of the component [W/(m^2 K/m)] as a gas.
Definition: Unit.hpp:169
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition: Unit.hpp:93
static Evaluation liquidDensity(const Evaluation &, const Evaluation &)
The density of the liquid component at a given pressure in and temperature in . ...
Definition: Unit.hpp:112
static Evaluation liquidHeatCapacity(const Evaluation &, const Evaluation &)
Specific isobaric heat capacity of the component [J/kg] as a liquid.
Definition: Unit.hpp:190
A component where all quantities are fixed at 1.0.
Definition: Unit.hpp:43
static Evaluation gasEnthalpy(const Evaluation &, const Evaluation &)
Specific enthalpy of the pure component in gas.
Definition: Unit.hpp:141