move updateWellStateWithTHPTargetProd to WellInterface

to share implementation between STW and MSW
This commit is contained in:
Arne Morten Kvarving
2023-05-12 11:57:48 +02:00
parent 06e9247887
commit 01c4aa1927
6 changed files with 45 additions and 69 deletions

View File

@@ -92,6 +92,7 @@ namespace Opm
OPM_THROW(std::runtime_error, "water + gas case not supported by multisegment well yet");
}
this->thp_update_iterations = true;
}
@@ -1946,34 +1947,6 @@ namespace Opm
template<typename TypeTag>
bool
MultisegmentWell<TypeTag>::
updateWellStateWithTHPTargetProd(const Simulator& ebos_simulator,
WellState& well_state,
DeferredLogger& deferred_logger) const
{
const auto& summary_state = ebos_simulator.vanguard().summaryState();
auto bhp_at_thp_limit = computeBhpAtThpLimitProdWithAlq(
ebos_simulator, summary_state, this->getALQ(well_state), deferred_logger);
if (bhp_at_thp_limit) {
std::vector<double> rates(this->number_of_phases_, 0.0);
computeWellRatesWithBhpIterations(ebos_simulator, *bhp_at_thp_limit, rates, deferred_logger);
auto& ws = well_state.well(this->name());
ws.surface_rates = rates;
ws.bhp = *bhp_at_thp_limit;
ws.thp = this->getTHPConstraint(summary_state);
return true;
} else {
return false;
}
}
template <typename TypeTag>
std::vector<double>
MultisegmentWell<TypeTag>::
@@ -2008,5 +1981,4 @@ namespace Opm
return num_seg * num_eq;
}
} // namespace Opm