Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confused about units #103

Closed
zingale opened this issue Aug 12, 2019 · 6 comments
Closed

confused about units #103

zingale opened this issue Aug 12, 2019 · 6 comments

Comments

@zingale
Copy link
Contributor

zingale commented Aug 12, 2019

Looking at: https://enzo.readthedocs.io/en/enzo-2.6/reference/EnzoInternalUnits.html

for the gravitational constant, it says:

The four parameters that the user can set are LengthUnits, TimeUnits, DensityUnits, and MassUnits. Only one of DensityUnits or MassUnits needs to be set, since MassUnits = DensityUnits * LengthUnits**3 . Additionally, if the parameter SelfGravity is turned on (set to 1), the parameter GravitationalConstant must be set to 4piG, where G is Newton’s gravitational constant as a dimensionless quantity (that is, with all units scaled out).

I'm a little confused by this scaling. If I start with Kepler's law for the solar system:

4 pi^2 R^3 / G = M_sun P^2

and work in units of solar masses, years, and AU, then Kepler's law becomes

R^3 = P^2

and G = 4 pi^2

If I follow the discussion in the next paragraph:

If we then wish to use gravity, the gravitational constant must be set explicitly to 4piG expressed in a unitless fashion. Since the gravitational constant in CGS has units of cm^3/(gs**2), this means that the value should be 4pi*Gcgs * DensityUnits * TimeUnits^2.

but going back to Kepler's law, I have

4 pi^2/G (R^3/M) (1/P^2) = 1
or

4 pi^2/G (1/DensityUnits) (1/TimeUnits^2) = 1

so this suggests setting G to 4 pi^2 G_cgs * DensityUnits * TimeUnits^2 -- note the additional factor of pi.

Am I missing something? or are the docs off by a factor of pi here?

@gregbryan
Copy link
Contributor

@zingale -- Thanks for working this out. The documentation is correct. I think the confusion stems from connecting the parameter GravitationalConstant to G. It is not -- it is simply defined to be 4 pi G. This is because, for historical reasons, the factor of 4 pi in Poisson's equation (d^2 phi = 4 pi G rho) was swallowed up by this poorly named coefficient (some history: with Enzo's original cosmology unit definitions that constant is 1 and so this was added in this somewhat confusing fashion later when the non-comoving coordinate system was added). Effectively, in the context of your example above, this means there is a modification to the force law that changes Kepler's law. The documentation is quite explicit on what you should do, and is correct, but much less clear on why. Maybe it would be useful to add this explanation to the documentation?

@zingale
Copy link
Contributor Author

zingale commented Sep 11, 2019

okay, thanks. I did find that section confusing, so if you can clarify it, that might help the next person. You can close this if you wish.

@bwoshea
Copy link
Contributor

bwoshea commented Sep 11, 2019

Thanks @zingale @gregbryan . I will close this issue.

@gregbryan
Copy link
Contributor

gregbryan commented Sep 11, 2019

I have issued PR #114 to try and make the documentation a bit clearer.

@bwoshea bwoshea reopened this Sep 12, 2019
@bwoshea
Copy link
Contributor

bwoshea commented Sep 12, 2019

@zingale I've re-opened this issue so you can confirm the PR clarifies things. Please refer to PR #114 .

@jwise77
Copy link
Contributor

jwise77 commented Jan 3, 2020

Closing after #114 was merged.

@jwise77 jwise77 closed this as completed Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants