cholla-hydro / cholla

A GPU-based hydro code
https://github.com/cholla-hydro/cholla/wiki
MIT License
60 stars 32 forks source link

Merge PLMC and PLMP Into One & Add MHD Support to PLMP #391

Closed bcaddy closed 5 days ago

bcaddy commented 2 months ago

Summary

This merges the PLMC and PLMP kernels into one single kernel. It also borrows quite a bit of the refactor from PR #382, for improved modularity, function naming, etc, just without fusing PLM into the Riemann solvers.

PLMC/PPMP Merge

Performance

Timing

PLMP is 6.7% faster than PLMC in hydro but only 4.7% faster when MHD is turned on. run_timing.log

Accuracy & Stability

In hydro PLMP and PLMC are virtually identical. A suite of test plots comparing current PLMP, previous PLMP, and PLMC with both integrators can be found here, it also includes the MHD PLMC vs PLMP test plots.

In MHD, PLMP is more oscillatory near shocks and gives a slightly different profile for the internal energy in the Einfeldt Strong Rarefaction. However, in more complex tests, like the blast wave, the PLMP and PLMC reconstructors perform nearly identically.

Here's the script I used to run all the tests and make the plots. Note that it makes some assumptions about the paths to the Cholla and analysis-scripts repos. run-plot-tests.sh.txt. I was on commit 05545d4 of the analysis-scripts repo.

Other

Dependencies

Depends on PRs #371, #375, and #377. Until those are merged this will look like it has a lot more changes than it does. A version without all those extra changes can be found here.

bcaddy commented 2 weeks ago

I believe I've addressed everything, please let me know if I haven't.