Open mabruzzo opened 5 months ago
After reading this over again more carefully, I agree that all items 1-4 should be invariant and consequently, LU, DU, and TU should behave just as you describe. I'm also willing to take it as a given that a_units
should never change. I noticed a couple typos that I only mention since this issue may be very useful to refer back to in the future:
I think, despite my previous comments about other comoving unit systems in use in various simulation codes, there are probably very few implementations of grackle that are actually using comoving units in their grackle calls. All the ones I've seen are converting everything to proper first.
Good catch. I fixed those typos. I might try to modify some the documentation to include this point.
I think, despite my previous comments about other comoving unit systems in use in various simulation codes, there are probably very few implementations of grackle that are actually using comoving units in their grackle calls. All the ones I've seen are converting everything to proper first.
To add to that, I recently learned that Cholla is definitely converting to proper units for the Grackle Calls.
Overview
Recent discussions have made it clear that we (the core grackle developers) are not exactly sure whether grackle is compatible with any comoving unit system other than Enzo's comoving unit system.
code_units
struct (essentially, an Enzo-like comoving unit system is explicitly required). I would really like to refactor Grackle to more strongly enforce these requirements.Anybody who sees this is strongly encouraged to contribute to this discussion (ESPECIALLY if you have experience integrating Grackle into simulations with other unit systems!)
Throughout this issue, $LU$, $TU$, and $DU$ represent the conversion factor between code_units and cgs units (at a given $a$) for Length, Time, and Density, respectively.
The Invariants
As I understand it, the primary requirements for defining a unit-system compatible with Grackle stem from assumptions made about the units for the quantities computed during
initialize_chemistry_data
(orlocal_initialize_chemistry_data
). Essentially, grackle requires that the multiplicative factor that must be multiplied by each of the internal quantities, to convert from code-units to cgs units, is constant with respect to cosmological scale factor.To simplify things I will posit that
a_units
should be constant with respect to time. I am not sure if that is strictly required (but I suspect it probably is). Furthermore, I don't think that varying this provides the required flexibility to support other unit systems.Based on contents of the
initialize_rates
function (and the fact that we explicitly define velocity units as $VU = LU/(TU \times a)$ ), I believe we have 3(ish) invariants:Consequences of the invariants:
Let's assume that the above invariants are correct.
This means that Grackle provides no flexibility with defining the
code_units
struct. In other words, at the contents of thecode_units
struct are precisely specified by the currenta_value
and the contents of thecode_units
struct that was passed toinitialize_chemistry_data
(orlocal_initialize_chemistry_data
).Discussion Points:
I guess there are 3 main points for discussion: