python-hydro / pyro2

A framework for hydrodynamics explorations and prototyping
https://python-hydro.github.io/pyro2
BSD 3-Clause "New" or "Revised" License
303 stars 123 forks source link

Couple pyro and pySDC #200

Open brownbaerchen opened 3 months ago

brownbaerchen commented 3 months ago

Hello! I am working on a prototyping framework on spectral deferred corrections called pySDC. Our main focus is parallel-in-time methods such as diagonal SDC or PFASST. I think it would be nice to get some hydrodynamics test problems in there and @guadabsb15 recommended pyro for this! I see there is some SDC already in pyro.

To implement a problem in pySDC, we basically need two things: A function that returns the right hand side evaluation given the current solution and time and a function that does implicit solves or semi implicit solves given the current solution and time, some right hand side and a step size.

I haven't really looked into the code, but I want to ask if there is a possibility to get such an interface working without too much effort. I am not an expert on CDF, nor do I have too much time for this right now. But if you are interested in parallel-in-time methods, maybe we can collaborate on this at some point. Once this is in pySDC, it is very easy to measure speedup both in terms of right hand side evaluations as well as wall time using mpi4py. We also run pySDC on GPUs very successfully using cupy as a replacement for numpy. Maybe this could be integrated in pyro with reasonable effort as well. Note that the method introduced in the diagonal SDC paper mentioned above can be quite effective for hyperbolic problems. pySDC also allows to do more elaborate things in the time stepping. And @lisawim is currently working on SDC for DAEs, which would be useful for some problems.

I am looking forward to hearing from you! Best, Thomas

zingale commented 3 months ago

Hi Thomas, the SDC solver in pyro implements the pure-hydro solver from this paper: https://iopscience.iop.org/article/10.3847/1538-4357/ab4e1d

it does 2nd or 4th-order finite-volume reconstruction.

pyro does not include any reactive sources, so the update is purely explicit. There is a function that will return the update needed for the explicit update.