28 #ifndef OPM_FLUID_STATE_VISCOSITY_MODULES_HPP 29 #define OPM_FLUID_STATE_VISCOSITY_MODULES_HPP 31 #include <opm/common/ErrorMacros.hpp> 32 #include <opm/common/Exceptions.hpp> 35 #include <opm/common/Valgrind.hpp> 44 template <
class Scalar,
51 { Valgrind::SetUndefined(viscosity_); }
57 {
return viscosity_[phaseIdx]; }
63 { viscosity_[phaseIdx] = value; }
69 template <
class Flu
idState>
72 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
73 viscosity_[phaseIdx] = Opm::decay<Scalar>(fs.viscosity(phaseIdx));
87 Valgrind::CheckDefined(viscosity_);
91 Scalar viscosity_[numPhases];
98 template <
class Scalar,
100 class Implementation>
111 { OPM_THROW(std::logic_error,
"Viscosity is not provided by this fluid state"); }
117 template <
class Flu
idState>
Module for the modular fluid state which does not the viscosities but throws std::logic_error instead...
Definition: FluidStateViscosityModules.hpp:101
void checkDefined() const
Make sure that all attributes are defined.
Definition: FluidStateViscosityModules.hpp:129
void checkDefined() const
Make sure that all attributes are defined.
Definition: FluidStateViscosityModules.hpp:85
void assign(const FluidState &fs)
Retrieve all parameters from an arbitrary fluid state.
Definition: FluidStateViscosityModules.hpp:70
void assign(const FluidState &)
Retrieve all parameters from an arbitrary fluid state.
Definition: FluidStateViscosityModules.hpp:118
Definition: Air_Mesitylene.hpp:33
const Scalar & viscosity(unsigned) const
The viscosity of a fluid phase [-].
Definition: FluidStateViscosityModules.hpp:110
const Scalar & viscosity(unsigned phaseIdx) const
The viscosity of a fluid phase [-].
Definition: FluidStateViscosityModules.hpp:56
void setViscosity(unsigned phaseIdx, Scalar value)
Set the dynamic viscosity of a phase [Pa s].
Definition: FluidStateViscosityModules.hpp:62
Module for the modular fluid state which stores the viscosities explicitly.
Definition: FluidStateViscosityModules.hpp:47