add useInnerIteration method and move assembleWellEq to the well interface to avoid code duplication

This commit is contained in:
Tor Harald Sandve
2021-05-10 09:41:18 +02:00
parent 045abb3f80
commit 80413e0794
6 changed files with 41 additions and 74 deletions

View File

@@ -537,33 +537,6 @@ namespace Opm
template<typename TypeTag>
void
StandardWell<TypeTag>::
assembleWellEq(const Simulator& ebosSimulator,
const double dt,
WellState& well_state,
const GroupState& group_state,
Opm::DeferredLogger& deferred_logger)
{
checkWellOperability(ebosSimulator, well_state, deferred_logger);
const bool use_inner_iterations = param_.use_inner_iterations_wells_;
if (use_inner_iterations) {
this->iterateWellEquations(ebosSimulator, dt, well_state, group_state, deferred_logger);
}
// TODO: inj_controls and prod_controls are not used in the following function for now
const auto& summary_state = ebosSimulator.vanguard().summaryState();
const auto inj_controls = well_ecl_.isInjector() ? well_ecl_.injectionControls(summary_state) : Well::InjectionControls(0);
const auto prod_controls = well_ecl_.isProducer() ? well_ecl_.productionControls(summary_state) : Well::ProductionControls(0);
assembleWellEqWithoutIteration(ebosSimulator, dt, inj_controls, prod_controls, well_state, group_state, deferred_logger);
}
template<typename TypeTag>
void
StandardWell<TypeTag>::