mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use target values as initial conditions for BHP and SURFACE_RATE
BHP and SURFACE_RATE values are updated every step and not only when the well controll has switched.
This commit is contained in:
parent
b3f9997f6a
commit
302bc71d2c
@ -1151,7 +1151,7 @@ namespace detail {
|
|||||||
// The current control in the well state overrides
|
// The current control in the well state overrides
|
||||||
// the current control set in the Wells struct, which
|
// the current control set in the Wells struct, which
|
||||||
// is instead treated as a default.
|
// is instead treated as a default.
|
||||||
const int current = xw.currentControls()[w];
|
int current = xw.currentControls()[w];
|
||||||
// Loop over all controls except the current one, and also
|
// Loop over all controls except the current one, and also
|
||||||
// skip any RESERVOIR_RATE controls, since we cannot
|
// skip any RESERVOIR_RATE controls, since we cannot
|
||||||
// handle those.
|
// handle those.
|
||||||
@ -1178,38 +1178,40 @@ namespace detail {
|
|||||||
<< " to " << modestring[well_controls_iget_type(wc, ctrl_index)] << std::endl;
|
<< " to " << modestring[well_controls_iget_type(wc, ctrl_index)] << std::endl;
|
||||||
}
|
}
|
||||||
xw.currentControls()[w] = ctrl_index;
|
xw.currentControls()[w] = ctrl_index;
|
||||||
// Also updating well state and primary variables.
|
current = xw.currentControls()[w];
|
||||||
// We can only be switching to BHP and SURFACE_RATE
|
|
||||||
// controls since we do not support RESERVOIR_RATE.
|
|
||||||
const double target = well_controls_iget_target(wc, ctrl_index);
|
|
||||||
const double* distr = well_controls_iget_distr(wc, ctrl_index);
|
|
||||||
switch (well_controls_iget_type(wc, ctrl_index)) {
|
|
||||||
case BHP:
|
|
||||||
xw.bhp()[w] = target;
|
|
||||||
bhp_changed = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RESERVOIR_RATE:
|
|
||||||
// No direct change to any observable quantity at
|
|
||||||
// surface condition. In this case, use existing
|
|
||||||
// flow rates as initial conditions as reservoir
|
|
||||||
// rate acts only in aggregate.
|
|
||||||
//
|
|
||||||
// Just record the fact that we need to recompute
|
|
||||||
// the 'well_phase_flow_rate'.
|
|
||||||
rates_changed = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SURFACE_RATE:
|
|
||||||
for (int phase = 0; phase < np; ++phase) {
|
|
||||||
if (distr[phase] > 0.0) {
|
|
||||||
xw.wellRates()[np*w + phase] = target * distr[phase];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rates_changed = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Updating well state and primary variables.
|
||||||
|
// Target values are used as initial conditions for BHP and SURFACE_RATE
|
||||||
|
const double target = well_controls_iget_target(wc, current);
|
||||||
|
const double* distr = well_controls_iget_distr(wc, current);
|
||||||
|
switch (well_controls_iget_type(wc, current)) {
|
||||||
|
case BHP:
|
||||||
|
xw.bhp()[w] = target;
|
||||||
|
bhp_changed = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RESERVOIR_RATE:
|
||||||
|
// No direct change to any observable quantity at
|
||||||
|
// surface condition. In this case, use existing
|
||||||
|
// flow rates as initial conditions as reservoir
|
||||||
|
// rate acts only in aggregate.
|
||||||
|
//
|
||||||
|
// Just record the fact that we need to recompute
|
||||||
|
// the 'well_phase_flow_rate'.
|
||||||
|
rates_changed = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SURFACE_RATE:
|
||||||
|
for (int phase = 0; phase < np; ++phase) {
|
||||||
|
if (distr[phase] > 0.0) {
|
||||||
|
xw.wellRates()[np*w + phase] = target * distr[phase];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rates_changed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update primary variables, if necessary.
|
// Update primary variables, if necessary.
|
||||||
|
Loading…
Reference in New Issue
Block a user