diff --git a/opm/autodiff/BlackoilModelParameters.cpp b/opm/autodiff/BlackoilModelParameters.cpp index 9808556a73..d5b08fe8e0 100644 --- a/opm/autodiff/BlackoilModelParameters.cpp +++ b/opm/autodiff/BlackoilModelParameters.cpp @@ -56,6 +56,7 @@ namespace Opm solve_welleq_initially_ = param.getDefault("solve_welleq_initially",solve_welleq_initially_); update_equations_scaling_ = param.getDefault("update_equations_scaling", update_equations_scaling_); use_update_stabilization_ = param.getDefault("use_update_stabilization", use_update_stabilization_); + use_multisegment_well_ = param.getDefault("use_multisegment_well", use_multisegment_well_); deck_file_name_ = param.template get("deck_filename"); } @@ -79,6 +80,7 @@ namespace Opm solve_welleq_initially_ = true; update_equations_scaling_ = false; use_update_stabilization_ = true; + use_multisegment_well_ = false; } diff --git a/opm/autodiff/BlackoilModelParameters.hpp b/opm/autodiff/BlackoilModelParameters.hpp index cfb36728b4..0e99848160 100644 --- a/opm/autodiff/BlackoilModelParameters.hpp +++ b/opm/autodiff/BlackoilModelParameters.hpp @@ -68,6 +68,13 @@ namespace Opm /// Try to detect oscillation or stagnation. bool use_update_stabilization_; + /// Whehter to use MultisegmentWell to handle multisegment wells + // it is something temporary before the multisegment well model is considered to be + // well developed and tested. + // if it is false, we will handle multisegment wells as standard wells, which will be + // the default behavoir for the moment. Later, we might it to be true by default if necessary + bool use_multisegment_well_; + // The file name of the deck std::string deck_file_name_; diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp index 5ff4853864..21be7aafbb 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp @@ -299,10 +299,12 @@ public: const auto& wells_ecl = eclState().getSchedule().getWells(timer.currentStepNum()); extractLegacyCellPvtRegionIndex_(); // handling MS well related - for (const auto& well : wells_ecl) { - if (well->isMultiSegment(timer.currentStepNum())) { // there is one well is MS well - well_state.initWellStateMSWell(wells, wells_ecl, timer.currentStepNum(), phaseUsage_, prev_well_state); - break; + if (model_param_.use_multisegment_well_) { // if we use MultisegmentWell model + for (const auto& well : wells_ecl) { + if (well->isMultiSegment(timer.currentStepNum()) ) { // there is one well is MS well + well_state.initWellStateMSWell(wells, wells_ecl, timer.currentStepNum(), phaseUsage_, prev_well_state); + break; + } } } WellModel well_model(wells, &(wells_manager.wellCollection()), wells_ecl, model_param_, diff --git a/opm/autodiff/StandardWellsDense.hpp b/opm/autodiff/StandardWellsDense.hpp index 43ece6914b..b509bb3caf 100644 --- a/opm/autodiff/StandardWellsDense.hpp +++ b/opm/autodiff/StandardWellsDense.hpp @@ -175,6 +175,7 @@ namespace Opm { // create the well container static std::vector createWellContainer(const Wells* wells, const std::vector& wells_ecl, + const bool use_multisegment_well, const int time_step); // Well collection is used to enforce the group control diff --git a/opm/autodiff/StandardWellsDense_impl.hpp b/opm/autodiff/StandardWellsDense_impl.hpp index 314c726759..d11400c077 100644 --- a/opm/autodiff/StandardWellsDense_impl.hpp +++ b/opm/autodiff/StandardWellsDense_impl.hpp @@ -18,7 +18,7 @@ namespace Opm { , wells_ecl_(wells_ecl) , number_of_wells_(wells_arg ? (wells_arg->number_of_wells) : 0) , number_of_phases_(wells_arg ? (wells_arg->number_of_phases) : 0) // TODO: not sure if it is proper for this way - , well_container_(createWellContainer(wells_arg, wells_ecl, current_timeIdx) ) + , well_container_(createWellContainer(wells_arg, wells_ecl, param.use_multisegment_well_, current_timeIdx) ) , well_collection_(well_collection) , param_(param) , terminal_output_(terminal_output) @@ -117,6 +117,7 @@ namespace Opm { StandardWellsDense:: createWellContainer(const Wells* wells, const std::vector< const Well* >& wells_ecl, + const bool use_multisegment_well, const int time_step) { std::vector well_container; @@ -147,7 +148,7 @@ namespace Opm { const Well* well_ecl = wells_ecl[index_well]; - if ( !well_ecl->isMultiSegment(time_step) ) { + if ( !well_ecl->isMultiSegment(time_step) || !use_multisegment_well) { well_container.emplace_back(new StandardWell(well_ecl, time_step, wells) ); } else { well_container.emplace_back(new MultisegmentWell(well_ecl, time_step, wells) );