27 #ifndef OPM_ECL_HYSTERESIS_TWO_PHASE_LAW_PARAMS_HPP
28 #define OPM_ECL_HYSTERESIS_TWO_PHASE_LAW_PARAMS_HPP
34 #include <opm/parser/eclipse/Deck/Deck.hpp>
35 #include <opm/parser/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 EclTwoPhaseSystemType )
109 drainageParams_ = *value;
116 {
return drainageParams_; }
119 {
return drainageParams_; }
126 EclTwoPhaseSystemType )
128 imbibitionParams_ = *value;
145 {
return imbibitionParams_; }
148 {
return imbibitionParams_; }
155 { pcSwMdc_ = value; }
188 { krnSwMdc_ = value; }
196 {
return krnSwMdc_; }
228 { deltaSwImbKrn_ = value; }
238 {
return deltaSwImbKrn_; }
246 void update(Scalar pcSw, Scalar , Scalar krnSw)
248 bool updateParams =
false;
249 if (pcSw < pcSwMdc_) {
267 if (krnSw < krnSwMdc_) {
273 updateDynamicParams_();
277 void updateDynamicParams_()
288 Scalar krnMdcDrainage = EffLawT::twoPhaseSatKrn(
drainageParams(), krnSwMdc_);
289 Scalar SwKrnMdcImbibition = EffLawT::twoPhaseSatKrnInv(
imbibitionParams(), krnMdcDrainage);
290 deltaSwImbKrn_ = SwKrnMdcImbibition - krnSwMdc_;
298 assert(std::abs(EffLawT::twoPhaseSatKrn(
imbibitionParams(), krnSwMdc_ + deltaSwImbKrn_)
304 Scalar Snhy = 1.0 - SwMdc_;
306 Sncrt_ = Sncrd_ + (Snhy - Sncrd_)/(1 + C_*(Snhy - Sncrd_));
310 std::shared_ptr<EclHysteresisConfig> config_;
311 EffLawParams imbibitionParams_;
312 EffLawParams drainageParams_;
325 Scalar deltaSwImbKrn_;
Scalar krwSwMdc() const
Get the saturation of the wetting phase where the last switch from the main drainage curve to imbibit...
Definition: EclHysteresisTwoPhaseLawParams.hpp:178
Scalar pcSwMdc() const
Get the saturation of the wetting phase where the last switch from the main drainage curve to imbibit...
Definition: EclHysteresisTwoPhaseLawParams.hpp:161
void setDrainageParams(std::shared_ptr< EffLawParams > value, const EclEpsScalingPointsInfo< Scalar > &, EclTwoPhaseSystemType)
Sets the parameters used for the drainage curve.
Definition: EclHysteresisTwoPhaseLawParams.hpp:104
Scalar deltaSwImbKrn() const
Returns the saturation value which must be added if krn is calculated using the imbibition curve...
Definition: EclHysteresisTwoPhaseLawParams.hpp:237
A default implementation of the parameters for the material law which implements the ECL relative per...
Definition: EclHysteresisTwoPhaseLawParams.hpp:53
void setDeltaSwImbKrw(Scalar)
Sets the saturation value which must be added if krw is calculated using the imbibition curve...
Definition: EclHysteresisTwoPhaseLawParams.hpp:205
This structure represents all values which can be possibly used as scaling points in the endpoint sca...
Definition: EclEpsScalingPoints.hpp:154
void finalize()
Calculate all dependent quantities once the independent quantities of the parameter object have been ...
Definition: EclHysteresisTwoPhaseLawParams.hpp:78
const EffLawParams & drainageParams() const
Returns the parameters used for the drainage curve.
Definition: EclHysteresisTwoPhaseLawParams.hpp:115
void update(Scalar pcSw, Scalar, Scalar krnSw)
Notify the hysteresis law that a given wetting-phase saturation has been seen.
Definition: EclHysteresisTwoPhaseLawParams.hpp:246
Default implementation for asserting finalization of parameter objects.
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:169
Specifies the configuration used by the ECL kr/pC hysteresis code.
Definition: EclHysteresisConfig.hpp:50
void setConfig(std::shared_ptr< EclHysteresisConfig > value)
Set the endpoint scaling configuration object.
Definition: EclHysteresisTwoPhaseLawParams.hpp:92
const EffLawParams & imbibitionParams() const
Returns the parameters used for the imbibition curve.
Definition: EclHysteresisTwoPhaseLawParams.hpp:144
Scalar deltaSwImbKrw() const
Returns the saturation value which must be added if krw is calculated using the imbibition curve...
Definition: EclHysteresisTwoPhaseLawParams.hpp:216
void setImbibitionParams(std::shared_ptr< EffLawParams > value, const EclEpsScalingPointsInfo< Scalar > &, EclTwoPhaseSystemType)
Sets the parameters used for the imbibition curve.
Definition: EclHysteresisTwoPhaseLawParams.hpp:124
const EclHysteresisConfig & config() const
Returns the endpoint scaling configuration object.
Definition: EclHysteresisTwoPhaseLawParams.hpp:98
void setDeltaSwImbKrn(Scalar value)
Sets the saturation value which must be added if krn is calculated using the imbibition curve...
Definition: EclHysteresisTwoPhaseLawParams.hpp:227
void finalize()
Mark the object as finalized.
Definition: EnsureFinalized.hpp:77
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:154
Default implementation for asserting finalization of parameter objects.
Definition: EnsureFinalized.hpp:46
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:187
Specifies the configuration used by the ECL kr/pC hysteresis code.
Scalar krnSwMdc() const
Get the saturation of the wetting phase where the last switch from the main drainage curve to imbibit...
Definition: EclHysteresisTwoPhaseLawParams.hpp:195