Only compute well potential if needed

A boolen user parameter is added to controll the computation of well
potential.

This is a temporary fix to assure that no extra computation time is used
on well potential calculation if it is not needed. The long term fix
will require a more thorough revising of the well group implementation.
This commit is contained in:
Tor Harald Sandve
2016-04-19 16:03:33 +02:00
parent 84972ac21e
commit e9b097cbf4
4 changed files with 89 additions and 79 deletions

View File

@@ -222,12 +222,13 @@ namespace Opm
// Increment timer, remember well state.
++timer;
prev_well_state = well_state;
// Compute Well potentials (only used to determine default guide rates for group controlled wells)
// TODO: add some logic to avoid unnecessary calulations of well potentials.
asImpl().computeWellPotentials(wells, state, well_state, well_potentials);
// Compute Well potentials if they are needed
// Only used to determine default guide rates for group controlled wells
if ( param_.getDefault("compute_well_potentials", false ) ) {
asImpl().computeWellPotentials(wells, state, well_state, well_potentials);
}
}
// Write final simulation state.
output_writer_.writeTimeStep( timer, state, prev_well_state );