From 24b23933347c38e59c284a233100af8c2184e2ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Thu, 15 Oct 2020 17:56:11 +0200 Subject: [PATCH] Add parameter --alternative-well-rate-init. With this, a slightly more sophisticated procedure is used for well rate intialization. Since it changes existing results, it defaults to false, giving the existing behaviour. --- opm/simulators/flow/BlackoilModelParametersEbos.hpp | 9 +++++++++ opm/simulators/wells/BlackoilWellModel.hpp | 1 + opm/simulators/wells/BlackoilWellModel_impl.hpp | 10 +++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/opm/simulators/flow/BlackoilModelParametersEbos.hpp b/opm/simulators/flow/BlackoilModelParametersEbos.hpp index f776617b4..27d304cd6 100644 --- a/opm/simulators/flow/BlackoilModelParametersEbos.hpp +++ b/opm/simulators/flow/BlackoilModelParametersEbos.hpp @@ -145,6 +145,10 @@ template struct MaxInnerIterWells { using type = UndefinedProperty; }; +template +struct AlternativeWellRateInit { + using type = UndefinedProperty; +}; template struct DbhpMaxRel { @@ -251,6 +255,10 @@ struct MaxInnerIterWells { static constexpr int value = 50; }; template +struct AlternativeWellRateInit { + static constexpr bool value = false; +}; +template struct StrictInnerIterMsWells { static constexpr int value = 40; }; @@ -432,6 +440,7 @@ namespace Opm EWOMS_REGISTER_PARAM(TypeTag, int, StrictInnerIterMsWells, "Number of inner iterations for multi-segment wells with strict tolerance"); EWOMS_REGISTER_PARAM(TypeTag, bool, UseInnerIterationsWells, "Use nested iterations for standard wells"); EWOMS_REGISTER_PARAM(TypeTag, int, MaxInnerIterWells, "Maximum number of inner iterations for standard wells"); + EWOMS_REGISTER_PARAM(TypeTag, bool, AlternativeWellRateInit, "Use alternative well rate initialization procedure"); EWOMS_REGISTER_PARAM(TypeTag, Scalar, RegularizationFactorMsw, "Regularization factor for ms wells"); EWOMS_REGISTER_PARAM(TypeTag, Scalar, MaxSinglePrecisionDays, "Maximum time step size where single precision floating point arithmetic can be used solving for the linear systems of equations"); EWOMS_REGISTER_PARAM(TypeTag, int, MaxStrictIter, "Maximum number of Newton iterations before relaxed tolerances are used for the CNV convergence criterion"); diff --git a/opm/simulators/wells/BlackoilWellModel.hpp b/opm/simulators/wells/BlackoilWellModel.hpp index 41817eadf..e638e1002 100644 --- a/opm/simulators/wells/BlackoilWellModel.hpp +++ b/opm/simulators/wells/BlackoilWellModel.hpp @@ -307,6 +307,7 @@ namespace Opm { bool initial_step_; bool report_step_starts_; bool glift_debug = false; + bool alternative_well_rate_init_; std::unique_ptr rateConverter_; std::unique_ptr> vfp_properties_; diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 6fb269399..3be53596b 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -63,6 +63,8 @@ namespace Opm { value); return candidate == parallel_wells.end() || *candidate != value; }; + + alternative_well_rate_init_ = EWOMS_GET_PARAM(TypeTag, bool, AlternativeWellRateInit); } template @@ -393,9 +395,11 @@ namespace Opm { local_deferredLogger.warning("WELL_POTENTIAL_CALCULATION_FAILED", msg); } - // Update the well rates to match state, if only single-phase rates. - for (auto& well : well_container_) { - well->updateWellStateRates(ebosSimulator_, well_state_, local_deferredLogger); + if (alternative_well_rate_init_) { + // Update the well rates to match state, if only single-phase rates. + for (auto& well : well_container_) { + well->updateWellStateRates(ebosSimulator_, well_state_, local_deferredLogger); + } } //compute well guideRates