27 #ifndef OPM_NULL_MATERIAL_HPP
28 #define OPM_NULL_MATERIAL_HPP
44 template <
class TraitsT>
48 typedef TraitsT Traits;
50 typedef typename Traits::Scalar Scalar;
53 static const unsigned numPhases = Traits::numPhases;
89 template <
class ContainerT,
class Flu
idState>
94 for (
unsigned phaseIdx = 0; phaseIdx <
numPhases; ++phaseIdx)
95 values[phaseIdx] = 0.0;
101 template <
class ContainerT,
class Flu
idState>
105 {
throw std::logic_error(
"Not defined: NullMaterial::saturations()"); }
110 template <
class ContainerT,
class Flu
idState>
113 const FluidState& fluidState)
115 typedef typename std::remove_reference<decltype(values[0])>::type Evaluation;
117 for (
unsigned phaseIdx = 0; phaseIdx <
numPhases; ++phaseIdx) {
118 const Evaluation& S =
119 decay<Evaluation>(fluidState.saturation(phaseIdx));
120 values[phaseIdx] = max(min(S, 1.0), 0.0);
127 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
128 static typename std::enable_if<(
numPhases > 1), Evaluation>::type
132 template <
class Evaluation>
133 static typename std::enable_if<numPhases == 2, Evaluation>::type
134 twoPhaseSatPcnw(
const Params& ,
const Evaluation& )
141 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
142 static Scalar
Sw(
const Params& ,
const FluidState& )
143 {
throw std::logic_error(
"Not defined: Sw()"); }
145 template <
class Evaluation>
146 static typename std::enable_if<numPhases == 2, Evaluation>::type
147 twoPhaseSatSw(
const Params& ,
const Evaluation& )
148 {
throw std::logic_error(
"Not defined: twoPhaseSatSw()"); }
154 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
155 static Scalar
Sn(
const Params& ,
const FluidState& )
156 {
throw std::logic_error(
"Not defined: Sn()"); }
158 template <
class Evaluation>
159 static typename std::enable_if<numPhases == 2, Evaluation>::type
160 twoPhaseSatSn(
const Params& ,
const Evaluation& )
161 {
throw std::logic_error(
"Not defined: twoPhaseSatSn()"); }
169 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
170 static typename std::enable_if< (
numPhases > 2), Evaluation>::type
172 {
throw std::logic_error(
"Not defined: Sg()"); }
177 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
178 static typename std::enable_if<(
numPhases > 1), Evaluation>::type
181 const Evaluation&
Sw =
182 decay<Evaluation>(fluidState.saturation(Traits::wettingPhaseIdx));
184 return max(0.0, min(1.0,
Sw));
187 template <
class Evaluation>
188 static typename std::enable_if<numPhases == 2, Evaluation>::type
189 twoPhaseSatKrw(
const Params& ,
const Evaluation&
Sw)
190 {
return max(0.0, min(1.0,
Sw)); }
195 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
196 static typename std::enable_if<(
numPhases > 1), Evaluation>::type
199 const Evaluation&
Sn =
200 decay<Evaluation>(fluidState.saturation(Traits::nonWettingPhaseIdx));
202 return max(0.0, min(1.0,
Sn));
205 template <
class Evaluation>
206 static typename std::enable_if<numPhases == 2, Evaluation>::type
207 twoPhaseSatKrn(
const Params& ,
const Evaluation&
Sw)
209 return max(0.0, min(1.0, 1.0 - decay<Evaluation>(
Sw)));
217 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
218 static typename std::enable_if< (
numPhases > 2), Evaluation>::type
221 const Evaluation&
Sg =
222 decay<Evaluation>(fluidState.saturation(Traits::gasPhaseIdx));
224 return max(0.0, min(1.0,
Sg));
232 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
233 static typename std::enable_if< (Traits::numPhases > 2), Evaluation>::type
Reference implementation of params for the linear M-phase material material.
Reference implementation of params for the linear M-phase material material.
Definition: NullMaterialParams.hpp:37
Implements a dummy linear saturation-capillary pressure relation which just disables capillary pressu...
Definition: NullMaterial.hpp:46
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:234
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:171
static const bool isTemperatureDependent
Specify whether the quantities defined by this material law are temperature dependent.
Definition: NullMaterial.hpp:76
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:155
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:142
static const unsigned numPhases
The number of fluid phases.
Definition: NullMaterial.hpp:53
static const bool implementsTwoPhaseSatApi
Specify whether this material law implements the two-phase convenience API which only depends on the ...
Definition: NullMaterial.hpp:61
static const bool isSaturationDependent
Specify whether the quantities defined by this material law are saturation dependent.
Definition: NullMaterial.hpp:68
static void saturations(ContainerT &, const Params &, const FluidState &)
The inverse of the capillary pressure.
Definition: NullMaterial.hpp:102
static void capillaryPressures(ContainerT &values, const Params &, const FluidState &)
Returns constant 0 for all phases.
Definition: NullMaterial.hpp:90
static std::enable_if<(numPhases > 2), Evaluation >::type krg(const Params &, const FluidState &fluidState)
The relative permability of the gas phase.
Definition: NullMaterial.hpp:219
static const bool implementsTwoPhaseApi
Specify whether this material law implements the two-phase convenience API.
Definition: NullMaterial.hpp:57
static void relativePermeabilities(ContainerT &values, const Params &, const FluidState &fluidState)
The relative permeability of all phases.
Definition: NullMaterial.hpp:111
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:197
static std::enable_if<(numPhases > 1), Evaluation >::type krw(const Params &, const FluidState &fluidState)
The relative permability of the wetting phase.
Definition: NullMaterial.hpp:179
static const bool isCompositionDependent
Specify whether the quantities defined by this material law are dependent on the phase composition.
Definition: NullMaterial.hpp:80
static const bool isPressureDependent
Specify whether the quantities defined by this material law are dependent on the absolute pressure.
Definition: NullMaterial.hpp:72
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:129