3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
constant.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 *****************************************************************************/
24#ifndef DUMUX_COMPONENTS_CONSTANT_HH
25#define DUMUX_COMPONENTS_CONSTANT_HH
26
28
33
34namespace Dumux {
35namespace Components {
36
52template<int id, class Scalar>
54: public Components::Base<Scalar, Constant<id, Scalar> >
55, public Components::Liquid<Scalar, Constant<id, Scalar> >
56, public Components::Gas<Scalar, Constant<id, Scalar> >
57, public Components::Solid<Scalar, Constant<id, Scalar> >
58{
59
60public:
64 static constexpr bool gasIsCompressible()
65 { return false; }
66
70 static constexpr bool gasViscosityIsConstant()
71 { return true; }
72
76 static constexpr bool gasIsIdeal()
77 { return true; }
78
82 static constexpr bool liquidIsCompressible()
83 { return false; }
84
88 static constexpr bool liquidViscosityIsConstant()
89 { return true; }
90
94 static const std::string& name()
95 {
96 static const std::string name = getParamFromGroup<std::string>(std::to_string(id), "Component.Name", "component");
97 return name;
98 }
99
104 {
105 static const Scalar molarMass = getParamFromGroup<Scalar>(std::to_string(id), "Component.MolarMass");
106 return molarMass;
107 }
108
116 {
117 static const Scalar density = getParamFromGroup<Scalar>(std::to_string(id), "Component.LiquidDensity");
118 return density;
119 }
120
130
141 {
142 static const Scalar kinematicViscosity = getParamFromGroup<Scalar>(std::to_string(id), "Component.LiquidKinematicViscosity");
143 return kinematicViscosity * liquidDensity(temperature, pressure);
144 }
145
153 {
154 static const Scalar density = getParamFromGroup<Scalar>(std::to_string(id), "Component.GasDensity");
155 return density;
156 }
157
167
168
179 {
180 static const Scalar kinematicViscosity = getParamFromGroup<Scalar>(std::to_string(id), "Component.GasKinematicViscosity");
181 return kinematicViscosity * gasDensity(temperature, pressure);
182 }
183
191 {
192 static const Scalar density = getParamFromGroup<Scalar>(std::to_string(id), "Component.SolidDensity");
193 return density;
194 }
195
201 {
202 static const Scalar solidThermalConductivity = getParamFromGroup<Scalar>(std::to_string(id), "Component.SolidThermalConductivity");
204 }
205
211 {
212 static const Scalar solidHeatCapacity = getParamFromGroup<Scalar>(std::to_string(id), "Component.SolidHeatCapacity");
213 return solidHeatCapacity;
214 }
215};
216
217} // end namespace Components
218
219} // end namespace Dumux
220
221#endif // DUMUX_COMPONENTS_CONSTANT_HH
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Interface for components that have a gas state.
Interface for components that have a liquid state.
Interface for components that have a solid state.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:51
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:34
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Definition: components/base.hh:47
Scalar Scalar
export the scalar type used by the component
Definition: components/base.hh:51
A component which returns run time specified values for all fluid properties.
Definition: constant.hh:58
static Scalar solidDensity(Scalar temperature)
The density in of the component at a given pressure in and temperature in .
Definition: constant.hh:190
static const std::string & name()
A human readable name for the component.
Definition: constant.hh:94
static Scalar solidThermalConductivity(Scalar temperature)
Thermal conductivity of the component as a solid.
Definition: constant.hh:200
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density in at a given pressure and temperature.
Definition: constant.hh:128
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition: constant.hh:64
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density in at a given pressure and temperature.
Definition: constant.hh:165
static Scalar solidHeatCapacity(Scalar temperature)
Specific isobaric heat capacity of the component as a solid.
Definition: constant.hh:210
static constexpr bool gasViscosityIsConstant()
Returns true if the gas phase viscosity is constant.
Definition: constant.hh:70
static Scalar gasDensity(Scalar temperature, Scalar pressure)
Sets the gas density in .
Definition: constant.hh:152
static constexpr bool liquidViscosityIsConstant()
Returns true if the liquid phase viscosity is constant.
Definition: constant.hh:88
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: constant.hh:76
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
Sets the liquid density in .
Definition: constant.hh:115
static Scalar molarMass()
The mass in of one mole of the component.
Definition: constant.hh:103
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition: constant.hh:82
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
Sets the liquid dynamic viscosity in .
Definition: constant.hh:140
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
Sets the gas dynamic viscosity in .
Definition: constant.hh:178
Interface for components that have a gas state.
Definition: gas.hh:41
Interface for components that have a liquid state.
Definition: liquid.hh:41
Definition: solid.hh:37
Base class for all components Components provide the thermodynamic relations for the liquid,...