3.1-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
42template <class Component>
43struct IsAqueous : public std::false_type {};
44
45template <class ScalarType, class Component>
46class Base
47{
48public:
49
51 using Scalar = ScalarType;
52
54 static constexpr bool isTabulated = false;
55
68 static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp,
69 Scalar pressMin, Scalar pressMax, unsigned nPress)
70 { Dune::dwarn << "No init routine defined - make sure that this is not necessary!" << std::endl; }
71
76 template<class C = Component>
77 static std::string name()
78 {
79 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: name()");
80 DUNE_THROW(Dune::NotImplemented, "name()");
81 }
82
86 template<class C = Component>
87 static constexpr Scalar molarMass()
88 {
89 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: molarMass()");
90 return 0; // iso c++ requires a return statement for constexpr functions
91 }
92
96 template<class C = Component>
97 static constexpr Scalar criticalTemperature()
98 {
99 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: criticalTemperature()");
100 return 0; // iso c++ requires a return statement for constexpr functions
101 }
102
106 template<class C = Component>
107 static constexpr Scalar criticalPressure()
108 {
109 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: criticalPressure()");
110 return 0; // iso c++ requires a return statement for constexpr functions
111 }
112
116 template<class C = Component>
117 static constexpr Scalar tripleTemperature()
118 {
119 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: tripleTemperature()");
120 return 0; // iso c++ requires a return statement for constexpr functions
121 }
122
126 template<class C = Component>
127 static constexpr Scalar triplePressure()
128 {
129 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: triplePressure()");
130 return 0; // iso c++ requires a return statement for constexpr functions
131 }
132
139 template<class C = Component>
141 {
142 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: vaporPressure(t)");
143 DUNE_THROW(Dune::NotImplemented, "vaporPressure(t)");
144 }
145
146};
147
148} // end namespace Components
149} // end namespace Dumux
150
151#endif
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Template which always yields a false value.
Definition: typetraits.hh:37
Definition: components/base.hh:43
Definition: components/base.hh:47
static constexpr Scalar molarMass()
The molar mass in of the component.
Definition: components/base.hh:87
static constexpr bool isTabulated
if the component relies on tabulated values
Definition: components/base.hh:54
static constexpr Scalar tripleTemperature()
Returns the temperature in at the component's triple point.
Definition: components/base.hh:117
static constexpr Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition: components/base.hh:107
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:68
static constexpr Scalar triplePressure()
Returns the pressure in at the component's triple point.
Definition: components/base.hh:127
static Scalar vaporPressure(Scalar t)
The vapor pressure in of the component at a given temperature in .
Definition: components/base.hh:140
static constexpr Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition: components/base.hh:97
static std::string name()
A human readable name for the component.
Definition: components/base.hh:77
ScalarType Scalar
export the scalar type used by the component
Definition: components/base.hh:51