diff --git a/opm/simulators/flow/BlackoilModelParametersEbos.hpp b/opm/simulators/flow/BlackoilModelParametersEbos.hpp index 1da083a47..074724cc5 100644 --- a/opm/simulators/flow/BlackoilModelParametersEbos.hpp +++ b/opm/simulators/flow/BlackoilModelParametersEbos.hpp @@ -168,6 +168,16 @@ template struct UseAverageDensityMsWells { using type = UndefinedProperty; }; +// Network solver parameters +template +struct NetworkMaxStrictIterations { + using type = UndefinedProperty; +}; +template +struct NetworkMaxIterations { + using type = UndefinedProperty; +}; + template struct DbhpMaxRel { @@ -316,6 +326,15 @@ template struct UseAverageDensityMsWells { static constexpr bool value = false; }; +// Network solver parameters +template +struct NetworkMaxStrictIterations { + static constexpr int value = 100; +}; +template +struct NetworkMaxIterations { + static constexpr int value = 200; +}; @@ -436,6 +455,11 @@ namespace Opm /// Whether to approximate segment densities by averaging over segment and its outlet bool use_average_density_ms_wells_; + /// Maximum number of iterations in the network solver before relaxing tolerance + int network_max_strict_iterations_; + + /// Maximum number of iterations in the network solver before giving up + int network_max_iterations_; /// Construct from user parameters or defaults. @@ -474,6 +498,8 @@ namespace Opm max_number_of_well_switches_ = EWOMS_GET_PARAM(TypeTag, int, MaximumNumberOfWellSwitches); use_average_density_ms_wells_ = EWOMS_GET_PARAM(TypeTag, bool, UseAverageDensityMsWells); deck_file_name_ = EWOMS_GET_PARAM(TypeTag, std::string, EclDeckFileName); + network_max_strict_iterations_ = EWOMS_GET_PARAM(TypeTag, int, NetworkMaxStrictIterations); + network_max_iterations_ = EWOMS_GET_PARAM(TypeTag, int, NetworkMaxIterations); } static void registerParameters() @@ -512,6 +538,8 @@ namespace Opm EWOMS_REGISTER_PARAM(TypeTag, bool, EnableWellOperabilityCheckIter, "Enable the well operability checking during iterations"); EWOMS_REGISTER_PARAM(TypeTag, int, MaximumNumberOfWellSwitches, "Maximum number of times a well can switch to the same control"); EWOMS_REGISTER_PARAM(TypeTag, bool, UseAverageDensityMsWells, "Approximate segment densitities by averaging over segment and its outlet"); + EWOMS_REGISTER_PARAM(TypeTag, int, NetworkMaxStrictIterations, "Maximum iterations in network solver before relaxing tolerance"); + EWOMS_REGISTER_PARAM(TypeTag, int, NetworkMaxIterations, "Maximum number of iterations in the network solver before giving up"); } }; } // namespace Opm diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 04ed73c9d..6b6031589 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -972,9 +972,9 @@ namespace Opm { bool do_network_update = true; bool well_group_control_changed = false; // after certain number of the iterations, we use relaxed tolerance for the network update - constexpr size_t iteration_to_relax = 100; + const size_t iteration_to_relax = param_.network_max_strict_iterations_; // after certain number of the iterations, we terminate - constexpr size_t max_iteration = 200; + const size_t max_iteration = param_.network_max_iterations_; std::size_t network_update_iteration = 0; while (do_network_update) { if (network_update_iteration == iteration_to_relax) {