Closed mabruzzo closed 9 months 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.
While implementing PR #186, I became aware of a potential issue.
At this time the following files in the
Enzo
layer make use ofcello::grav_constant
:enzo_EnzoInitialIsolatedGalaxy.cpp
enzo_EnzoMethodStarMaker.cpp
enzo_EnzoMethodStarMakerStochasticSF.cpp
enzo_EnzoMethodBackgroundAcceleration.cpp
enzo_EnzoMethodStarMakerFIRE2.cpp
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.