mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #5642 from steink/Revert-5613
Revert #5613 but keep as option
This commit is contained in:
commit
84e6ed6493
@ -72,6 +72,7 @@ BlackoilModelParameters<Scalar>::BlackoilModelParameters()
|
|||||||
use_average_density_ms_wells_ = Parameters::Get<Parameters::UseAverageDensityMsWells>();
|
use_average_density_ms_wells_ = Parameters::Get<Parameters::UseAverageDensityMsWells>();
|
||||||
local_well_solver_control_switching_ = Parameters::Get<Parameters::LocalWellSolveControlSwitching>();
|
local_well_solver_control_switching_ = Parameters::Get<Parameters::LocalWellSolveControlSwitching>();
|
||||||
use_implicit_ipr_ = Parameters::Get<Parameters::UseImplicitIpr>();
|
use_implicit_ipr_ = Parameters::Get<Parameters::UseImplicitIpr>();
|
||||||
|
check_group_constraints_inner_well_iterations_ = Parameters::Get<Parameters::CheckGroupConstraintsInnerWellIterations>();
|
||||||
nonlinear_solver_ = Parameters::Get<Parameters::NonlinearSolver>();
|
nonlinear_solver_ = Parameters::Get<Parameters::NonlinearSolver>();
|
||||||
const auto approach = Parameters::Get<Parameters::LocalSolveApproach>();
|
const auto approach = Parameters::Get<Parameters::LocalSolveApproach>();
|
||||||
if (approach == "jacobi") {
|
if (approach == "jacobi") {
|
||||||
@ -195,6 +196,8 @@ void BlackoilModelParameters<Scalar>::registerParameters()
|
|||||||
("Allow control switching during local well solutions");
|
("Allow control switching during local well solutions");
|
||||||
Parameters::Register<Parameters::UseImplicitIpr>
|
Parameters::Register<Parameters::UseImplicitIpr>
|
||||||
("Compute implict IPR for stability checks and stable solution search");
|
("Compute implict IPR for stability checks and stable solution search");
|
||||||
|
Parameters::Register<Parameters::CheckGroupConstraintsInnerWellIterations>
|
||||||
|
("Allow checking of group constraints during inner well iterations");
|
||||||
Parameters::Register<Parameters::NetworkMaxStrictIterations>
|
Parameters::Register<Parameters::NetworkMaxStrictIterations>
|
||||||
("Maximum iterations in network solver before relaxing tolerance");
|
("Maximum iterations in network solver before relaxing tolerance");
|
||||||
Parameters::Register<Parameters::NetworkMaxIterations>
|
Parameters::Register<Parameters::NetworkMaxIterations>
|
||||||
|
@ -115,6 +115,7 @@ struct MaximumNumberOfWellSwitches { static constexpr int value = 3; };
|
|||||||
struct UseAverageDensityMsWells { static constexpr bool value = false; };
|
struct UseAverageDensityMsWells { static constexpr bool value = false; };
|
||||||
struct LocalWellSolveControlSwitching { static constexpr bool value = true; };
|
struct LocalWellSolveControlSwitching { static constexpr bool value = true; };
|
||||||
struct UseImplicitIpr { static constexpr bool value = true; };
|
struct UseImplicitIpr { static constexpr bool value = true; };
|
||||||
|
struct CheckGroupConstraintsInnerWellIterations { static constexpr bool value = true; };
|
||||||
|
|
||||||
// Network solver parameters
|
// Network solver parameters
|
||||||
struct NetworkMaxStrictIterations { static constexpr int value = 100; };
|
struct NetworkMaxStrictIterations { static constexpr int value = 100; };
|
||||||
@ -260,6 +261,9 @@ public:
|
|||||||
/// Whether to use implicit IPR for thp stability checks and solution search
|
/// Whether to use implicit IPR for thp stability checks and solution search
|
||||||
bool use_implicit_ipr_;
|
bool use_implicit_ipr_;
|
||||||
|
|
||||||
|
/// Whether to allow checking/changing to group controls during inner well iterations
|
||||||
|
bool check_group_constraints_inner_well_iterations_;
|
||||||
|
|
||||||
/// Maximum number of iterations in the network solver before relaxing tolerance
|
/// Maximum number of iterations in the network solver before relaxing tolerance
|
||||||
int network_max_strict_iterations_;
|
int network_max_strict_iterations_;
|
||||||
|
|
||||||
|
@ -279,6 +279,7 @@ namespace Opm
|
|||||||
const bool fixed_status)
|
const bool fixed_status)
|
||||||
{
|
{
|
||||||
const auto& summary_state = simulator.vanguard().summaryState();
|
const auto& summary_state = simulator.vanguard().summaryState();
|
||||||
|
const auto& schedule = simulator.vanguard().schedule();
|
||||||
auto& ws = well_state.well(this->index_of_well_);
|
auto& ws = well_state.well(this->index_of_well_);
|
||||||
std::string from;
|
std::string from;
|
||||||
if (this->isInjector()) {
|
if (this->isInjector()) {
|
||||||
@ -300,18 +301,17 @@ namespace Opm
|
|||||||
} else {
|
} else {
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
if (!fixed_control) {
|
if (!fixed_control) {
|
||||||
// We don't allow changing to group controls here since this may lead to inconsistencies
|
// Changing to group controls here may lead to inconsistencies in the group handling which in turn
|
||||||
// in the group handling which in turn may result in excessive back and forth switching.
|
// may result in excessive back and forth switching. However, we currently allow this by default.
|
||||||
// If we are to allow this change, one needs to make sure all necessary information propagates
|
// The switch check_group_constraints_inner_well_iterations_ is a temporary solution.
|
||||||
// properly, but for now, we simply disallow it. The commented code below is kept for future reference
|
|
||||||
|
|
||||||
// const bool hasGroupControl = this->isInjector() ? inj_controls.hasControl(Well::InjectorCMode::GRUP) :
|
const bool hasGroupControl = this->isInjector() ? inj_controls.hasControl(Well::InjectorCMode::GRUP) :
|
||||||
// prod_controls.hasControl(Well::ProducerCMode::GRUP);
|
prod_controls.hasControl(Well::ProducerCMode::GRUP);
|
||||||
|
|
||||||
changed = this->checkIndividualConstraints(ws, summary_state, deferred_logger, inj_controls, prod_controls);
|
changed = this->checkIndividualConstraints(ws, summary_state, deferred_logger, inj_controls, prod_controls);
|
||||||
// if (hasGroupControl) {
|
if (hasGroupControl && param_.check_group_constraints_inner_well_iterations_) {
|
||||||
// changed = changed || this->checkGroupConstraints(well_state, group_state, schedule, summary_state,deferred_logger);
|
changed = changed || this->checkGroupConstraints(well_state, group_state, schedule, summary_state,deferred_logger);
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
const bool thp_controlled = this->isInjector() ? ws.injection_cmode == Well::InjectorCMode::THP :
|
const bool thp_controlled = this->isInjector() ? ws.injection_cmode == Well::InjectorCMode::THP :
|
||||||
|
Loading…
Reference in New Issue
Block a user