Replay pr3 state rollback and test#7198
Open
hnil wants to merge 3 commits into
Open
Conversation
Improve the HardcodedTimeStepControl and add a gated float-precision mode so a simulation can be re-run with a recorded sequence of accepted time steps and reproduce the original results: - HardcodedTimeStepControl: tolerance-based matching of the next substep time, sort the parsed substep times, and ignore empty lines. - AdaptiveTimeStepping: seed the suggested step at the start of a report step from the hardcoded control so the very first substep matches. - SimulatorReport: print INFOSTEP times with full (20-digit) precision. - Add a TruncateTimeStepToFloat parameter (default off) that truncates the time step size to float precision. This is only used by the timestep-replay regression test to make recorded step sizes exactly reproducible; production runs are unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add FlowProblem::updateFailed() and advanceTimeLevel() that forward to the model, and call them from NonlinearSystem::prepareStep() instead of going directly to the model. This lets the problem (and the models it owns, such as the well model) hook into timestep failure recovery and time-level advance. Behaviour is unchanged: the problem methods simply forward to the model. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When a timestep fails, several pieces of dynamic state were not restored to their start-of-step values, so a retried step did not start from the same state. Snapshot this state at the start of a step and restore it on failure: - BlackoilWellModel(Generic): well/group state (active + nupcol WGState), closed-this-step set, WCYCLE open/close times, network state and group state. Guide rates are intentionally not snapshotted (they are not updated during the Newton iterations, so they need no reset). - FlowProblem / FlowProblemBlackoil: ROCKCOMP and saturation/pressure maxima, polymer adsorption, first-step flag and mixing-rate controls. - ISTLSolver::eraseMatrix() now frees the matrix/rhs/solvers, and the blackoil Newton method resets its primary-variable switch bookkeeping per step. - CompWellModel gets no-op updateFailed()/advanceTimeLevel() hooks. Add a deterministic timestep-replay regression test that records the accepted substep times of a run and re-runs with the hardcoded controller replaying them, comparing the two outputs (spe1, spe9, and model2 0_BASE_MODEL2). The baseline and replay both run with --truncate-time-step-to-float so the recorded step sizes are exactly reproducible. The driver also accepts the -u option used by the standard regression-test driver. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
|
Please rebase this PR onto the current master sources to fix the merge conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.