3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
components/base.hh
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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program 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 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
19
29#ifndef DUMUX_COMPONENT_BASE_HH
30#define DUMUX_COMPONENT_BASE_HH
31
32#include <string>
33
34#include <dune/common/exceptions.hh>
35#include <dune/common/stdstreams.hh>
36#include <dune/common/exceptions.hh>
38
39namespace Dumux {
40namespace Components {
41
46template <class Component>
47struct IsAqueous : public std::false_type {};
48
57template <class ScalarType, class Component>
58class Base
59{
60public:
61
63 using Scalar = ScalarType;
64
66 static constexpr bool isTabulated = false;
67
80 static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp,
81 Scalar pressMin, Scalar pressMax, unsigned nPress)
82 { Dune::dwarn << "No init routine defined - make sure that this is not necessary!" << std::endl; }
83
88 template<class C = Component>
89 static std::string name()
90 {
91 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: name()");
92 DUNE_THROW(Dune::NotImplemented, "name()");
93 }
94
98 template<class C = Component>
99 static constexpr Scalar molarMass()
100 {
101 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: molarMass()");
102 return 0; // iso c++ requires a return statement for constexpr functions
103 }
104
108 template<class C = Component>
109 static constexpr Scalar criticalTemperature()
110 {
111 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: criticalTemperature()");
112 return 0; // iso c++ requires a return statement for constexpr functions
113 }
114
118 template<class C = Component>
119 static constexpr Scalar criticalPressure()
120 {
121 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: criticalPressure()");
122 return 0; // iso c++ requires a return statement for constexpr functions
123 }
124
128 template<class C = Component>
129 static constexpr Scalar tripleTemperature()
130 {
131 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: tripleTemperature()");
132 return 0; // iso c++ requires a return statement for constexpr functions
133 }
134
138 template<class C = Component>
139 static constexpr Scalar triplePressure()
140 {
141 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: triplePressure()");
142 return 0; // iso c++ requires a return statement for constexpr functions
143 }
144
151 template<class C = Component>
153 {
154 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: vaporPressure(t)");
155 DUNE_THROW(Dune::NotImplemented, "vaporPressure(t)");
156 }
157
158};
159
160} // end namespace Components
161} // end namespace Dumux
162
163#endif
Type traits.
Definition: adapt.hh:29
Template which always yields a false value.
Definition: typetraits.hh:35
IsAqueous struct.
Definition: components/base.hh:47
Base class for all components Components provide the thermodynamic relations for the liquid,...
Definition: components/base.hh:59
static constexpr Scalar molarMass()
The molar mass in of the component.
Definition: components/base.hh:99
static constexpr bool isTabulated
if the component relies on tabulated values
Definition: components/base.hh:66
static constexpr Scalar tripleTemperature()
Returns the temperature in at the component's triple point.
Definition: components/base.hh:129
static constexpr Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition: components/base.hh:119
static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, Scalar pressMin, Scalar pressMax, unsigned nPress)
A default routine for initialization, not needed for components and must not be called.
Definition: components/base.hh:80
static constexpr Scalar triplePressure()
Returns the pressure in at the component's triple point.
Definition: components/base.hh:139
static Scalar vaporPressure(Scalar t)
The vapor pressure in of the component at a given temperature in .
Definition: components/base.hh:152
static constexpr Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition: components/base.hh:109
static std::string name()
A human readable name for the component.
Definition: components/base.hh:89
ScalarType Scalar
export the scalar type used by the component
Definition: components/base.hh:63