EclGenericProblem: remove unused time steppping parameters

and remove some hidden duplicates
This commit is contained in:
Arne Morten Kvarving 2023-08-02 15:27:51 +02:00
parent c1e1b0ee70
commit 13b0e14f18
8 changed files with 19 additions and 46 deletions

View File

@ -367,10 +367,6 @@ protected:
bool enableTuning_; bool enableTuning_;
Scalar initialTimeStepSize_; Scalar initialTimeStepSize_;
Scalar maxTimeStepAfterWellEvent_; Scalar maxTimeStepAfterWellEvent_;
Scalar maxTimeStepSize_;
Scalar restartShrinkFactor_;
unsigned maxFails_;
Scalar minTimeStepSize_;
// equilibration parameters // equilibration parameters
int numPressurePointsEquil_; int numPressurePointsEquil_;

View File

@ -471,9 +471,6 @@ beginEpisode_(bool enableExperiments,
const auto& tuning = sched_state.tuning(); const auto& tuning = sched_state.tuning();
initialTimeStepSize_ = sched_state.max_next_tstep(); initialTimeStepSize_ = sched_state.max_next_tstep();
maxTimeStepAfterWellEvent_ = tuning.TMAXWC; maxTimeStepAfterWellEvent_ = tuning.TMAXWC;
maxTimeStepSize_ = tuning.TSMAXZ;
restartShrinkFactor_ = 1./tuning.TSFCNV;
minTimeStepSize_ = tuning.TSMINZ;
return true; return true;
} }

View File

@ -78,6 +78,7 @@
#include <opm/output/eclipse/EclipseIO.hpp> #include <opm/output/eclipse/EclipseIO.hpp>
#include <opm/simulators/flow/EclActionHandler.hpp> #include <opm/simulators/flow/EclActionHandler.hpp>
#include <opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp>
#include <opm/simulators/timestepping/SimulatorReport.hpp> #include <opm/simulators/timestepping/SimulatorReport.hpp>
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp> #include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
#include <opm/simulators/utils/ParallelSerialization.hpp> #include <opm/simulators/utils/ParallelSerialization.hpp>
@ -222,10 +223,6 @@ public:
if constexpr (enableExperiments) if constexpr (enableExperiments)
EWOMS_REGISTER_PARAM(TypeTag, bool, EclEnableAquifers, EWOMS_REGISTER_PARAM(TypeTag, bool, EclEnableAquifers,
"Enable analytic and numeric aquifer models"); "Enable analytic and numeric aquifer models");
EWOMS_REGISTER_PARAM(TypeTag, Scalar, EclMaxTimeStepSizeAfterWellEvent,
"Maximum time step size after an well event");
EWOMS_REGISTER_PARAM(TypeTag, Scalar, EclRestartShrinkFactor,
"Factor by which the time step is reduced after convergence failure");
EWOMS_REGISTER_PARAM(TypeTag, bool, EclEnableTuning, EWOMS_REGISTER_PARAM(TypeTag, bool, EclEnableTuning,
"Honor some aspects of the TUNING keyword from the ECL deck."); "Honor some aspects of the TUNING keyword from the ECL deck.");
EWOMS_REGISTER_PARAM(TypeTag, std::string, OutputMode, EWOMS_REGISTER_PARAM(TypeTag, std::string, OutputMode,
@ -233,7 +230,6 @@ public:
EWOMS_REGISTER_PARAM(TypeTag, int, NumPressurePointsEquil, EWOMS_REGISTER_PARAM(TypeTag, int, NumPressurePointsEquil,
"Number of pressure points (in each direction) in tables used for equilibration"); "Number of pressure points (in each direction) in tables used for equilibration");
EWOMS_HIDE_PARAM(TypeTag, NumPressurePointsEquil); // Users will typically not need to modify this parameter.. EWOMS_HIDE_PARAM(TypeTag, NumPressurePointsEquil); // Users will typically not need to modify this parameter..
} }
@ -307,11 +303,7 @@ public:
this->enableTuning_ = EWOMS_GET_PARAM(TypeTag, bool, EclEnableTuning); this->enableTuning_ = EWOMS_GET_PARAM(TypeTag, bool, EclEnableTuning);
this->initialTimeStepSize_ = EWOMS_GET_PARAM(TypeTag, Scalar, InitialTimeStepSize); this->initialTimeStepSize_ = EWOMS_GET_PARAM(TypeTag, Scalar, InitialTimeStepSize);
this->minTimeStepSize_ = EWOMS_GET_PARAM(TypeTag, Scalar, MinTimeStepSize); this->maxTimeStepAfterWellEvent_ = EWOMS_GET_PARAM(TypeTag, double, TimeStepAfterEventInDays)*24*60*60;
this->maxTimeStepSize_ = EWOMS_GET_PARAM(TypeTag, Scalar, MaxTimeStepSize);
this->maxTimeStepAfterWellEvent_ = EWOMS_GET_PARAM(TypeTag, Scalar, EclMaxTimeStepSizeAfterWellEvent);
this->restartShrinkFactor_ = EWOMS_GET_PARAM(TypeTag, Scalar, EclRestartShrinkFactor);
this->maxFails_ = EWOMS_GET_PARAM(TypeTag, unsigned, MaxTimeStepDivisions);
// The value N for this parameter is defined in the following order of presedence: // The value N for this parameter is defined in the following order of presedence:
// 1. Command line value (--num-pressure-points-equil=N) // 1. Command line value (--num-pressure-points-equil=N)
@ -365,9 +357,6 @@ public:
const auto& tuning = schedule[0].tuning(); const auto& tuning = schedule[0].tuning();
this->initialTimeStepSize_ = tuning.TSINIT; this->initialTimeStepSize_ = tuning.TSINIT;
this->maxTimeStepAfterWellEvent_ = tuning.TMAXWC; this->maxTimeStepAfterWellEvent_ = tuning.TMAXWC;
this->maxTimeStepSize_ = tuning.TSMAXZ;
this->restartShrinkFactor_ = 1./tuning.TSFCNV;
this->minTimeStepSize_ = tuning.TSMINZ;
} }
this->initFluidSystem_(); this->initFluidSystem_();

