This makes the PPM MinimumPressureSupport implementation match what is done for Zeus.
Currently, Enzo does MinimumPressureSupport for PPM by directly altering the gas energy field. In other words, wherever the Jeans length is insufficiently resolved, Enzo increases the gas temperature such that the Jeans length is resolved during the hydro calculation.
The trouble with this approach is that simulations that include cooling will enter into an oscillation in the temperature field. Before the hydro solver is called, grid::SetMinimumSupport bumps up the temperature to ensure the Jeans length is resolved. After the hydro solver runs, the cooling routines are called, and most of the energy added in SetMinimumSupport is radiated away.
Rather than touching the GasEnergy field and introducing unphysical temperature fluctuations, this patch implements MinimumPressureSupport as a pressure floor. An intermediate pressure value is calculated from the temperature in grid::ComputePressure and if we find that the pressure in the cell is below the minimum pressure required to keep the Jeans Length resolved, we set the pressure to the minimum pressure, ignoring the pressure implied by the gas energy.
This is exactly what happens already for Zeus. There's even a comment in the code right now indicating that the current PPM algorithm is not so great.
The pressure floor is only used inside the hydro solver and currently is not written to disk if a user asks for a pressure field in their outputs files.
I would love to hear about alternate implementation ideas or if there are possible numerical issues with this approach. For what it's worth I've been using this implementation successfully for my isolated galaxy simulations for several weeks now.
Note that this is identical to the declined PR 210 which was closed due to the presence of stripped changes in the PR.
I think this is a good change -- it is the right thing to do (changing the energy was just easier to implement).
Looks good to me. Is there a test problem that tests the minimum pressure support in either zeus or PPM? That's not a deal-breaker, and I don't think you necessarily have to add it, but I am just curious. I don't see it anywhere.