pmgbergen / porepy

Python Simulation Tool for Fractured and Deformable Porous Media

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Full integration of `TimeManager` into models

jhabriel opened this issue · comments

The next step for integrating the time-stepping control routine into the models requires the adaptation of the time step based on: (a) the number of iterations needed to reach convergence after the Newton loop, or (b) failed-to-converge criteria after the Newton loop diverged.

We have made some design choices (DC) about the integration:

DC1. The computation of the time steps will be incorporated in the after_newton_convergence() and after_netwon_failure() methods.
DC2. Due to the ongoing changes in the basic model structures, the integration will take place in each model rather than globally. This naturally increases the amount of duplicated code, but it is something we to deal for now.
DC3. The time step will only be adapted for time-dependent non-linear models. This holds both for iteration-based adaptation and fail-to-converge adaptation.

Integration milestones:

  • Purge computation of next time step from run_models.py.
  • Incorporate computation of next time step into after_newton_convergence() and after_newton_failure() based on DC3. Methods such as model._is_nonlinear() might be useful here.
  • If ad is used, time step has to be adapted by default.

Testing milestones:

  • Time-independent models (e.g., incompressible flow and pure elasticity) should not be affected by the integration. This is easy to test, e.g., we just need to check whether the TimeManager exists as an attribute of the model.
  • Linear time-dependent models can only be used with constant time step.
  • Nonlinear time-dependent models should benefit from the full integration. Here, we have to check that the solution is adapted based on iteration and non-convergence/divergence criteria. To this aim, create a modified version of the slightly compressible flow model with non-linear porosity.