enzo-project / enzo-e

A version of Enzo designed for exascale and built on charm++.
Other
29 stars 35 forks source link

Inconsistent Gravitiational Constants #189

Closed mabruzzo closed 9 months ago

mabruzzo commented 2 years ago

While implementing PR #186, I became aware of a potential issue.

At this time the following files in the Enzo layer make use of cello::grav_constant:

I don't understand the context of this choice in any of these files, but I this is the wrong thing to do if you're interested in using the Gravitational constant value used by the simulation. The simulation instead uses the value specified by Method:gravity:grav_const.

EDIT: I had a followup conversation with @jobordner about this topic and he confirmed that this could be an issue and that some refactoring is probably needed here. If you want to use this feature in the immediate short-term, there are some workarounds for this.

stefanarridge commented 2 years ago

Just thought I should copy what I wrote on Slack here for posterity, and since this is related to #188:

For cosmological simulations, units are defined such that 4*pi*G*rho_bar has the value 1.0, where rho_bar is the mean physical matter density of the universe, which has the effect of simplifying Poisson's equation. In fact, the value the user sets for G has no effect on gravity. This also means that the value of G changes with redshift. It is for this reason that Methods which require the value of G (such as EnzoMethodStarMaker ) need to use cello::grav_const.