3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
saturationoverlay.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_SATURATION_OVERLAY_FLUID_STATE_HH
27#define DUMUX_SATURATION_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 SaturationOverlayFluidState(const FluidState &fs)
56 : fs_(&fs)
57 {
58 for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
59 saturation_[phaseIdx] = fs.saturation(phaseIdx);
60 }
61
62 // copy & move constructor / assignment operators
67
68 /*****************************************************
69 * Generic access to fluid properties (No assumptions
70 * on thermodynamic equilibrium required)
71 *****************************************************/
80 Scalar saturation(int phaseIdx) const
81 { return saturation_[phaseIdx]; }
82
86 Scalar moleFraction(int phaseIdx, int compIdx) const
87 { return fs_->moleFraction(phaseIdx, compIdx); }
88
92 Scalar massFraction(int phaseIdx, int compIdx) const
93 { return fs_->massFraction(phaseIdx, compIdx); }
94
98 Scalar averageMolarMass(int phaseIdx) const
99 { return fs_->averageMolarMass(phaseIdx); }
100
104 Scalar molarity(int phaseIdx, int compIdx) const
105 { return fs_->molarity(phaseIdx, compIdx); }
106
110 Scalar fugacity(int phaseIdx, int compIdx) const
111 { return fs_->fugacity(phaseIdx, compIdx); }
112
116 Scalar fugacityCoefficient(int phaseIdx, int compIdx) const
117 { return fs_->fugacityCoefficient(phaseIdx, compIdx); }
118
122 Scalar molarVolume(int phaseIdx) const
123 { return fs_->molarVolume(phaseIdx); }
124
128 Scalar density(int phaseIdx) const
129 { return fs_->density(phaseIdx); }
130
134 Scalar molarDensity(int phaseIdx) const
135 { return fs_->molarDensity(phaseIdx); }
136
140 Scalar temperature(int phaseIdx) const
141 { return fs_->temperature(phaseIdx); }
142
146 Scalar pressure(int phaseIdx) const
147 { return fs_->pressure(phaseIdx); }
148
152 Scalar enthalpy(int phaseIdx) const
153 { return fs_->enthalpy(phaseIdx); }
154
158 Scalar internalEnergy(int phaseIdx) const
159 { return fs_->internalEnergy(phaseIdx); }
160
164 Scalar viscosity(int phaseIdx) const
165 { return fs_->viscosity(phaseIdx); }
166
167
168 /*****************************************************
169 * Setter methods. Note that these are not part of the
170 * generic FluidState interface but specific for each
171 * implementation...
172 *****************************************************/
176 void setSaturation(int phaseIdx, Scalar value)
177 { saturation_[phaseIdx] = value; }
178
179protected:
180 const FluidState *fs_;
182};
183
184} // end namespace Dumux
185
186#endif
Definition: adapt.hh:29
This is a fluid state which allows to set the fluid saturations and takes all other quantities from a...
Definition: saturationoverlay.hh:39
SaturationOverlayFluidState(const SaturationOverlayFluidState &fs)=default
SaturationOverlayFluidState & operator=(const SaturationOverlayFluidState &fs)=default
Scalar averageMolarMass(int phaseIdx) const
The average molar mass of phase in .
Definition: saturationoverlay.hh:98
static constexpr int numComponents
Definition: saturationoverlay.hh:42
Scalar molarVolume(int phaseIdx) const
The molar volume of a fluid phase in .
Definition: saturationoverlay.hh:122
Scalar density(int phaseIdx) const
The mass density of the fluid phase in .
Definition: saturationoverlay.hh:128
void setSaturation(int phaseIdx, Scalar value)
Set the saturation of a fluid phase.
Definition: saturationoverlay.hh:176
Scalar enthalpy(int phaseIdx) const
The specific enthalpy of a fluid phase in .
Definition: saturationoverlay.hh:152
Scalar temperature(int phaseIdx) const
The absolute temperature of a fluid phase in .
Definition: saturationoverlay.hh:140
Scalar fugacityCoefficient(int phaseIdx, int compIdx) const
The fugacity coefficient of component in fluid phase in .
Definition: saturationoverlay.hh:116
Scalar molarity(int phaseIdx, int compIdx) const
The molar concentration of component in fluid phase in .
Definition: saturationoverlay.hh:104
Scalar massFraction(int phaseIdx, int compIdx) const
Returns the mass fraction of component in fluid phase in .
Definition: saturationoverlay.hh:92
const FluidState * fs_
Definition: saturationoverlay.hh:180
Scalar pressure(int phaseIdx) const
The pressure of a fluid phase in .
Definition: saturationoverlay.hh:146
Scalar saturation(int phaseIdx) const
Returns the saturation of a fluid phase in .
Definition: saturationoverlay.hh:80
static constexpr int numPhases
Definition: saturationoverlay.hh:41
typename FluidState::Scalar Scalar
export the scalar type
Definition: saturationoverlay.hh:45
Scalar saturation_[numPhases]
Definition: saturationoverlay.hh:181
Scalar fugacity(int phaseIdx, int compIdx) const
The fugacity of component in fluid phase in .
Definition: saturationoverlay.hh:110
SaturationOverlayFluidState & operator=(SaturationOverlayFluidState &&fs)=default
SaturationOverlayFluidState(const FluidState &fs)
Constructor.
Definition: saturationoverlay.hh:55
Scalar moleFraction(int phaseIdx, int compIdx) const
Returns the molar fraction of the component in fluid phase in .
Definition: saturationoverlay.hh:86
Scalar internalEnergy(int phaseIdx) const
The specific internal energy of a fluid phase in .
Definition: saturationoverlay.hh:158
Scalar viscosity(int phaseIdx) const
The dynamic viscosity of fluid phase in .
Definition: saturationoverlay.hh:164
Scalar molarDensity(int phaseIdx) const
The molar density of the fluid phase in .
Definition: saturationoverlay.hh:134
SaturationOverlayFluidState(SaturationOverlayFluidState &&fs)=default