mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move updateWellStateWithTHPTargetProd to WellInterface
to share implementation between STW and MSW
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user