version 3.10.0
Loading...
Searching...
No Matches
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// SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
7
17#ifndef DUMUX_COMPONENT_BASE_HH
18#define DUMUX_COMPONENT_BASE_HH
19
20#include <string>
21
22#include <dune/common/exceptions.hh>
23#include <dune/common/stdstreams.hh>
24#include <dune/common/exceptions.hh>
26
27namespace Dumux::Components {
28
33template <class Component>
34struct IsAqueous : public std::false_type {};
35
44template <class ScalarType, class Component>
45class Base
46{
47public:
48
50 using Scalar = ScalarType;
51
53 static constexpr bool isTabulated = false;
54
67 static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp,
68 Scalar pressMin, Scalar pressMax, unsigned nPress)
69 { Dune::dwarn << "No init routine defined - make sure that this is not necessary!" << std::endl; }
70
75 template<class C = Component>
76 static std::string name()
77 {
78 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: name()");
79 DUNE_THROW(Dune::NotImplemented, "name()");
80 }
81
85 template<class C = Component>
86 static constexpr Scalar molarMass()
87 {
88 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: molarMass()");
89 return 0; // iso c++ requires a return statement for constexpr functions
90 }
91
95 template<class C = Component>
96 static constexpr Scalar criticalTemperature()
97 {
98 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: criticalTemperature()");
99 return 0; // iso c++ requires a return statement for constexpr functions
100 }
101
105 template<class C = Component>
106 static constexpr Scalar criticalPressure()
107 {
108 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: criticalPressure()");
109 return 0; // iso c++ requires a return statement for constexpr functions
110 }
111
115 template<class C = Component>
116 static constexpr Scalar tripleTemperature()
117 {
118 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: tripleTemperature()");
119 return 0; // iso c++ requires a return statement for constexpr functions
120 }
121
125 template<class C = Component>
126 static constexpr Scalar triplePressure()
127 {
128 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: triplePressure()");
129 return 0; // iso c++ requires a return statement for constexpr functions
130 }
131
138 template<class C = Component>
140 {
141 static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: vaporPressure(t)");
142 DUNE_THROW(Dune::NotImplemented, "vaporPressure(t)");
143 }
144
145};
146
147} // end namespace Dumux::Components
148
149#endif
Base class for all components Components provide the thermodynamic relations for the liquid,...
Definition components/base.hh:46
static constexpr Scalar molarMass()
The molar mass in of the component.
Definition components/base.hh:86
static constexpr bool isTabulated
if the component relies on tabulated values
Definition components/base.hh:53
static constexpr Scalar tripleTemperature()
Returns the temperature in at the component's triple point.
Definition components/base.hh:116
static constexpr Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition components/base.hh:106
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:67
static constexpr Scalar triplePressure()
Returns the pressure in at the component's triple point.
Definition components/base.hh:126
static Scalar vaporPressure(Scalar t)
The vapor pressure in of the component at a given temperature in .
Definition components/base.hh:139
static constexpr Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition components/base.hh:96
static std::string name()
A human readable name for the component.
Definition components/base.hh:76
ScalarType Scalar
export the scalar type used by the component
Definition components/base.hh:50
Type traits.
Definition air.hh:22
Template which always yields a false value.
Definition common/typetraits/typetraits.hh:24
IsAqueous struct.
Definition components/base.hh:34