cholla-hydro / cholla

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

Update Cell Averaging #357

Closed evaneschneider closed 6 months ago

evaneschneider commented 6 months ago

This PR changes the way that cell averaging is done in the Average_Cell_All_Fields function. The previous version averaged each conserved variable independently, which could lead to inconsistent values for the various fields. This version calculates the average of the primitive variables from the surrounding cells, and uses those to update the averaged values of the conserved variables. It replaces the previous version of the call in the Average_Slow_Cells_3D function, and is added to the thread crash for the 3D cell update.