version 3.10-dev
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// 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_SATURATION_OVERLAY_FLUID_STATE_HH
15#define DUMUX_SATURATION_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 SaturationOverlayFluidState(const FluidState &fs)
44 : fs_(&fs)
45 {
46 for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
47 saturation_[phaseIdx] = fs.saturation(phaseIdx);
48 }
49
50 // copy & move constructor / assignment operators
55
56 /*****************************************************
57 * Generic access to fluid properties (No assumptions
58 * on thermodynamic equilibrium required)
59 *****************************************************/
68 Scalar saturation(int phaseIdx) const
69 { return saturation_[phaseIdx]; }
70
74 Scalar moleFraction(int phaseIdx, int compIdx) const
75 { return fs_->moleFraction(phaseIdx, compIdx); }
76
80 Scalar massFraction(int phaseIdx, int compIdx) const
81 { return fs_->massFraction(phaseIdx, compIdx); }
82
86 Scalar averageMolarMass(int phaseIdx) const
87 { return fs_->averageMolarMass(phaseIdx); }
88
92 Scalar molarity(int phaseIdx, int compIdx) const
93 { return fs_->molarity(phaseIdx, compIdx); }
94
98 Scalar fugacity(int phaseIdx, int compIdx) const
99 { return fs_->fugacity(phaseIdx, compIdx); }
100
104 Scalar fugacityCoefficient(int phaseIdx, int compIdx) const
105 { return fs_->fugacityCoefficient(phaseIdx, compIdx); }
106
110 Scalar molarVolume(int phaseIdx) const
111 { return fs_->molarVolume(phaseIdx); }
112
116 Scalar density(int phaseIdx) const
117 { return fs_->density(phaseIdx); }
118
122 Scalar molarDensity(int phaseIdx) const
123 { return fs_->molarDensity(phaseIdx); }
124
128 Scalar temperature(int phaseIdx) const
129 { return fs_->temperature(phaseIdx); }
130
134 Scalar pressure(int phaseIdx) const
135 { return fs_->pressure(phaseIdx); }
136
140 Scalar enthalpy(int phaseIdx) const
141 { return fs_->enthalpy(phaseIdx); }
142
146 Scalar internalEnergy(int phaseIdx) const
147 { return fs_->internalEnergy(phaseIdx); }
148
152 Scalar viscosity(int phaseIdx) const
153 { return fs_->viscosity(phaseIdx); }
154
155
156 /*****************************************************
157 * Setter methods. Note that these are not part of the
158 * generic FluidState interface but specific for each
159 * implementation...
160 *****************************************************/
164 void setSaturation(int phaseIdx, Scalar value)
165 { saturation_[phaseIdx] = value; }
166
167protected:
168 const FluidState *fs_;
170};
171
172} // end namespace Dumux
173
174#endif
This is a fluid state which allows to set the fluid saturations and takes all other quantities from a...
Definition: saturationoverlay.hh:27
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:86
static constexpr int numComponents
Definition: saturationoverlay.hh:30
Scalar molarVolume(int phaseIdx) const
The molar volume of a fluid phase in .
Definition: saturationoverlay.hh:110
Scalar density(int phaseIdx) const
The mass density of the fluid phase in .
Definition: saturationoverlay.hh:116
void setSaturation(int phaseIdx, Scalar value)
Set the saturation of a fluid phase.
Definition: saturationoverlay.hh:164
Scalar enthalpy(int phaseIdx) const
The specific enthalpy of a fluid phase in .
Definition: saturationoverlay.hh:140
Scalar temperature(int phaseIdx) const
The absolute temperature of a fluid phase in .
Definition: saturationoverlay.hh:128
Scalar fugacityCoefficient(int phaseIdx, int compIdx) const
The fugacity coefficient of component in fluid phase in .
Definition: saturationoverlay.hh:104
Scalar molarity(int phaseIdx, int compIdx) const
The molar concentration of component in fluid phase in .
Definition: saturationoverlay.hh:92
Scalar massFraction(int phaseIdx, int compIdx) const
Returns the mass fraction of component in fluid phase in .
Definition: saturationoverlay.hh:80
const FluidState * fs_
Definition: saturationoverlay.hh:168
Scalar pressure(int phaseIdx) const
The pressure of a fluid phase in .
Definition: saturationoverlay.hh:134
Scalar saturation(int phaseIdx) const
Returns the saturation of a fluid phase in .
Definition: saturationoverlay.hh:68
static constexpr int numPhases
Definition: saturationoverlay.hh:29
typename FluidState::Scalar Scalar
export the scalar type
Definition: saturationoverlay.hh:33
Scalar saturation_[numPhases]
Definition: saturationoverlay.hh:169
Scalar fugacity(int phaseIdx, int compIdx) const
The fugacity of component in fluid phase in .
Definition: saturationoverlay.hh:98
SaturationOverlayFluidState & operator=(SaturationOverlayFluidState &&fs)=default
SaturationOverlayFluidState(const FluidState &fs)
Constructor.
Definition: saturationoverlay.hh:43
Scalar moleFraction(int phaseIdx, int compIdx) const
Returns the molar fraction of the component in fluid phase in .
Definition: saturationoverlay.hh:74
Scalar internalEnergy(int phaseIdx) const
The specific internal energy of a fluid phase in .
Definition: saturationoverlay.hh:146
Scalar viscosity(int phaseIdx) const
The dynamic viscosity of fluid phase in .
Definition: saturationoverlay.hh:152
Scalar molarDensity(int phaseIdx) const
The molar density of the fluid phase in .
Definition: saturationoverlay.hh:122
SaturationOverlayFluidState(SaturationOverlayFluidState &&fs)=default
Definition: adapt.hh:17