At the moment euler.F applies a hard-coded minimum density threshold of 1.0E-3 (in code units) when DualEnergyFormalism == 1 and GravityOn == 1. In addition to a hard coded density floor being scary and not obvious to the user, it applies the floor incorrectly, updating only the cell density value and ignoring the inverse density value that is used further down in the routine. (relevant piece of code here:
http://pastebin.com/aArUXuML )
My proposed changes are the following:
1) Add in user supplied parameters to turn on / off the density floor and a parameter to supply the density floor (in code units). (UseDensityFloor and DensityFloor respectively)
2) Correctly apply the density floor, updating both the density and inverse density values
Although this change will correct the code, it will have a consequence: previous versions of the code will not necessarily behave the same way, and it may be hard to actually determine which (if any) simulations this will have an effect on.
And before I do this, I wanted to see what people thought the best "default" behavior would be. A few options / questions:
1) UseDensityFloor = 0 and DensityFloor = 1.0E-3 , only turning it on if user requests
2) UseDensityFloor = 0 and DensityFloor = 1.0E-3, turning on if requested OR turning on if user doesn't specify and DualEnergyFormalism == 1 and GravityOn == 1 (similar to current situation)
3) Same as above, but turn it on it if HydroSolver is set to PPM rather than the DualEnergyFormalism check (since I believe that is the actual intended behavior anyway).
4) Is 1.0E-3 a reasonable default value for the density floor? If its a silly number, my vote is to make it something sensible rather than leaving it as 1.0E-3 for historical reasons.
Thoughts?
Andrew
---
NSF Graduate Research Fellow
Columbia University
Department of Astronomy