27 #ifndef OPM_ECL_HYSTERESIS_TWO_PHASE_LAW_PARAMS_HPP
28 #define OPM_ECL_HYSTERESIS_TWO_PHASE_LAW_PARAMS_HPP
34 #include <opm/input/eclipse/Deck/Deck.hpp>
35 #include <opm/input/eclipse/EclipseState/EclipseState.hpp>
52 template <
class EffLawT>
55 typedef typename EffLawT::Params EffLawParams;
56 typedef typename EffLawParams::Traits::Scalar Scalar;
59 typedef typename EffLawParams::Traits Traits;
80 if (
config().enableHysteresis()) {
83 updateDynamicParams_();
92 void setConfig(std::shared_ptr<EclHysteresisConfig> value)
106 drainageParams_ = value;
113 {
return drainageParams_; }
116 {
return drainageParams_; }
125 imbibitionParams_ = value;
142 {
return imbibitionParams_; }
145 {
return imbibitionParams_; }
152 { pcSwMdc_ = value; }
185 { krnSwMdc_ = value; }
193 {
return krnSwMdc_; }
225 { deltaSwImbKrn_ = value; }
235 {
return deltaSwImbKrn_; }
243 void update(Scalar pcSw, Scalar , Scalar krnSw)
245 bool updateParams =
false;
246 if (pcSw < pcSwMdc_) {
264 if (krnSw < krnSwMdc_) {
270 updateDynamicParams_();
274 void updateDynamicParams_()
285 Scalar krnMdcDrainage = EffLawT::twoPhaseSatKrn(
drainageParams(), krnSwMdc_);
286 Scalar SwKrnMdcImbibition = EffLawT::twoPhaseSatKrnInv(
imbibitionParams(), krnMdcDrainage);
287 deltaSwImbKrn_ = SwKrnMdcImbibition - krnSwMdc_;
295 assert(std::abs(EffLawT::twoPhaseSatKrn(
imbibitionParams(), krnSwMdc_ + deltaSwImbKrn_)
301 Scalar Snhy = 1.0 - SwMdc_;
303 Sncrt_ = Sncrd_ + (Snhy - Sncrd_)/(1 + C_*(Snhy - Sncrd_));
307 std::shared_ptr<EclHysteresisConfig> config_;
308 EffLawParams imbibitionParams_;
309 EffLawParams drainageParams_;
322 Scalar deltaSwImbKrn_;
EclTwoPhaseSystemType
Specified which fluids are involved in a given twophase material law for endpoint scaling.
Definition: EclEpsConfig.hpp:49
Specifies the configuration used by the ECL kr/pC hysteresis code.
Default implementation for asserting finalization of parameter objects.
Specifies the configuration used by the ECL kr/pC hysteresis code.
Definition: EclHysteresisConfig.hpp:48
A default implementation of the parameters for the material law which implements the ECL relative per...
Definition: EclHysteresisTwoPhaseLawParams.hpp:54
Scalar pcSwMdc() const
Get the saturation of the wetting phase where the last switch from the main drainage curve to imbibit...
Definition: EclHysteresisTwoPhaseLawParams.hpp:158
const EffLawParams & drainageParams() const
Returns the parameters used for the drainage curve.
Definition: EclHysteresisTwoPhaseLawParams.hpp:112
void setDeltaSwImbKrn(Scalar value)
Sets the saturation value which must be added if krn is calculated using the imbibition curve.
Definition: EclHysteresisTwoPhaseLawParams.hpp:224
void setConfig(std::shared_ptr< EclHysteresisConfig > value)
Set the endpoint scaling configuration object.
Definition: EclHysteresisTwoPhaseLawParams.hpp:92
void setImbibitionParams(const EffLawParams &value, const EclEpsScalingPointsInfo< Scalar > &, EclTwoPhaseSystemType)
Sets the parameters used for the imbibition curve.
Definition: EclHysteresisTwoPhaseLawParams.hpp:121
Scalar krnSwMdc() const
Get the saturation of the wetting phase where the last switch from the main drainage curve to imbibit...
Definition: EclHysteresisTwoPhaseLawParams.hpp:192
void setKrnSwMdc(Scalar value)
Set the saturation of the wetting phase where the last switch from the main drainage curve (MDC) to i...
Definition: EclHysteresisTwoPhaseLawParams.hpp:184
void setDeltaSwImbKrw(Scalar)
Sets the saturation value which must be added if krw is calculated using the imbibition curve.
Definition: EclHysteresisTwoPhaseLawParams.hpp:202
void setDrainageParams(const EffLawParams &value)
Sets the parameters used for the drainage curve.
Definition: EclHysteresisTwoPhaseLawParams.hpp:104
void setPcSwMdc(Scalar value)
Set the saturation of the wetting phase where the last switch from the main drainage curve (MDC) to i...
Definition: EclHysteresisTwoPhaseLawParams.hpp:151
void setKrwSwMdc(Scalar)
Set the saturation of the wetting phase where the last switch from the main drainage curve (MDC) to i...
Definition: EclHysteresisTwoPhaseLawParams.hpp:166
void finalize()
Calculate all dependent quantities once the independent quantities of the parameter object have been ...
Definition: EclHysteresisTwoPhaseLawParams.hpp:78
Scalar deltaSwImbKrn() const
Returns the saturation value which must be added if krn is calculated using the imbibition curve.
Definition: EclHysteresisTwoPhaseLawParams.hpp:234
Scalar deltaSwImbKrw() const
Returns the saturation value which must be added if krw is calculated using the imbibition curve.
Definition: EclHysteresisTwoPhaseLawParams.hpp:213
const EclHysteresisConfig & config() const
Returns the endpoint scaling configuration object.
Definition: EclHysteresisTwoPhaseLawParams.hpp:98
Scalar krwSwMdc() const
Get the saturation of the wetting phase where the last switch from the main drainage curve to imbibit...
Definition: EclHysteresisTwoPhaseLawParams.hpp:175
const EffLawParams & imbibitionParams() const
Returns the parameters used for the imbibition curve.
Definition: EclHysteresisTwoPhaseLawParams.hpp:141
void update(Scalar pcSw, Scalar, Scalar krnSw)
Notify the hysteresis law that a given wetting-phase saturation has been seen.
Definition: EclHysteresisTwoPhaseLawParams.hpp:243
Default implementation for asserting finalization of parameter objects.
Definition: EnsureFinalized.hpp:47
void finalize()
Mark the object as finalized.
Definition: EnsureFinalized.hpp:75
This structure represents all values which can be possibly used as scaling points in the endpoint sca...
Definition: EclEpsScalingPoints.hpp:62