adding applyVREPGroupControl() to StandardWellsDense.

This commit is contained in:
Kai Bao 2017-01-17 15:15:23 +01:00
parent 849dae8ec5
commit 19eb0d96c8
2 changed files with 29 additions and 1 deletions

View File

@ -375,6 +375,11 @@ namespace Opm {
SimulatorReport report;
// when having VREP group control, update the rate converter based on reservoir state
if ( wellModel().wellCollection()->havingVREPGroups() ) {
updateRateConverter(reservoir_state);
}
// -------- Mass balance equations --------
assembleMassBalanceEq(timer, iterationIdx, reservoir_state);

View File

@ -1378,6 +1378,7 @@ enum WellVariablePositions {
// upate the well targets following the group control
if (wellCollection()->groupControlActive()) {
applyVREPGroupControl(xw);
wellCollection()->updateWellTargets(xw.wellRates());
}
}
@ -1689,7 +1690,7 @@ enum WellVariablePositions {
std::vector<double> convert_coeff(np, 1.0);
for (int w = 0; w < nw; ++w) {
const bool is_producer = wells->type[w] == PRODUCER;
const bool is_producer = wells().type[w] == PRODUCER;
// not sure necessary to change all the value to be positive
if (is_producer) {
@ -1720,6 +1721,28 @@ enum WellVariablePositions {
void applyVREPGroupControl(WellState& well_state) const
{
if ( wellCollection()->havingVREPGroups() ) {
std::vector<double> well_voidage_rates;
std::vector<double> voidage_conversion_coeffs;
computeWellVoidageRates(well_state, well_voidage_rates, voidage_conversion_coeffs);
wellCollection()->applyVREPGroupControls(well_voidage_rates, voidage_conversion_coeffs);
// for the wells under group control, update the currentControls for the well_state
for (const WellNode* well_node : wellCollection()->getLeafNodes()) {
if (well_node->isInjector() && !well_node->individualControl()) {
const int well_index = well_node->selfIndex();
well_state.currentControls()[well_index] = well_node->groupControlIndex();
}
}
}
}
protected:
bool wells_active_;
const Wells* wells_;