Skip to content

Commit

Permalink
Remove class EclHysteresisConfig - use Opm::EclHysterConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
joakim-hove committed Jul 28, 2021
1 parent 5863e98 commit 70f45ed
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 165 deletions.
139 changes: 0 additions & 139 deletions opm/material/fluidmatrixinteractions/EclHysteresisConfig.hpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class EclHysteresisTwoPhaseLaw : public EffectiveLawT::Traits
static Evaluation twoPhaseSatKrw(const Params& params, const Evaluation& Sw)
{
// if no relperm hysteresis is enabled, use the drainage curve
if (!params.config().enableHysteresis() || params.config().krHysteresisModel() < 0)
if (!params.config().active() || params.config().krHysteresisModel() < 0)
return EffectiveLaw::twoPhaseSatKrw(params.drainageParams(), Sw);

if (params.config().krHysteresisModel() == 0)
Expand All @@ -254,7 +254,7 @@ class EclHysteresisTwoPhaseLaw : public EffectiveLawT::Traits
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)
if (!params.config().active() || params.config().krHysteresisModel() < 0)
return EffectiveLaw::twoPhaseSatKrn(params.drainageParams(), Sw);

// if it is enabled, use either the drainage or the imbibition curve. if the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@
#ifndef OPM_ECL_HYSTERESIS_TWO_PHASE_LAW_PARAMS_HPP
#define OPM_ECL_HYSTERESIS_TWO_PHASE_LAW_PARAMS_HPP

#include "EclHysteresisConfig.hpp"
#include "EclEpsScalingPoints.hpp"

#if HAVE_ECL_INPUT
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#endif
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>

#include <string>
#include <memory>
Expand Down Expand Up @@ -77,7 +73,7 @@ class EclHysteresisTwoPhaseLawParams : public EnsureFinalized
*/
void finalize()
{
if (config().enableHysteresis()) {
if (config().active()) {
//C_ = 1.0/(Sncri_ - Sncrd_) + 1.0/(Snmaxd_ - Sncrd_);

updateDynamicParams_();
Expand All @@ -89,13 +85,13 @@ class EclHysteresisTwoPhaseLawParams : public EnsureFinalized
/*!
* \brief Set the endpoint scaling configuration object.
*/
void setConfig(std::shared_ptr<EclHysteresisConfig> value)
void setConfig(std::shared_ptr<Opm::EclHysterConfig> value)
{ config_ = value; }

/*!
* \brief Returns the endpoint scaling configuration object.
*/
const EclHysteresisConfig& config() const
const Opm::EclHysterConfig& config() const
{ return *config_; }

/*!
Expand Down Expand Up @@ -307,7 +303,7 @@ class EclHysteresisTwoPhaseLawParams : public EnsureFinalized
#endif
}

std::shared_ptr<EclHysteresisConfig> config_;
std::shared_ptr<Opm::EclHysterConfig> config_;
EffLawParams imbibitionParams_;
EffLawParams drainageParams_;

Expand Down
20 changes: 5 additions & 15 deletions opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
* \file
* \copydoc Opm::EclMaterialLawManager
*/
#if ! HAVE_ECL_INPUT
#error "Eclipse input support in opm-common is required to use the ECL material manager!"
#endif

#ifndef OPM_ECL_MATERIAL_LAW_MANAGER_HPP
#define OPM_ECL_MATERIAL_LAW_MANAGER_HPP

Expand All @@ -37,18 +33,15 @@
#include <opm/material/fluidmatrixinteractions/EclHysteresisTwoPhaseLaw.hpp>
#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
#include <opm/material/fluidmatrixinteractions/EclEpsConfig.hpp>
#include <opm/material/fluidmatrixinteractions/EclHysteresisConfig.hpp>
#include <opm/material/fluidmatrixinteractions/EclMultiplexerMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidstates/SimpleModularFluidState.hpp>

#if HAVE_OPM_COMMON
#include <opm/common/OpmLog/OpmLog.hpp>
#endif

#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/TableColumn.hpp>
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>

#include <algorithm>
#include <cassert>
Expand Down Expand Up @@ -513,7 +506,7 @@ class EclMaterialLawManager
{ return enableEndPointScaling_; }

bool enableHysteresis() const
{ return hysteresisConfig_->enableHysteresis(); }
{ return hysteresisConfig_->active(); }

MaterialLawParams& materialLawParams(unsigned elemIdx)
{
Expand All @@ -539,10 +532,8 @@ class EclMaterialLawManager
{
MaterialLawParams& mlp = *materialLawParams_[elemIdx];

#if HAVE_OPM_COMMON
if (enableHysteresis())
OpmLog::warning("Warning: Using non-default satnum regions for conenction is not tested in combination with hysteresis");
#endif
// Currently we don't support COMPIMP. I.e. use the same table lookup for the hysteresis curves.
// unsigned impRegionIdx = satRegionIdx;

Expand Down Expand Up @@ -727,8 +718,7 @@ class EclMaterialLawManager

void readGlobalHysteresisOptions_(const EclipseState& state)
{
hysteresisConfig_ = std::make_shared<EclHysteresisConfig>();
hysteresisConfig_->initFromState(state.runspec());
hysteresisConfig_ = std::make_shared<Opm::EclHysterConfig>( state.runspec().hysterPar() );
}

void readGlobalThreePhaseOptions_(const Runspec& runspec)
Expand Down Expand Up @@ -1163,7 +1153,7 @@ class EclMaterialLawManager
}

bool enableEndPointScaling_;
std::shared_ptr<EclHysteresisConfig> hysteresisConfig_;
std::shared_ptr<Opm::EclHysterConfig> hysteresisConfig_;

std::shared_ptr<EclEpsConfig> oilWaterEclEpsConfig_;
std::vector<EclEpsScalingPointsInfo<Scalar>> unscaledEpsInfo_;
Expand Down

0 comments on commit 70f45ed

Please sign in to comment.