Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow separate time-stepping or "subcycling" into automated mesh refinement updates #878

Open
00krishna opened this issue Sep 22, 2021 · 4 comments
Labels
enhancement New feature or request upstream

Comments

@00krishna
Copy link

As we all know, automated mesh refinement(AMR) allows a pde solver to incorporate information from finer scale processes into the computation of more coarse scale processes. This has the benefit of improving model accuracy and stability in some cases, as well as accelerating compute time in other cases.

Once key issue that accompanies AMR is "subcycling" or local time-stepping, where the solver allows for independent time-stepping of the finer scale process before incorporating those results or fluxes into the coarser scale model. Subcycling can also allow for faster solving of some multi-scale problems, as well as improved accuracy.

After talking to @jlchan , he indicated that Trixi does not currently support subcycling. However, he suggested that I open an issue so that perhaps the group can discuss incorporating this functionality.

@jlchan
Copy link
Contributor

jlchan commented Sep 22, 2021

A related discussion on "paired" RK methods #21 and associated implementation issues. These are somewhat simpler than multi-rate schemes but aim towards a similar goal.

@ranocha ranocha added enhancement New feature or request upstream labels Sep 23, 2021
@ranocha
Copy link
Member

ranocha commented Sep 23, 2021

As @jlchan said on our community Slack, we don't have such a feature right now. We're using OrdinaryDIffEq.jl for most of our setups and I don't know about such methods implemented there, but it might be good to check with some core devs there - you could ask on the Julia Slack (#diffeq-bridged) and report here.
Alternatively, we have also some examples of very simple self-written ODE solvers in Trixi.jl (see https://github.com/trixi-framework/Trixi.jl/tree/main/src/time_integration). If someone wants to invest some work and wants to prototype such methods while working more closely with the internals of Trixi.jl, this might be a good start (since it doesn't need to be abstracted away to be useful for other setups as would be the case for OrdinaryDiffEq.jl). If anybody wants to help out, we will be happy to answer questions (here or on Slack).

@00krishna
Copy link
Author

00krishna commented Sep 23, 2021

@ranocha Yeah, I can check on Diffeq, no problem. I was looking at a really excellent video on this topic of AMR, here is the link below.

https://www.youtube.com/watch?v=wE3tdL_p6Ms

The idea has multiple parts. First, for many problems there are multiple time-scales in the physics. So allowing independent time-stepping at the the finer mesh and then averaging those fluxes to the corresponding timestep and spatial cell on the coarser mesh would allow a user to solve such problems.

The other thing mentioned in the video--which I am not completely clear on--is that this subcycling of the time scale can apparently allow the model to use different values for the CFL condition. So that can increase stability and reduce the number of timesteps or compute--hence accelerating the computation.

The idea is not too difficult to explain. So you would use something like OrdinaryDiffEq.jl to handle time-stepping at the finer level of the mesh, just like you do for the coarse mesh. However, there is probably a different CFL number on the finer mesh, so the corresponding time-stepping needs to be adjusted. But then the fluxes that are computed on the finer mesh have to be averaged or summed and mapped to the corresponding coarser mesh. So a lot of the pieces are probably implemented, but just need to use multiple dispatch to add a new function signature with the additional time-stepping settings in the solver, etc., etc.

I am trying to just start looking at the paper in this area. I am still pretty new to numerical pde solving. I am happy to try and work on it, but it would help if I had some support from someone a bit more experienced in numerical pde solving. There are some existing codes for this type of work, so I am just trying to go through them and the corresponding papers to understand some of the implementation details.

Why don't I see if I can figure out the AMR + timestepping algorithm from some of the paper and at least report back with the algorithm. You guys are using the P4est octree and quadtree methods for AMR right. I can look up how that algorithm is implemented and then see how to incorporate the timestepping there.

@ranocha
Copy link
Member

ranocha commented Sep 24, 2021

Why don't I see if I can figure out the AMR + timestepping algorithm from some of the paper and at least report back with the algorithm.

Sounds good.

You guys are using the P4est octree and quadtree methods for AMR right. I can look up how that algorithm is implemented and then see how to incorporate the timestepping there.

We have different mesh types allowing different element sizes, see the table at https://trixi-framework.github.io/Trixi.jl/dev/overview/#Semidiscretizations. For example,

  • The TreeMesh uses a single quadtree/octree.
  • The UnstructuredMesh2D uses a general unstructured quad mesh (which can have vastly different element sizes).
  • The P4estMesh uses the C library p4est under the hood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request upstream
Projects
None yet
Development

No branches or pull requests

3 participants