View File

@ -124,14 +124,6 @@ struct EclEnableAquifers {
// time stepping parameters // time stepping parameters
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct EclMaxTimeStepSizeAfterWellEvent {
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag>
struct EclRestartShrinkFactor {
using type = UndefinedProperty;
};
template<class TypeTag, class MyTypeTag>
struct EclEnableTuning { struct EclEnableTuning {
using type = UndefinedProperty; using type = UndefinedProperty;
}; };
@ -534,16 +526,6 @@ struct EnableExperiments<TypeTag, TTag::EclBaseProblem> {
// set defaults for the time stepping parameters // set defaults for the time stepping parameters
template<class TypeTag> template<class TypeTag>
struct EclMaxTimeStepSizeAfterWellEvent<TypeTag, TTag::EclBaseProblem> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 3600*24*365.25;
};
template<class TypeTag>
struct EclRestartShrinkFactor<TypeTag, TTag::EclBaseProblem> {
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 3;
};
template<class TypeTag>
struct EclEnableTuning<TypeTag, TTag::EclBaseProblem> { struct EclEnableTuning<TypeTag, TTag::EclBaseProblem> {
static constexpr bool value = false; static constexpr bool value = false;
}; };

View File

@ -164,8 +164,6 @@ void handleExtraConvergenceOutput(SimulatorReport& report,
EWOMS_HIDE_PARAM(TypeTag, MinTimeStepSize); EWOMS_HIDE_PARAM(TypeTag, MinTimeStepSize);
EWOMS_HIDE_PARAM(TypeTag, PredeterminedTimeStepsFile); EWOMS_HIDE_PARAM(TypeTag, PredeterminedTimeStepsFile);
EWOMS_HIDE_PARAM(TypeTag, EclMaxTimeStepSizeAfterWellEvent);
EWOMS_HIDE_PARAM(TypeTag, EclRestartShrinkFactor);
EWOMS_HIDE_PARAM(TypeTag, EclEnableTuning); EWOMS_HIDE_PARAM(TypeTag, EclEnableTuning);
// flow also does not use the eWoms Newton method // flow also does not use the eWoms Newton method

View File

@ -57,6 +57,14 @@
#include <algorithm> #include <algorithm>
namespace Opm::Properties {
namespace TTag {
struct TestRestartTypeTag {
using InheritsFrom = std::tuple<EbosTypeTag, FlowTimeSteppingParameters>;
};
}
}
template<class T> template<class T>
std::tuple<T,int,int> PackUnpack(T& in) std::tuple<T,int,int> PackUnpack(T& in)
{ {
@ -427,11 +435,12 @@ namespace {
struct AquiferFixture { struct AquiferFixture {
AquiferFixture() { AquiferFixture() {
using TT = Opm::Properties::TTag::EbosTypeTag; using TT = Opm::Properties::TTag::TestRestartTypeTag;
const char* argv[] = { const char* argv[] = {
"test_RestartSerialization", "test_RestartSerialization",
"--ecl-deck-file-name=GLIFT1.DATA" "--ecl-deck-file-name=GLIFT1.DATA"
}; };
Opm::AdaptiveTimeSteppingEbos<TT>::registerParameters();
Opm::setupParameters_<TT>(2, argv, /*registerParams=*/true); Opm::setupParameters_<TT>(2, argv, /*registerParams=*/true);
Opm::EclGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>()); Opm::EclGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
} }
@ -444,7 +453,7 @@ BOOST_GLOBAL_FIXTURE(AquiferFixture);
#define TEST_FOR_AQUIFER(TYPE) \ #define TEST_FOR_AQUIFER(TYPE) \
BOOST_AUTO_TEST_CASE(TYPE) \ BOOST_AUTO_TEST_CASE(TYPE) \
{ \ { \
using TT = Opm::Properties::TTag::EbosTypeTag; \ using TT = Opm::Properties::TTag::TestRestartTypeTag; \
Opm::EclGenericVanguard::readDeck("GLIFT1.DATA"); \ Opm::EclGenericVanguard::readDeck("GLIFT1.DATA"); \
using Simulator = Opm::GetPropType<TT, Opm::Properties::Simulator>; \ using Simulator = Opm::GetPropType<TT, Opm::Properties::Simulator>; \
Simulator sim; \ Simulator sim; \
@ -465,7 +474,7 @@ TEST_FOR_AQUIFER(AquiferFetkovich)
BOOST_AUTO_TEST_CASE(AquiferNumerical) BOOST_AUTO_TEST_CASE(AquiferNumerical)
{ {
using TT = Opm::Properties::TTag::EbosTypeTag; using TT = Opm::Properties::TTag::TestRestartTypeTag;
Opm::EclGenericVanguard::readDeck("GLIFT1.DATA"); Opm::EclGenericVanguard::readDeck("GLIFT1.DATA");
using Simulator = Opm::GetPropType<TT, Opm::Properties::Simulator>; using Simulator = Opm::GetPropType<TT, Opm::Properties::Simulator>;
Simulator sim; Simulator sim;
@ -483,7 +492,7 @@ BOOST_AUTO_TEST_CASE(AquiferNumerical)
BOOST_AUTO_TEST_CASE(AquiferConstantFlux) BOOST_AUTO_TEST_CASE(AquiferConstantFlux)
{ {
using TT = Opm::Properties::TTag::EbosTypeTag; using TT = Opm::Properties::TTag::TestRestartTypeTag;
Opm::EclGenericVanguard::readDeck("GLIFT1.DATA"); Opm::EclGenericVanguard::readDeck("GLIFT1.DATA");
using Simulator = Opm::GetPropType<TT, Opm::Properties::Simulator>; using Simulator = Opm::GetPropType<TT, Opm::Properties::Simulator>;
Simulator sim; Simulator sim;

View File

@ -82,7 +82,7 @@ namespace TTag {
struct TestEquilTypeTag { struct TestEquilTypeTag {
using InheritsFrom = std::tuple<FlowModelParameters, EclBaseProblem, BlackOilModel>; using InheritsFrom = std::tuple<FlowTimeSteppingParameters, FlowModelParameters, EclBaseProblem, BlackOilModel>;
}; };
struct TestEquilVapwatTypeTag { struct TestEquilVapwatTypeTag {
using InheritsFrom = std::tuple<FlowModelParameters, EclBaseProblem, BlackOilModel>; using InheritsFrom = std::tuple<FlowModelParameters, EclBaseProblem, BlackOilModel>;
@ -239,6 +239,7 @@ struct EquilFixture {
#endif #endif
Opm::EclGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>()); Opm::EclGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
Opm::BlackoilModelParametersEbos<TypeTag>::registerParameters(); Opm::BlackoilModelParametersEbos<TypeTag>::registerParameters();
Opm::AdaptiveTimeSteppingEbos<TypeTag>::registerParameters();
Opm::Parameters::registerParam<TypeTag, bool>("EnableTerminalOutput", Opm::Parameters::registerParam<TypeTag, bool>("EnableTerminalOutput",
"EnableTerminalOutput", "EnableTerminalOutput",
Opm::getPropValue<TypeTag, Opm::Properties::EnableTerminalOutput>(), Opm::getPropValue<TypeTag, Opm::Properties::EnableTerminalOutput>(),

View File

@ -67,7 +67,7 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag { namespace TTag {
struct TestGliftTypeTag { struct TestGliftTypeTag {
using InheritsFrom = std::tuple<EbosTypeTag>; using InheritsFrom = std::tuple<EbosTypeTag, FlowTimeSteppingParameters>;
}; };
} }
} }
@ -86,6 +86,7 @@ initSimulator(const char *filename)
filename_arg.c_str() filename_arg.c_str()
}; };
Opm::AdaptiveTimeSteppingEbos<TypeTag>::registerParameters();
Opm::setupParameters_<TypeTag>(/*argc=*/sizeof(argv)/sizeof(argv[0]), argv, /*registerParams=*/true); Opm::setupParameters_<TypeTag>(/*argc=*/sizeof(argv)/sizeof(argv[0]), argv, /*registerParams=*/true);
Opm::EclGenericVanguard::readDeck(filename); Opm::EclGenericVanguard::readDeck(filename);