Adding a new refinement criterion (19) to refine on metal mass instead of some minimum metallicity. This strategy favors dense metal-enriched gas and will not aggressively refine underdense enriched regions.
Refinement criteria is similar to baryon mass refinement, but with the minimum mass multiplied by MetallicityForRefinement * Zsolar, where Zsolar = 0.0204. Default = 1.
Also, fixed a bug in the hydro_rk MHD color species, where density was renormalized twice.
As far as I can tell, this is good to go. Great job, @jwise77 !
Thanks for testing this on your sim! Everything looks like it's working as expected from these projections.
For this comment: "...but with the minimum mass multiplied by MetallicityForRefinement * Zsolar, where Zsolar = 0.0204." Shouldn't this be updated to be more consistent/accurate -- following the discussion that was had by @brittonsmith as part of updates to Grackle?
Yes. There it was updated to 0.0122
Did we find a global space there where that was put so we can reuse that variable?
Ah yes. It is in
CoolData.SolarMetalFractionByMass = 0.01295; // Cloudy v13 abundances
One further thing to consider here would be to also reuse the
parameter and use it if it is greater 0.
Not necessary to accept the pull request however.
I think that's a good idea, and I made the change in the code and docs.