28#ifndef OPM_FLUID_STATE_VISCOSITY_MODULES_HPP
29#define OPM_FLUID_STATE_VISCOSITY_MODULES_HPP
41template <
class Scalar,
44class FluidStateExplicitViscosityModule
47 FluidStateExplicitViscosityModule()
54 {
return viscosity_[phaseIdx]; }
60 { viscosity_[phaseIdx] = value; }
66 template <
class Flu
idState>
69 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
70 viscosity_[phaseIdx] = decay<Scalar>(fs.viscosity(phaseIdx));
88 Scalar viscosity_[numPhases];
95template <
class Scalar,
98class FluidStateNullViscosityModule
101 FluidStateNullViscosityModule()
108 {
throw std::logic_error(
"Viscosity is not provided by this fluid state"); }
114 template <
class Flu
idState>
Some templates to wrap the valgrind client request macros.
OPM_HOST_DEVICE void SetUndefined(const T &value)
Make the memory on which an object resides undefined in valgrind runs.
Definition Valgrind.hpp:174
OPM_HOST_DEVICE bool CheckDefined(const T &value)
Make valgrind complain if any of the memory occupied by an object is undefined.
Definition Valgrind.hpp:76
void setViscosity(unsigned phaseIdx, Scalar value)
Set the dynamic viscosity of a phase [Pa s].
Definition FluidStateViscosityModules.hpp:59
const Scalar & viscosity(unsigned phaseIdx) const
The viscosity of a fluid phase [-].
Definition FluidStateViscosityModules.hpp:53
void checkDefined() const
Make sure that all attributes are defined.
Definition FluidStateViscosityModules.hpp:82
void assign(const FluidState &fs)
Retrieve all parameters from an arbitrary fluid state.
Definition FluidStateViscosityModules.hpp:67
const Scalar & viscosity(unsigned) const
The viscosity of a fluid phase [-].
Definition FluidStateViscosityModules.hpp:107
void checkDefined() const
Make sure that all attributes are defined.
Definition FluidStateViscosityModules.hpp:126
void assign(const FluidState &)
Retrieve all parameters from an arbitrary fluid state.
Definition FluidStateViscosityModules.hpp:115
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30