Fix SimulatorTimer-related bug in EclipseWriter.
Since writeTimeStep() now gets called also before the first timestep is done, the EclipseWellTotal::update() method was in error, always calling SimulatorTimer::stepLengthTaken(). That method cannot be called if the timer's currentStepNum() is 0, so that is checked for and intercepted. The total rate in that case is of course zero.
This commit is contained in:
@@ -790,6 +790,11 @@ struct EclipseWellTotal : public EclipseWellReport {
|
||||
|
||||
virtual double update (const SimulatorTimer& timer,
|
||||
const WellState& wellState) {
|
||||
if (timer.currentStepNum() == 0) {
|
||||
// We are at the initial state.
|
||||
// No step has been taken yet.
|
||||
return 0.0;
|
||||
}
|
||||
// TODO: Is the rate average for the timestep, or is in
|
||||
// instantaneous (in which case trapezoidal or Simpson integration
|
||||
// would probably be better)
|
||||
|
||||
Reference in New Issue
Block a user