Add trivial class SingleWellState with bhp and thp

This commit is contained in:
Joakim Hove
2021-08-03 20:05:14 +02:00
parent 3d3e9cca1b
commit a54daf75e8
15 changed files with 194 additions and 67 deletions

View File

@@ -599,6 +599,7 @@ namespace Opm
// only bhp and wellRates are used to initilize the primaryvariables for standard wells
const auto& well = this->well_ecl_;
const int well_index = this->index_of_well_;
auto& ws = well_state.well(well_index);
const auto& pu = this->phaseUsage();
const int np = well_state.numPhases();
const auto& summaryState = ebos_simulator.vanguard().summaryState();
@@ -608,7 +609,7 @@ namespace Opm
for (int p = 0; p<np; ++p) {
well_state.wellRates(well_index)[p] = 0.0;
}
well_state.update_thp(well_index, 0.0);
ws.thp = 0;
return;
}
@@ -663,7 +664,7 @@ namespace Opm
rates[p] = well_state.wellRates(well_index)[p];
}
double bhp = this->calculateBhpFromThp(well_state, rates, well, summaryState, this->getRefDensity(), deferred_logger);
well_state.update_bhp(well_index, bhp);
ws.bhp = bhp;
// if the total rates are negative or zero
// we try to provide a better intial well rate
@@ -678,7 +679,7 @@ namespace Opm
}
case Well::InjectorCMode::BHP:
{
well_state.update_bhp(well_index, controls.bhp_limit);
ws.bhp = controls.bhp_limit;
double total_rate = 0.0;
for (int p = 0; p<np; ++p) {
total_rate += well_state.wellRates(well_index)[p];
@@ -864,7 +865,7 @@ namespace Opm
}
case Well::ProducerCMode::BHP:
{
well_state.update_bhp(well_index, controls.bhp_limit);
ws.bhp = controls.bhp_limit;
double total_rate = 0.0;
for (int p = 0; p<np; ++p) {
total_rate -= well_state.wellRates(well_index)[p];
@@ -886,7 +887,7 @@ namespace Opm
rates[p] = well_state.wellRates(well_index)[p];
}
double bhp = this->calculateBhpFromThp(well_state, rates, well, summaryState, this->getRefDensity(), deferred_logger);
well_state.update_bhp(well_index, bhp);
ws.bhp = bhp;
// if the total rates are negative or zero
// we try to provide a better intial well rate