Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove class EclHysteresisConfig - use Opm::EclHysterConfig #467

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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