27 #ifndef OPM_NULL_MATERIAL_HPP
28 #define OPM_NULL_MATERIAL_HPP
32 #include <opm/common/ErrorMacros.hpp>
33 #include <opm/common/Exceptions.hpp>
46 template <
class TraitsT>
50 typedef TraitsT Traits;
52 typedef typename Traits::Scalar Scalar;
55 static const unsigned numPhases = Traits::numPhases;
91 template <
class ContainerT,
class Flu
idState>
96 for (
unsigned phaseIdx = 0; phaseIdx <
numPhases; ++phaseIdx)
97 values[phaseIdx] = 0.0;
103 template <
class ContainerT,
class Flu
idState>
107 { OPM_THROW(std::logic_error,
"Not defined: NullMaterial::saturations()"); }
112 template <
class ContainerT,
class Flu
idState>
115 const FluidState& fluidState)
117 typedef typename std::remove_reference<decltype(values[0])>::type Evaluation;
119 for (
unsigned phaseIdx = 0; phaseIdx <
numPhases; ++phaseIdx) {
120 const Evaluation& S =
121 Opm::decay<Evaluation>(fluidState.saturation(phaseIdx));
122 values[phaseIdx] = Opm::max(Opm::min(S, 1.0), 0.0);
129 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
130 static typename std::enable_if<(numPhases > 1), Evaluation>::type
134 template <
class Evaluation>
135 static typename std::enable_if<numPhases == 2, Evaluation>::type
136 twoPhaseSatPcnw(
const Params& ,
const Evaluation& )
143 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
144 static Scalar
Sw(
const Params& ,
const FluidState& )
145 { OPM_THROW(std::logic_error,
"Not defined: Sw()"); }
147 template <
class Evaluation>
148 static typename std::enable_if<numPhases == 2, Evaluation>::type
149 twoPhaseSatSw(
const Params& ,
const Evaluation& )
150 { OPM_THROW(std::logic_error,
"Not defined: twoPhaseSatSw()"); }
156 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
157 static Scalar
Sn(
const Params& ,
const FluidState& )
158 { OPM_THROW(std::logic_error,
"Not defined: Sn()"); }
160 template <
class Evaluation>
161 static typename std::enable_if<numPhases == 2, Evaluation>::type
162 twoPhaseSatSn(
const Params& ,
const Evaluation& )
163 { OPM_THROW(std::logic_error,
"Not defined: twoPhaseSatSn()"); }
171 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
172 static typename std::enable_if< (numPhases > 2), Evaluation>::type
174 { OPM_THROW(std::logic_error,
"Not defined: Sg()"); }
179 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
180 static typename std::enable_if<(numPhases > 1), Evaluation>::type
183 const Evaluation&
Sw =
184 Opm::decay<Evaluation>(fluidState.saturation(Traits::wettingPhaseIdx));
186 return Opm::max(0.0, Opm::min(1.0, Sw));
189 template <
class Evaluation>
190 static typename std::enable_if<numPhases == 2, Evaluation>::type
191 twoPhaseSatKrw(
const Params& ,
const Evaluation&
Sw)
192 {
return Opm::max(0.0, Opm::min(1.0, Sw)); }
197 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
198 static typename std::enable_if<(numPhases > 1), Evaluation>::type
201 const Evaluation&
Sn =
202 Opm::decay<Evaluation>(fluidState.saturation(Traits::nonWettingPhaseIdx));
204 return Opm::max(0.0, Opm::min(1.0, Sn));
207 template <
class Evaluation>
208 static typename std::enable_if<numPhases == 2, Evaluation>::type
209 twoPhaseSatKrn(
const Params& ,
const Evaluation& Sw)
211 return Opm::max(0.0, Opm::min(1.0, 1.0 - Opm::decay<Evaluation>(Sw)));
219 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
220 static typename std::enable_if< (numPhases > 2), Evaluation>::type
223 const Evaluation&
Sg =
224 Opm::decay<Evaluation>(fluidState.saturation(Traits::gasPhaseIdx));
226 return Opm::max(0.0, Opm::min(1.0, Sg));
234 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
235 static typename std::enable_if< (Traits::numPhases > 2), Evaluation>::type
static void relativePermeabilities(ContainerT &values, const Params &, const FluidState &fluidState)
The relative permeability of all phases.
Definition: NullMaterial.hpp:113
Reference implementation of params for the linear M-phase material material.
static std::enable_if<(numPhases > 1), Evaluation >::type pcnw(const Params &, const FluidState &)
The difference between the pressures of the non-wetting and wetting phase.
Definition: NullMaterial.hpp:131
static std::enable_if< (Traits::numPhases > 2), Evaluation >::type pcgn(const Params &, const FluidState &)
The difference between the pressures of the gas and the non-wetting phase.
Definition: NullMaterial.hpp:236
static const bool isCompositionDependent
Specify whether the quantities defined by this material law are dependent on the phase composition...
Definition: NullMaterial.hpp:82
static const bool isPressureDependent
Specify whether the quantities defined by this material law are dependent on the absolute pressure...
Definition: NullMaterial.hpp:74
static const unsigned numPhases
The number of fluid phases.
Definition: NullMaterial.hpp:55
static void saturations(ContainerT &, const Params &, const FluidState &)
The inverse of the capillary pressure.
Definition: NullMaterial.hpp:104
static const bool implementsTwoPhaseSatApi
Specify whether this material law implements the two-phase convenience API which only depends on the ...
Definition: NullMaterial.hpp:63
static const bool isSaturationDependent
Specify whether the quantities defined by this material law are saturation dependent.
Definition: NullMaterial.hpp:70
Implements a dummy linear saturation-capillary pressure relation which just disables capillary pressu...
Definition: NullMaterial.hpp:47
static std::enable_if< (numPhases > 2), Evaluation >::type Sg(const Params &, const FluidState &)
Calculate gas phase saturation given that the rest of the fluid state has been initialized.
Definition: NullMaterial.hpp:173
static const bool isTemperatureDependent
Specify whether the quantities defined by this material law are temperature dependent.
Definition: NullMaterial.hpp:78
static std::enable_if<(numPhases > 1), Evaluation >::type krn(const Params &, const FluidState &fluidState)
The relative permability of the liquid non-wetting phase.
Definition: NullMaterial.hpp:199
static Scalar Sn(const Params &, const FluidState &)
Calculate non-wetting phase saturation given that the rest of the fluid state has been initialized...
Definition: NullMaterial.hpp:157
static std::enable_if< (numPhases > 2), Evaluation >::type krg(const Params &, const FluidState &fluidState)
The relative permability of the gas phase.
Definition: NullMaterial.hpp:221
static void capillaryPressures(ContainerT &values, const Params &, const FluidState &)
Returns constant 0 for all phases.
Definition: NullMaterial.hpp:92
static Scalar Sw(const Params &, const FluidState &)
Calculate wetting phase saturation given that the rest of the fluid state has been initialized...
Definition: NullMaterial.hpp:144
static std::enable_if<(numPhases > 1), Evaluation >::type krw(const Params &, const FluidState &fluidState)
The relative permability of the wetting phase.
Definition: NullMaterial.hpp:181
static const bool implementsTwoPhaseApi
Specify whether this material law implements the two-phase convenience API.
Definition: NullMaterial.hpp:59
Reference implementation of params for the linear M-phase material material.
Definition: NullMaterialParams.hpp:36