Issues with Self gravity

For a fixed grid run we need phi before and after every advance. So for 4 time steps, we would need to solve for phi 5 times. With no additional elliptic solves we can then use phi before and after to achieve second order time accuracy.

For an AMR patch we need to take 2 time steps so we need 3 solutions for phi. We could use the prolongated parents version of phi, or the previous overlapping grids latest version of phi. In principal they should agree at the coarse boundaries, since the previous grids solution to phi was subject to the same boundary conditions (due to phidot at coarse boundaries exactly agreeing with parent grids). Furthermore the previous grids solution to phi should be more accurate since it accounts for the distribution of gas on the current level. Otherwise level n would end up using values for phigas that were successively prolongated from level 0. So it is important to use the overlapped version of phigas and not the prolongated.

However, phidot should not be copied from old grids since that phidot is from a previous time step. This can cause problems if phidot changes quickly. There will also be a mismatch between the prolongated and overlapped phidot which can cause differences between adjacent cells leading to strong gradients. So it is important to use the prolongated value of phidot and not the overlapped. Additionally since phidot is recalculated before successive prolongations, the same issue with repeated prolongation does not occur.

This is implemented in the code by setting

ProlongateFields = (/…,iPhiGas,iPhiDot,…/)

and by setting EGCopyFields = (/iPhiGas/)

And then following a poisson update ghosting iPhiDot.

To make it 2nd order we need to ghost iPhiGas as well after the poisson update, however this means that we don't need to copy iPhiGas before the 2nd step.

Comments

No comments.