|
opm-simulators
|
Adaptive time-stepping coordinator for the black-oil simulator. More...
#include <AdaptiveTimeStepping.hpp>
Public Types | |
| using | TuningUpdateCallback |
| Callback invoked at the start of each substep to apply TUNING, NEXTSTEP (via ACTIONX), and WCYCLE updates. | |
Public Member Functions | |
| AdaptiveTimeStepping (const UnitSystem &unitSystem, const SimulatorReport &full_report, const double max_next_tstep=-1.0, const bool terminalOutput=true) | |
| contructor taking parameter object | |
| AdaptiveTimeStepping (double max_next_tstep, const Tuning &tuning, const UnitSystem &unitSystem, const SimulatorReport &full_report, const bool terminalOutput=true) | |
| contructor | |
| bool | operator== (const AdaptiveTimeStepping< TypeTag > &rhs) const |
| void | setSuggestedNextStep (const double x) |
| Set the suggested length for the next substep [s]. | |
| double | suggestedNextStep () const |
| Current suggested length for the next substep [s]. | |
| const TimeStepControlInterface & | timeStepControl () const |
| template<class Solver> | |
| SimulatorReport | step (const SimulatorTimer &simulator_timer, Solver &solver, const bool is_event, const TuningUpdateCallback &tuning_updater) |
| Run one report step by orchestrating adaptive substepping. | |
| void | updateTUNING (double max_next_tstep, const Tuning &tuning) |
| Apply TUNING keyword parameters. | |
| void | updateNEXTSTEP (double max_next_tstep) |
| Set suggested_next_timestep_ to max_next_tstep iff max_next_tstep > 0. | |
| template<class Serializer> | |
| void | serializeOp (Serializer &serializer) |
| SimulatorReport & | report () |
Protected Types | |
| using | TimeStepController = std::unique_ptr<TimeStepControlInterface> |
Protected Member Functions | |
| void | init_ (const UnitSystem &unitSystem) |
Protected Attributes | |
| TimeStepControlType | time_step_control_type_ {TimeStepControlType::PIDAndIterationCount} |
| type of time step control object | |
| TimeStepController | time_step_control_ {} |
| time step control object | |
| double | restart_factor_ {} |
| factor to multiply time step with when solver fails to converge | |
| double | growth_factor_ {} |
| factor to multiply time step when solver recovered from failed convergence | |
| double | max_growth_ {} |
| factor that limits the maximum growth of a time step | |
| double | max_time_step_ {} |
| maximal allowed time step size in days | |
| double | min_time_step_ {} |
| minimal allowed time step size before throwing | |
| bool | ignore_convergence_failure_ {false} |
| continue instead of stop when minimum time step is reached | |
| int | solver_restart_max_ {} |
| how many restart of solver are allowed | |
| bool | solver_verbose_ {false} |
| solver verbosity | |
| bool | timestep_verbose_ {false} |
| timestep verbosity | |
| double | suggested_next_timestep_ {} |
| suggested size of next timestep | |
| bool | full_timestep_initially_ {false} |
| beginning with the size of the time step from data file | |
| double | timestep_after_event_ {} |
| suggested size of timestep after an event | |
| bool | use_newton_iteration_ {false} |
| use newton iteration count for adaptive time step control | |
| double | min_time_step_before_shutting_problematic_wells_ {} |
| < shut problematic wells when time step size in days are less than this | |
| SimulatorReport | report_ {} |
Adaptive time-stepping coordinator for the black-oil simulator.
Drives the substep loop inside each report step. A report step is the time interval between dates defined in the deck SCHEDULE. Within a report step, this class chooses a sequence of smaller substeps whose lengths are adjusted to honour:
The user-facing entry point is step(). The substep loop itself is split across the nested helpers SubStepper (which selects between the original loop and the two reservoir-coupling variants) and SubStepIteration (which runs the inner per-substep logic).
| using Opm::AdaptiveTimeStepping< TypeTag >::TuningUpdateCallback |
Callback invoked at the start of each substep to apply TUNING, NEXTSTEP (via ACTIONX), and WCYCLE updates.
Called once by SimulatorFullyImplicitBlackoil::runStep at the start of a report step, and once per substep inside SubStepIteration::maybeUpdateTuningAndTimeStep_ (plus equivalent sites in the reservoir-coupling loops). The callback may adjust the simulator's suggested next substep via updateNEXTSTEP() or updateTUNING().
| elapsed | Simulation time elapsed at the call point [s]. |
| substep_length | Candidate length of the substep about to run [s]. This is the look-ahead horizon the callback uses internally, e.g. WCYCLE chops the substep if a well switching event falls inside [elapsed, elapsed + substep_length]. |
| sub_step_number | Index of the substep within its report step; 0 means "first substep". WCYCLE's REQUEST_OPEN_WELL handling is only consulted when this is 0. |
| Opm::AdaptiveTimeStepping< TypeTag >::AdaptiveTimeStepping | ( | double | max_next_tstep, |
| const Tuning & | tuning, | ||
| const UnitSystem & | unit_system, | ||
| const SimulatorReport & | report, | ||
| const bool | terminal_output = true ) |
contructor
| max_next_tstep | Maximum next time step allowed |
| tuning | Pointer to ecl TUNING keyword |
| unit_system | Unit system to use |
| report | Simulator report to use |
| terminal_output | True to print to terminal |
| SimulatorReport Opm::AdaptiveTimeStepping< TypeTag >::step | ( | const SimulatorTimer & | simulator_timer, |
| Solver & | solver, | ||
| const bool | is_event, | ||
| const TuningUpdateCallback & | tuning_updater ) |
Run one report step by orchestrating adaptive substepping.
Splits the report step into a sequence of smaller substeps whose lengths are chosen adaptively, invoking solver once per substep. Called from SimulatorFullyImplicitBlackoil::runStep in place of a direct Solver::step() call on the non-adaptive path. The actual substep loop lives one layer down in SubStepper::run(); this method just constructs a SubStepper and delegates.
| simulator_timer | Outer report-step timer. |
| solver | Newton solver invoked once per substep. |
| is_event | True if this report step carries an event (NEW_WELL, INJECTION_UPDATE, etc.); affects SubStepper::maybeModifySuggestedTimeStepAtBeginningOfReportStep_. |
| tuning_updater | Callback invoked to apply TUNING / NEXTSTEP / WCYCLE updates; see TuningUpdateCallback. |
| double Opm::AdaptiveTimeStepping< TypeTag >::suggestedNextStep | ( | ) | const |
Current suggested length for the next substep [s].
Updated by the time-step controller, by TUNING/NEXTSTEP application, and by WCYCLE chopping.
| void Opm::AdaptiveTimeStepping< TypeTag >::updateNEXTSTEP | ( | double | max_next_tstep | ) |
Set suggested_next_timestep_ to max_next_tstep iff max_next_tstep > 0.
Used by both the TUNING path and the WCYCLE path in the tuning-update callback. A non-positive value is interpreted as "no suggestion" and is silently ignored.
| void Opm::AdaptiveTimeStepping< TypeTag >::updateTUNING | ( | double | max_next_tstep, |
| const Tuning & | tuning ) |
Apply TUNING keyword parameters.
Overwrites restart_factor_, growth_factor_, max_growth_, max_time_step_, and timestep_after_event_ from tuning, then forwards max_next_tstep to updateNEXTSTEP().
| max_next_tstep | Next-step suggestion [s]; ignored if <= 0. |
| tuning | Source of the new TUNING parameters. |