version 3.8
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
14#ifndef DUMUX_TEMPERATURE_OVERLAY_FLUID_STATE_HH
15#define DUMUX_TEMPERATURE_OVERLAY_FLUID_STATE_HH
16
17namespace Dumux {
18
25template <class FluidState>
27{
28public:
29 static constexpr int numPhases = FluidState::numPhases;
30 static constexpr int numComponents = FluidState::numComponents;
31
33 using Scalar = typename FluidState::Scalar;
34
43 TemperatureOverlayFluidState(const FluidState &fs)
44 : fs_(&fs)
45 {
46 temperature_ = fs.temperature(/*phaseIdx=*/0);
47 }
48
49 TemperatureOverlayFluidState(Scalar T, const FluidState &fs)
50 : fs_(&fs), temperature_(T)
51 {}
52
53 // copy & move constructor / assignment operators
58
59 /*****************************************************
60 * Generic access to fluid properties (No assumptions
61 * on thermodynamic equilibrium required)
62 *****************************************************/
66 Scalar saturation(int phaseIdx) const
67 { return fs_->saturation(phaseIdx); }
68
72 Scalar moleFraction(int phaseIdx, int compIdx) const
73 { return fs_->moleFraction(phaseIdx, compIdx); }
74
78 Scalar massFraction(int phaseIdx, int compIdx) const
79 { return fs_->massFraction(phaseIdx, compIdx); }
80
84 Scalar averageMolarMass(int phaseIdx) const
85 { return fs_->averageMolarMass(phaseIdx); }
86
90 Scalar molarity(int phaseIdx, int compIdx) const
91 { return fs_->molarity(phaseIdx, compIdx); }
92
96 Scalar fugacity(int phaseIdx, int compIdx) const
97 { return fs_->fugacity(phaseIdx, compIdx); }
98
102 Scalar fugacityCoefficient(int phaseIdx, int compIdx) const
103 { return fs_->fugacityCoefficient(phaseIdx, compIdx); }
104
108 Scalar molarVolume(int phaseIdx) const
109 { return fs_->molarVolume(phaseIdx); }
110
114 Scalar density(int phaseIdx) const
115 { return fs_->density(phaseIdx); }
116
120 Scalar molarDensity(int phaseIdx) const
121 { return fs_->molarDensity(phaseIdx); }
122
126 Scalar temperature(int phaseIdx) const
127 { return temperature_; }
128
132 Scalar pressure(int phaseIdx) const
133 { return fs_->pressure(phaseIdx); }
134
138 Scalar enthalpy(int phaseIdx) const
139 { return fs_->enthalpy(phaseIdx); }
140
144 Scalar internalEnergy(int phaseIdx) const
145 { return fs_->internalEnergy(phaseIdx); }
146
150 Scalar viscosity(int phaseIdx) const
151 { return fs_->viscosity(phaseIdx); }
152
153
154 /*****************************************************
155 * Setter methods. Note that these are not part of the
156 * generic FluidState interface but specific for each
157 * implementation...
158 *****************************************************/
163 { temperature_ = value; }
164
165protected:
166 const FluidState *fs_;
168};
169
170} // end namespace Dumux
171
172#endif
This is a fluid state which allows to set the fluid temperatures and takes all other quantities from ...
Definition: temperatureoverlay.hh:27
Scalar moleFraction(int phaseIdx, int compIdx) const
Returns the molar fraction of the component in fluid phase in .
Definition: temperatureoverlay.hh:72
Scalar density(int phaseIdx) const
The mass density of the fluid phase in .
Definition: temperatureoverlay.hh:114
Scalar molarDensity(int phaseIdx) const
The molar density of the fluid phase in .
Definition: temperatureoverlay.hh:120
TemperatureOverlayFluidState(const FluidState &fs)
Constructor.
Definition: temperatureoverlay.hh:43
typename FluidState::Scalar Scalar
export the scalar type
Definition: temperatureoverlay.hh:33
static constexpr int numPhases
Definition: temperatureoverlay.hh:29
Scalar internalEnergy(int phaseIdx) const
The specific internal energy of a fluid phase in .
Definition: temperatureoverlay.hh:144
TemperatureOverlayFluidState & operator=(TemperatureOverlayFluidState &&fs)=default
const FluidState * fs_
Definition: temperatureoverlay.hh:166
Scalar molarVolume(int phaseIdx) const
The molar volume of a fluid phase in .
Definition: temperatureoverlay.hh:108
Scalar massFraction(int phaseIdx, int compIdx) const
Returns the mass fraction of component in fluid phase in .
Definition: temperatureoverlay.hh:78
Scalar molarity(int phaseIdx, int compIdx) const
The molar concentration of component in fluid phase in .
Definition: temperatureoverlay.hh:90
TemperatureOverlayFluidState(Scalar T, const FluidState &fs)
Definition: temperatureoverlay.hh:49
Scalar saturation(int phaseIdx) const
Returns the saturation of a fluid phase in .
Definition: temperatureoverlay.hh:66
Scalar viscosity(int phaseIdx) const
The dynamic viscosity of fluid phase in .
Definition: temperatureoverlay.hh:150
Scalar pressure(int phaseIdx) const
The pressure of a fluid phase in .
Definition: temperatureoverlay.hh:132
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:126
Scalar enthalpy(int phaseIdx) const
The specific enthalpy of a fluid phase in .
Definition: temperatureoverlay.hh:138
Scalar fugacity(int phaseIdx, int compIdx) const
The fugacity of component in fluid phase in .
Definition: temperatureoverlay.hh:96
static constexpr int numComponents
Definition: temperatureoverlay.hh:30
Scalar fugacityCoefficient(int phaseIdx, int compIdx) const
The fugacity coefficient of component in fluid phase in .
Definition: temperatureoverlay.hh:102
void setTemperature(Scalar value)
Set the temperature of a fluid phase.
Definition: temperatureoverlay.hh:162
Scalar averageMolarMass(int phaseIdx) const
The average molar mass of phase in .
Definition: temperatureoverlay.hh:84
Scalar temperature_
Definition: temperatureoverlay.hh:167
Definition: adapt.hh:17