set ws.thp = thp_limit for wells under THP control

This commit is contained in:
Tor Harald Sandve
2022-09-14 11:16:13 +02:00
parent 47329b30b9
commit 756c9bad21
2 changed files with 8 additions and 0 deletions

View File

@@ -572,6 +572,12 @@ updateThp(WellState& well_state,
ws.thp = 0;
return;
}
bool thp_controled = baseif_.isInjector() ? ws.injection_cmode == Well::InjectorCMode::THP:
ws.production_cmode == Well::ProducerCMode::THP;
if (thp_controled) {
return;
}
// the well is under other control types, we calculate the thp based on bhp and rates
std::vector<double> rates(3, 0.0);

View File

@@ -813,6 +813,7 @@ namespace Opm
auto rates = ws.surface_rates;
double bhp = this->calculateBhpFromThp(well_state, rates, well, summaryState, this->getRefDensity(), deferred_logger);
ws.bhp = bhp;
ws.thp = this->getTHPConstraint(summaryState);
// if the total rates are negative or zero
// we try to provide a better intial well rate
@@ -1037,6 +1038,7 @@ namespace Opm
this->adaptRatesForVFP(rates);
double bhp = this->calculateBhpFromThp(well_state, rates, well, summaryState, this->getRefDensity(), deferred_logger);
ws.bhp = bhp;
ws.thp = this->getTHPConstraint(summaryState);
// if the total rates are negative or zero
// we try to provide a better intial well rate