Component.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) 2009-2013 by Andreas Lauser
5  Copyright (C) 2010 by Felix Bode
6 
7  This file is part of the Open Porous Media project (OPM).
8 
9  OPM is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 2 of the License, or
12  (at your option) any later version.
13 
14  OPM is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OPM. If not, see <http://www.gnu.org/licenses/>.
21 */
26 #ifndef OPM_COMPONENT_HPP
27 #define OPM_COMPONENT_HPP
28 
29 #include <opm/common/ErrorMacros.hpp>
30 #include <opm/common/Exceptions.hpp>
31 
32 namespace Opm {
33 
41 template <class ScalarT, class Implementation>
42 class Component
43 {
44 public:
45  typedef ScalarT Scalar;
46 
47  static const bool isTabulated = false;
48 
61  static void init(Scalar /* tempMin */, Scalar /* tempMax */, unsigned /* nTemp */,
62  Scalar /* pressMin */, Scalar /* pressMax */, unsigned /* nPress */)
63  { }
64 
68  static bool gasIsCompressible()
69  { OPM_THROW(std::runtime_error, "Not implemented: Component::gasIsCompressible()"); }
70 
74  static bool gasIsIdeal()
75  { OPM_THROW(std::runtime_error, "Not implemented: Component::gasIsIdeal()"); }
76 
80  static bool liquidIsCompressible()
81  { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidIsCompressible()"); }
82 
86  static const char *name()
87  { OPM_THROW(std::runtime_error, "Not implemented: Component::name()"); }
88 
92  static Scalar molarMass()
93  { OPM_THROW(std::runtime_error, "Not implemented: Component::molarMass()"); }
94 
98  static Scalar criticalTemperature()
99  { OPM_THROW(std::runtime_error, "Not implemented: Component::criticalTemperature()"); }
100 
104  static Scalar criticalPressure()
105  { OPM_THROW(std::runtime_error, "Not implemented: Component::criticalPressure()"); }
106 
110  static Scalar tripleTemperature()
111  { OPM_THROW(std::runtime_error, "Not implemented: Component::tripleTemperature()"); }
112 
116  static Scalar triplePressure()
117  { OPM_THROW(std::runtime_error, "Not implemented: Component::triplePressure()"); }
118 
125  template <class Evaluation>
126  static Evaluation vaporPressure(const Evaluation& /* temperature */)
127  { OPM_THROW(std::runtime_error, "Not implemented: Component::vaporPressure()"); }
128 
135  template <class Evaluation>
136  static Evaluation gasDensity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
137  { OPM_THROW(std::runtime_error, "Not implemented: Component::gasDensity()"); }
138 
145  template <class Evaluation>
146  static Evaluation liquidDensity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
147  { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidDensity()"); }
148 
155  template <class Evaluation>
156  static Evaluation gasEnthalpy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
157  { OPM_THROW(std::runtime_error, "Not implemented: Component::gasEnthalpy()"); }
158 
165  template <class Evaluation>
166  static Evaluation liquidEnthalpy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
167  { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidEnthalpy()"); }
168 
175  template <class Evaluation>
176  static Evaluation gasInternalEnergy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
177  { OPM_THROW(std::runtime_error, "Not implemented: Component::gasInternalEnergy()"); }
178 
185  template <class Evaluation>
186  static Evaluation liquidInternalEnergy(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
187  { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidInternalEnergy()"); }
188 
196  template <class Evaluation>
197  static Evaluation gasViscosity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
198  { OPM_THROW(std::runtime_error, "Not implemented: Component::gasViscosity()"); }
199 
206  template <class Evaluation>
207  static Evaluation liquidViscosity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
208  { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidViscosity()"); }
209 
213  template <class Evaluation>
214  static Evaluation gasThermalConductivity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
215  { OPM_THROW(std::runtime_error, "Not implemented: Component::gasThermalConductivity()"); }
216 
220  template <class Evaluation>
221  static Evaluation liquidThermalConductivity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
222  { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidThermalConductivity()"); }
223 
227  template <class Evaluation>
228  static Evaluation gasHeatCapacity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
229  { OPM_THROW(std::runtime_error, "Not implemented: Component::gasHeatCapacity()"); }
230 
234  template <class Evaluation>
235  static Evaluation liquidHeatCapacity(const Evaluation& /* temperature */, const Evaluation& /* pressure */)
236  { OPM_THROW(std::runtime_error, "Not implemented: Component::liquidHeatCapacity()"); }
237 };
238 
239 } // namespace Opm
240 
241 #endif
static Evaluation liquidInternalEnergy(const Evaluation &, const Evaluation &)
Specific internal energy of pure the pure component in liquid.
Definition: Component.hpp:186
Abstract base class of a pure chemical species.
Definition: Component.hpp:42
static Scalar tripleTemperature()
Returns the temperature in at the component's triple point.
Definition: Component.hpp:110
static Evaluation gasInternalEnergy(const Evaluation &, const Evaluation &)
Specific internal energy of the pure component in gas.
Definition: Component.hpp:176
static Evaluation gasViscosity(const Evaluation &, const Evaluation &)
The dynamic viscosity of the pure component at a given pressure in and temperature in ...
Definition: Component.hpp:197
static Evaluation liquidViscosity(const Evaluation &, const Evaluation &)
The dynamic liquid viscosity of the pure component.
Definition: Component.hpp:207
Definition: Air_Mesitylene.hpp:31
static Evaluation liquidDensity(const Evaluation &, const Evaluation &)
The density of the liquid component at a given pressure in and temperature in . ...
Definition: Component.hpp:146
ScalarT Scalar
Definition: Component.hpp:45
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: Component.hpp:68
static Scalar triplePressure()
Returns the pressure in at the component's triple point.
Definition: Component.hpp:116
static void init(Scalar, Scalar, unsigned, Scalar, Scalar, unsigned)
A default routine for initialization, not needed for components and must not be called.
Definition: Component.hpp:61
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: Component.hpp:74
static Evaluation liquidHeatCapacity(const Evaluation &, const Evaluation &)
Specific isobaric heat capacity of the component [J/kg] as a liquid.
Definition: Component.hpp:235
static Evaluation gasEnthalpy(const Evaluation &, const Evaluation &)
Specific enthalpy of the pure component in gas.
Definition: Component.hpp:156
static const bool isTabulated
Definition: Component.hpp:47
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition: Component.hpp:80
static Evaluation gasDensity(const Evaluation &, const Evaluation &)
The density in of the component at a given pressure in and temperature in .
Definition: Component.hpp:136
static Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition: Component.hpp:98
static Evaluation gasThermalConductivity(const Evaluation &, const Evaluation &)
Thermal conductivity of the component [W/(m^2 K/m)] as a gas.
Definition: Component.hpp:214
static Evaluation gasHeatCapacity(const Evaluation &, const Evaluation &)
Specific isobaric heat capacity of the component [J/kg] as a gas.
Definition: Component.hpp:228
static Evaluation liquidEnthalpy(const Evaluation &, const Evaluation &)
Specific enthalpy of the pure component in liquid.
Definition: Component.hpp:166
static const char * name()
A human readable name for the component.
Definition: Component.hpp:86
static Evaluation liquidThermalConductivity(const Evaluation &, const Evaluation &)
Thermal conductivity of the component [W/(m^2 K/m)] as a liquid.
Definition: Component.hpp:221
static Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition: Component.hpp:104
static Evaluation vaporPressure(const Evaluation &)
The vapor pressure in of the component at a given temperature in .
Definition: Component.hpp:126
static Scalar molarMass()
The molar mass in of the component.
Definition: Component.hpp:92