Minor clean-up and fixes of the WAG hysteresis model
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2021 NORCE.
|
||||
Copyright 2023 Equinor.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@@ -104,6 +104,7 @@ class DeckRecord;
|
||||
static WagHysteresisConfigRecord serializationTestObject()
|
||||
{
|
||||
WagHysteresisConfigRecord result;
|
||||
result.wagLandsParamValue = 0;
|
||||
result.wagSecondaryDrainageReductionValue = 1;
|
||||
result.wagGasFlagValue = true;
|
||||
result.wagResidualOilFlagValue = false;
|
||||
@@ -125,6 +126,11 @@ class DeckRecord;
|
||||
const std::vector<WagHysteresisConfigRecord>::const_iterator begin() const;
|
||||
const std::vector<WagHysteresisConfigRecord>::const_iterator end() const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(wagrecords);
|
||||
}
|
||||
bool operator==(const WagHysteresisConfig& other) const;
|
||||
|
||||
const WagHysteresisConfigRecord& operator[](std::size_t index) const;
|
||||
|
||||
@@ -452,7 +452,7 @@ public:
|
||||
|
||||
changed = changed || oilchanged;
|
||||
|
||||
boool gaschanged = params.gasOilParams().update(/*pcSw=*/ 1.0 - Swco - Sg,
|
||||
bool gaschanged = params.gasOilParams().update(/*pcSw=*/ 1.0 - Swco - Sg,
|
||||
/*krwSw=*/ 1.0 - std::max(Swco, Sw) - Sg, //(Three phase behavior ...)
|
||||
/*krnSw=*/ 1.0 - Swco - Sg);
|
||||
changed = changed || gaschanged;
|
||||
|
||||
@@ -293,10 +293,6 @@ public:
|
||||
template <class Evaluation>
|
||||
static Evaluation twoPhaseSatKrn(const Params& params, const Evaluation& Sw)
|
||||
{
|
||||
// if no relperm hysteresis is enabled, use the drainage curve
|
||||
if (!params.config().enableHysteresis() || params.config().krHysteresisModel() < 0)
|
||||
return EffectiveLaw::twoPhaseSatKrn(params.drainageParams(), Sw);
|
||||
|
||||
// If WAG hysteresis is enabled, the convential hysteresis model is ignored.
|
||||
// (Two-phase model, non-wetting: only gas in oil.)
|
||||
if (params.gasOilHysteresisWAG()) {
|
||||
@@ -334,6 +330,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// if no relperm hysteresis is enabled, use the drainage curve
|
||||
if (!params.config().enableHysteresis() || params.config().krHysteresisModel() < 0)
|
||||
return EffectiveLaw::twoPhaseSatKrn(params.drainageParams(), Sw);
|
||||
|
||||
|
||||
// if it is enabled, use either the drainage or the imbibition curve. if the
|
||||
// imbibition curve is used, the saturation must be shifted.
|
||||
if (Sw <= params.krnSwMdc())
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
|
||||
#include <opm/material/fluidmatrixinteractions/EclHysteresisConfig.hpp>
|
||||
|
||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
@@ -515,7 +516,7 @@ public:
|
||||
* This updates the scanning curves and the imbibition<->drainage reversal points as
|
||||
* appropriate.
|
||||
*/
|
||||
void update(Scalar pcSw, Scalar krwSw, Scalar krnSw)
|
||||
bool update(Scalar pcSw, Scalar krwSw, Scalar krnSw)
|
||||
{
|
||||
bool updateParams = false;
|
||||
|
||||
|
||||
@@ -367,6 +367,15 @@ EclHysterConfig::EclHysterConfig(const Opm::Deck& deck)
|
||||
if (!activeHyst)
|
||||
return;
|
||||
|
||||
if (deck.hasKeyword("WAGHYSTR")) {
|
||||
if ( !(deck.hasKeyword<Opm::ParserKeywords::OIL>() &&
|
||||
deck.hasKeyword<Opm::ParserKeywords::GAS>() &&
|
||||
deck.hasKeyword<Opm::ParserKeywords::WATER>()) )
|
||||
throw std::runtime_error("WAG hysteresis (kw 'WAGHYSTR') requires 'OIL', 'WATER' and 'GAS' present in model. ");
|
||||
|
||||
activeWagHyst = true;
|
||||
}
|
||||
|
||||
if (!deck.hasKeyword("EHYSTR")) {
|
||||
std::string msg = "Hysteresis is enabled via the HYST parameter for SATOPTS, but the EHYSTR "
|
||||
"keyword is not present in the deck. \n"
|
||||
@@ -425,16 +434,6 @@ EclHysterConfig::EclHysterConfig(const Opm::Deck& deck)
|
||||
// Killough model: Regularisation for trapped critical saturation calculations
|
||||
if (pcHystMod == 0 || krHystMod == 2 || krHystMod == 3)
|
||||
modParamTrappedValue = ehystrKeyword.getRecord(0).getItem("mod_param_trapped").get<double>(0);
|
||||
|
||||
if (!deck.hasKeyword("WAGHYSTR"))
|
||||
return;
|
||||
|
||||
if ( !(deck.hasKeyword<Opm::ParserKeywords::OIL>() &&
|
||||
deck.hasKeyword<Opm::ParserKeywords::GAS>() &&
|
||||
deck.hasKeyword<Opm::ParserKeywords::WATER>()) )
|
||||
throw std::runtime_error("WAG hysteresis (kw 'WAGHYSTR') requires 'OIL', 'WATER' and 'GAS' present in model. ");
|
||||
|
||||
activeWagHyst = true;
|
||||
}
|
||||
|
||||
EclHysterConfig EclHysterConfig::serializationTestObject()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2020 Equinor
|
||||
Copyright (C) 2023 Equinor
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user