00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00027 #ifndef OPM_ECL_HYSTERESIS_TWO_PHASE_LAW_HPP
00028 #define OPM_ECL_HYSTERESIS_TWO_PHASE_LAW_HPP
00029
00030 #include "EclHysteresisTwoPhaseLawParams.hpp"
00031
00032 namespace Opm {
00038 template <class EffectiveLawT,
00039 class ParamsT = EclHysteresisTwoPhaseLawParams<EffectiveLawT> >
00040 class EclHysteresisTwoPhaseLaw : public EffectiveLawT::Traits
00041 {
00042 public:
00043 typedef EffectiveLawT EffectiveLaw;
00044 typedef typename EffectiveLaw::Params EffectiveLawParams;
00045
00046 typedef typename EffectiveLaw::Traits Traits;
00047 typedef ParamsT Params;
00048 typedef typename EffectiveLaw::Scalar Scalar;
00049
00050 enum { wettingPhaseIdx = Traits::wettingPhaseIdx };
00051 enum { nonWettingPhaseIdx = Traits::nonWettingPhaseIdx };
00052
00054 static const int numPhases = EffectiveLaw::numPhases;
00055 static_assert(numPhases == 2,
00056 "The endpoint scaling applies to the nested twophase laws, not to "
00057 "the threephase one!");
00058
00061 static const bool implementsTwoPhaseApi = true;
00062
00063 static_assert(EffectiveLaw::implementsTwoPhaseApi,
00064 "The material laws put into EclEpsTwoPhaseLaw must implement the "
00065 "two-phase material law API!");
00066
00069 static const bool implementsTwoPhaseSatApi = true;
00070
00071 static_assert(EffectiveLaw::implementsTwoPhaseSatApi,
00072 "The material laws put into EclEpsTwoPhaseLaw must implement the "
00073 "two-phase material law saturation API!");
00074
00077 static const bool isSaturationDependent = true;
00078
00081 static const bool isPressureDependent = false;
00082
00085 static const bool isTemperatureDependent = false;
00086
00089 static const bool isCompositionDependent = false;
00090
00101 template <class Container, class FluidState>
00102 static void capillaryPressures(Container& ,
00103 const Params& ,
00104 const FluidState& )
00105 {
00106 OPM_THROW(NotImplemented,
00107 "The capillaryPressures(fs) method is not yet implemented");
00108 }
00109
00120 template <class Container, class FluidState>
00121 static void relativePermeabilities(Container& ,
00122 const Params& ,
00123 const FluidState& )
00124 {
00125 OPM_THROW(NotImplemented,
00126 "The pcnw(fs) method is not yet implemented");
00127 }
00128
00140 template <class FluidState, class Evaluation = typename FluidState::Scalar>
00141 static Evaluation pcnw(const Params& ,
00142 const FluidState& )
00143 {
00144 OPM_THROW(NotImplemented,
00145 "The pcnw(fs) method is not yet implemented");
00146 }
00147
00148 template <class Evaluation>
00149 static Evaluation twoPhaseSatPcnw(const Params& params, const Evaluation& Sw)
00150 {
00151
00152 return EffectiveLaw::twoPhaseSatPcnw(params.drainageParams(), Sw);
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165 }
00166
00170 template <class Container, class FluidState>
00171 static void saturations(Container& ,
00172 const Params& ,
00173 const FluidState& )
00174 {
00175 OPM_THROW(NotImplemented,
00176 "The saturations(fs) method is not yet implemented");
00177 }
00178
00183 template <class FluidState, class Evaluation = typename FluidState::Scalar>
00184 static Evaluation Sw(const Params& ,
00185 const FluidState& )
00186 {
00187 OPM_THROW(NotImplemented,
00188 "The Sw(fs) method is not yet implemented");
00189 }
00190
00191 template <class Evaluation>
00192 static Evaluation twoPhaseSatSw(const Params& ,
00193 const Evaluation& )
00194 {
00195 OPM_THROW(NotImplemented,
00196 "The twoPhaseSatSw(pc) method is not yet implemented");
00197 }
00198
00203 template <class FluidState, class Evaluation = typename FluidState::Scalar>
00204 static Evaluation Sn(const Params& ,
00205 const FluidState& )
00206 {
00207 OPM_THROW(NotImplemented,
00208 "The Sn(pc) method is not yet implemented");
00209 }
00210
00211 template <class Evaluation>
00212 static Evaluation twoPhaseSatSn(const Params& ,
00213 const Evaluation& )
00214 {
00215 OPM_THROW(NotImplemented,
00216 "The twoPhaseSatSn(pc) method is not yet implemented");
00217 }
00218
00228 template <class FluidState, class Evaluation = typename FluidState::Scalar>
00229 static Evaluation krw(const Params& ,
00230 const FluidState& )
00231 {
00232 OPM_THROW(NotImplemented,
00233 "The krw(fs) method is not yet implemented");
00234 }
00235
00236 template <class Evaluation>
00237 static Evaluation twoPhaseSatKrw(const Params& params, const Evaluation& Sw)
00238 {
00239
00240
00241 if (!params.config().enableHysteresis() || params.config().krHysteresisModel() < 0)
00242 return EffectiveLaw::twoPhaseSatKrw(params.drainageParams(), Sw);
00243
00244
00245
00246 if (Sw <= params.krwSwMdc())
00247 return EffectiveLaw::twoPhaseSatKrw(params.drainageParams(), Sw);
00248
00249 return EffectiveLaw::twoPhaseSatKrw(params.imbibitionParams(),
00250 Sw + params.deltaSwImbKrw());
00251 }
00252
00256 template <class FluidState, class Evaluation = typename FluidState::Scalar>
00257 static Evaluation krn(const Params& ,
00258 const FluidState& )
00259 {
00260 OPM_THROW(NotImplemented,
00261 "The krn(fs) method is not yet implemented");
00262 }
00263
00264 template <class Evaluation>
00265 static Evaluation twoPhaseSatKrn(const Params& params, const Evaluation& Sw)
00266 {
00267
00268 if (!params.config().enableHysteresis() || params.config().krHysteresisModel() < 0)
00269 return EffectiveLaw::twoPhaseSatKrn(params.drainageParams(), Sw);
00270
00271
00272
00273 if (Sw <= params.krnSwMdc())
00274 return EffectiveLaw::twoPhaseSatKrn(params.drainageParams(), Sw);
00275
00276 return EffectiveLaw::twoPhaseSatKrn(params.imbibitionParams(),
00277 Sw + params.deltaSwImbKrn());
00278 }
00279 };
00280 }
00281
00282 #endif