3.4
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
152 {
153 static const Scalar thermalConductivity = getParamFromGroup<Scalar>(std::to_string(id), "Component.LiquidThermalConductivity");
154 return thermalConductivity;
155 }
156
163 {
164 // u = c * dT for incompressible fluids
165 const Scalar heatCapacity = liquidHeatCapacity(temperature, pressure);
166 static const Scalar tRef = getParamFromGroup<Scalar>(std::to_string(id), "Component.ReferenceTemperature", 293.15);
167 return heatCapacity * (temperature - tRef);
168 }
169
177 {
180 return u + pressure / rho;
181 }
182
190 {
191 static const Scalar heatCapacity = getParamFromGroup<Scalar>(std::to_string(id), "Component.LiquidHeatCapacity");
192 return heatCapacity;
193 }
194
202 {
203 static const Scalar density = getParamFromGroup<Scalar>(std::to_string(id), "Component.GasDensity");
204 return density;
205 }
206
216
217
228 {
229 static const Scalar kinematicViscosity = getParamFromGroup<Scalar>(std::to_string(id), "Component.GasKinematicViscosity");
230 return kinematicViscosity * gasDensity(temperature, pressure);
231 }
232
240 {
241 static const Scalar density = getParamFromGroup<Scalar>(std::to_string(id), "Component.SolidDensity");
242 return density;
243 }
244
250 {
251 static const Scalar solidThermalConductivity = getParamFromGroup<Scalar>(std::to_string(id), "Component.SolidThermalConductivity");
253 }
254
260 {
261 static const Scalar solidHeatCapacity = getParamFromGroup<Scalar>(std::to_string(id), "Component.SolidHeatCapacity");
262 return solidHeatCapacity;
263 }
264};
265
266} // end namespace Components
267
268} // end namespace Dumux
269
270#endif
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.
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
Base class for all components Components provide the thermodynamic relations for the liquid,...
Definition: components/base.hh:59
Scalar Scalar
export the scalar type used by the component
Definition: components/base.hh:63
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:239
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:249
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of the component as a liquid.
Definition: constant.hh:151
static Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of the component as a liquid.
Definition: constant.hh:176
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 liquidHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the component as a liquid.
Definition: constant.hh:189
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density in at a given pressure and temperature.
Definition: constant.hh:214
static Scalar solidHeatCapacity(Scalar temperature)
Specific isobaric heat capacity of the component as a solid.
Definition: constant.hh:259
static constexpr bool gasViscosityIsConstant()
Returns true if the gas phase viscosity is constant.
Definition: constant.hh:70
static Scalar liquidInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of the component as a liquid.
Definition: constant.hh:162
static Scalar gasDensity(Scalar temperature, Scalar pressure)
Sets the gas density in .
Definition: constant.hh:201
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:227
Interface for components that have a gas state.
Definition: gas.hh:41
Interface for components that have a liquid state.
Definition: liquid.hh:41
Interface for components that have a solid state.
Definition: solid.hh:41
Base class for all components Components provide the thermodynamic relations for the liquid,...