3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
temperatureoverlay.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 *****************************************************************************/
26#ifndef DUMUX_TEMPERATURE_OVERLAY_FLUID_STATE_HH
27#define DUMUX_TEMPERATURE_OVERLAY_FLUID_STATE_HH
28
29namespace Dumux {
30
37template <class FluidState>
39{
40public:
41 static constexpr int numPhases = FluidState::numPhases;
42 static constexpr int numComponents = FluidState::numComponents;
43
45 using Scalar = typename FluidState::Scalar;
46
55 TemperatureOverlayFluidState(const FluidState &fs)
56 : fs_(&fs)
57 {
58 temperature_ = fs.temperature(/*phaseIdx=*/0);
59 }
60
61 TemperatureOverlayFluidState(Scalar T, const FluidState &fs)
62 : fs_(&fs), temperature_(T)
63 {}
64
65 // copy & move constructor / assignment operators
70
71 /*****************************************************
72 * Generic access to fluid properties (No assumptions
73 * on thermodynamic equilibrium required)
74 *****************************************************/
78 Scalar saturation(int phaseIdx) const
79 { return fs_->saturation(phaseIdx); }
80
84 Scalar moleFraction(int phaseIdx, int compIdx) const
85 { return fs_->moleFraction(phaseIdx, compIdx); }
86
90 Scalar massFraction(int phaseIdx, int compIdx) const
91 { return fs_->massFraction(phaseIdx, compIdx); }
92
96 Scalar averageMolarMass(int phaseIdx) const
97 { return fs_->averageMolarMass(phaseIdx); }
98
102 Scalar molarity(int phaseIdx, int compIdx) const
103 { return fs_->molarity(phaseIdx, compIdx); }
104
108 Scalar fugacity(int phaseIdx, int compIdx) const
109 { return fs_->fugacity(phaseIdx, compIdx); }
110
114 Scalar fugacityCoefficient(int phaseIdx, int compIdx) const
115 { return fs_->fugacityCoefficient(phaseIdx, compIdx); }
116
120 Scalar molarVolume(int phaseIdx) const
121 { return fs_->molarVolume(phaseIdx); }
122
126 Scalar density(int phaseIdx) const
127 { return fs_->density(phaseIdx); }
128
132 Scalar molarDensity(int phaseIdx) const
133 { return fs_->molarDensity(phaseIdx); }
134
138 Scalar temperature(int phaseIdx) const
139 { return temperature_; }
140
144 Scalar pressure(int phaseIdx) const
145 { return fs_->pressure(phaseIdx); }
146
150 Scalar enthalpy(int phaseIdx) const
151 { return fs_->enthalpy(phaseIdx); }
152
156 Scalar internalEnergy(int phaseIdx) const
157 { return fs_->internalEnergy(phaseIdx); }
158
162 Scalar viscosity(int phaseIdx) const
163 { return fs_->viscosity(phaseIdx); }
164
165
166 /*****************************************************
167 * Setter methods. Note that these are not part of the
168 * generic FluidState interface but specific for each
169 * implementation...
170 *****************************************************/
175 { temperature_ = value; }
176
177protected:
178 const FluidState *fs_;
180};
181
182} // end namespace Dumux
183
184#endif
Definition: adapt.hh:29
This is a fluid state which allows to set the fluid temperatures and takes all other quantities from ...
Definition: temperatureoverlay.hh:39
Scalar moleFraction(int phaseIdx, int compIdx) const
Returns the molar fraction of the component in fluid phase in .
Definition: temperatureoverlay.hh:84
Scalar density(int phaseIdx) const
The mass density of the fluid phase in .
Definition: temperatureoverlay.hh:126
Scalar molarDensity(int phaseIdx) const
The molar density of the fluid phase in .
Definition: temperatureoverlay.hh:132
TemperatureOverlayFluidState(const FluidState &fs)
Constructor.
Definition: temperatureoverlay.hh:55
typename FluidState::Scalar Scalar
export the scalar type
Definition: temperatureoverlay.hh:45
static constexpr int numPhases
Definition: temperatureoverlay.hh:41
Scalar internalEnergy(int phaseIdx) const
The specific internal energy of a fluid phase in .
Definition: temperatureoverlay.hh:156
TemperatureOverlayFluidState & operator=(TemperatureOverlayFluidState &&fs)=default
const FluidState * fs_
Definition: temperatureoverlay.hh:178
Scalar molarVolume(int phaseIdx) const
The molar volume of a fluid phase in .
Definition: temperatureoverlay.hh:120
Scalar massFraction(int phaseIdx, int compIdx) const
Returns the mass fraction of component in fluid phase in .
Definition: temperatureoverlay.hh:90
Scalar molarity(int phaseIdx, int compIdx) const
The molar concentration of component in fluid phase in .
Definition: temperatureoverlay.hh:102
TemperatureOverlayFluidState(Scalar T, const FluidState &fs)
Definition: temperatureoverlay.hh:61
Scalar saturation(int phaseIdx) const
Returns the saturation of a fluid phase in .
Definition: temperatureoverlay.hh:78
Scalar viscosity(int phaseIdx) const
The dynamic viscosity of fluid phase in .
Definition: temperatureoverlay.hh:162
Scalar pressure(int phaseIdx) const
The pressure of a fluid phase in .
Definition: temperatureoverlay.hh:144
TemperatureOverlayFluidState(TemperatureOverlayFluidState &&fs)=default
TemperatureOverlayFluidState(const TemperatureOverlayFluidState &fs)=default
TemperatureOverlayFluidState & operator=(const TemperatureOverlayFluidState &fs)=default
Scalar temperature(int phaseIdx) const
The temperature of a fluid phase .
Definition: temperatureoverlay.hh:138
Scalar enthalpy(int phaseIdx) const
The specific enthalpy of a fluid phase in .
Definition: temperatureoverlay.hh:150
Scalar fugacity(int phaseIdx, int compIdx) const
The fugacity of component in fluid phase in .
Definition: temperatureoverlay.hh:108
static constexpr int numComponents
Definition: temperatureoverlay.hh:42
Scalar fugacityCoefficient(int phaseIdx, int compIdx) const
The fugacity coefficient of component in fluid phase in .
Definition: temperatureoverlay.hh:114
void setTemperature(Scalar value)
Set the temperature of a fluid phase.
Definition: temperatureoverlay.hh:174
Scalar averageMolarMass(int phaseIdx) const
The average molar mass of phase in .
Definition: temperatureoverlay.hh:96
Scalar temperature_
Definition: temperatureoverlay.hh:179