27 #ifndef OPM_TEMPERATURE_OVERLAY_FLUID_STATE_HPP
28 #define OPM_TEMPERATURE_OVERLAY_FLUID_STATE_HPP
41 template <
class Flu
idState>
45 typedef typename FluidState::Scalar Scalar;
47 enum { numPhases = FluidState::numPhases };
48 enum { numComponents = FluidState::numComponents };
61 temperature_ = fs.temperature(0);
65 : temperature_(T), fs_(&fs)
71 , temperature_(fs.temperature_)
78 temperature_ = fs.temperature_;
90 -> decltype(std::declval<FluidState>().
saturation(phaseIdx))
91 {
return fs_->saturation(phaseIdx); }
97 -> decltype(std::declval<FluidState>().
moleFraction(phaseIdx, compIdx))
98 {
return fs_->moleFraction(phaseIdx, compIdx); }
104 -> decltype(std::declval<FluidState>().
massFraction(phaseIdx, compIdx))
105 {
return fs_->massFraction(phaseIdx, compIdx); }
117 {
return fs_->averageMolarMass(phaseIdx); }
128 auto molarity(
unsigned phaseIdx,
unsigned compIdx)
const
129 -> decltype(std::declval<FluidState>().
molarity(phaseIdx, compIdx))
130 {
return fs_->molarity(phaseIdx, compIdx); }
135 auto fugacity(
unsigned phaseIdx,
unsigned compIdx)
const
136 -> decltype(std::declval<FluidState>().
fugacity(phaseIdx, compIdx))
137 {
return fs_->fugacity(phaseIdx, compIdx); }
144 {
return fs_->fugacityCoefficient(phaseIdx, compIdx); }
150 -> decltype(std::declval<FluidState>().
molarVolume(phaseIdx))
151 {
return fs_->molarVolume(phaseIdx); }
157 -> decltype(std::declval<FluidState>().
density(phaseIdx))
158 {
return fs_->density(phaseIdx); }
164 -> decltype(std::declval<FluidState>().
molarDensity(phaseIdx))
165 {
return fs_->molarDensity(phaseIdx); }
171 {
return temperature_; }
177 -> decltype(std::declval<FluidState>().
pressure(phaseIdx))
178 {
return fs_->pressure(phaseIdx); }
184 -> decltype(std::declval<FluidState>().
enthalpy(phaseIdx))
185 {
return fs_->enthalpy(phaseIdx); }
192 {
return fs_->internalEnergy(phaseIdx); }
198 -> decltype(std::declval<FluidState>().
viscosity(phaseIdx))
199 {
return fs_->viscosity(phaseIdx); }
211 { temperature_ = value; }
223 Valgrind::CheckDefined(temperature_);
227 const FluidState* fs_;
Some templates to wrap the valgrind client request macros.
This is a fluid state which allows to set the fluid temperatures and takes all other quantities from ...
Definition: TemperatureOverlayFluidState.hpp:43
auto pressure(unsigned phaseIdx) const -> decltype(std::declval< FluidState >().pressure(phaseIdx))
The pressure of a fluid phase [Pa].
Definition: TemperatureOverlayFluidState.hpp:176
void checkDefined() const
Make sure that all attributes are defined.
Definition: TemperatureOverlayFluidState.hpp:221
auto density(unsigned phaseIdx) const -> decltype(std::declval< FluidState >().density(phaseIdx))
The mass density of a fluid phase [kg/m^3].
Definition: TemperatureOverlayFluidState.hpp:156
auto viscosity(unsigned phaseIdx) const -> decltype(std::declval< FluidState >().viscosity(phaseIdx))
The dynamic viscosity of a fluid phase [Pa s].
Definition: TemperatureOverlayFluidState.hpp:197
void setTemperature(const Scalar &value)
Set the temperature [K] of a fluid phase.
Definition: TemperatureOverlayFluidState.hpp:210
auto fugacity(unsigned phaseIdx, unsigned compIdx) const -> decltype(std::declval< FluidState >().fugacity(phaseIdx, compIdx))
The fugacity of a component in a phase [Pa].
Definition: TemperatureOverlayFluidState.hpp:135
TemperatureOverlayFluidState(const FluidState &fs)
Constructor.
Definition: TemperatureOverlayFluidState.hpp:58
auto enthalpy(unsigned phaseIdx) const -> decltype(std::declval< FluidState >().enthalpy(phaseIdx))
The specific enthalpy of a fluid phase [J/kg].
Definition: TemperatureOverlayFluidState.hpp:183
auto molarity(unsigned phaseIdx, unsigned compIdx) const -> decltype(std::declval< FluidState >().molarity(phaseIdx, compIdx))
The molar concentration of a component in a phase [mol/m^3].
Definition: TemperatureOverlayFluidState.hpp:128
auto internalEnergy(unsigned phaseIdx) const -> decltype(std::declval< FluidState >().internalEnergy(phaseIdx))
The specific internal energy of a fluid phase [J/kg].
Definition: TemperatureOverlayFluidState.hpp:190
auto saturation(unsigned phaseIdx) const -> decltype(std::declval< FluidState >().saturation(phaseIdx))
Returns the saturation of a phase [].
Definition: TemperatureOverlayFluidState.hpp:89
auto massFraction(unsigned phaseIdx, unsigned compIdx) const -> decltype(std::declval< FluidState >().massFraction(phaseIdx, compIdx))
The mass fraction of a component in a phase [].
Definition: TemperatureOverlayFluidState.hpp:103
auto fugacityCoefficient(unsigned phaseIdx, unsigned compIdx) const -> decltype(std::declval< FluidState >().fugacityCoefficient(phaseIdx, compIdx))
The fugacity coefficient of a component in a phase [].
Definition: TemperatureOverlayFluidState.hpp:142
const Scalar & temperature(unsigned) const
The temperature of a fluid phase [K].
Definition: TemperatureOverlayFluidState.hpp:170
auto molarVolume(unsigned phaseIdx) const -> decltype(std::declval< FluidState >().molarVolume(phaseIdx))
The molar volume of a fluid phase [m^3/mol].
Definition: TemperatureOverlayFluidState.hpp:149
auto molarDensity(unsigned phaseIdx) const -> decltype(std::declval< FluidState >().molarDensity(phaseIdx))
The molar density of a fluid phase [mol/m^3].
Definition: TemperatureOverlayFluidState.hpp:163
auto averageMolarMass(unsigned phaseIdx) const -> decltype(std::declval< FluidState >().averageMolarMass(phaseIdx))
The average molar mass of a fluid phase [kg/mol].
Definition: TemperatureOverlayFluidState.hpp:115
auto moleFraction(unsigned phaseIdx, unsigned compIdx) const -> decltype(std::declval< FluidState >().moleFraction(phaseIdx, compIdx))
The mole fraction of a component in a phase [].
Definition: TemperatureOverlayFluidState.hpp:96