cholla-hydro / cholla

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

PPMC Refactor, New PPMC for Van Leer Integrator, and MHD Support in the New PPMC Kernel #300

Closed bcaddy closed 1 year ago

bcaddy commented 1 year ago

PPMC Refactor

Building on the work in PR #288, PPMC has been refactored to use functions

New PPMC Method

When extended to MHD the old PPMC method was unstable on some problems, especially the Brio & Wu shock tube. The new method is stable and based off of the method currently used in Athena++; it's also faster and should be more stable and accurate for hydro. The old PPMC is still available as the PPMC_CTU kernel and is used in the CTU and SIMPLE integrators as the new PPMC method does not support time evolution of the variables. The new PPMC is available as the PPMC_VL kernel and is used in the Van Leer integrator.

All tests have been updated for PPMC, new tests have been written for the new functions, etc.

Other

DRAFT REASON

This is currently a draft until the PLMC PR is merged in. Because it's based on the same branch as the PLMC PR it looks like it has all the changes of both branches. Once the PLMC PR is merged the diff for this PR should only include the PPMC stuff.

bcaddy commented 1 year ago

@evaneschneider, FYI, this PR now contains the fixes to the linear wave initial conditions that fix the unexpectedly poor scaling of the fast wave

bcaddy commented 1 year ago

FYI, this also fixes a memory leak in Grid3D::Write_Projection_HDF5 where the memory that dataset_buffer_dust_xy and dataset_buffer_dust_xz pointer wasn't freed. Given that that function might be called many times I suggest replacing the various buffers with static STL vectors.