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

add sqrt(4pi) factor to magnetic field unit conversion #122

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

BenWibking
Copy link
Contributor

@BenWibking BenWibking commented Nov 4, 2024

Internally, AthenaPK (and almost all MHD codes) use Heaviside-Lorentz units, where the magnetic field is transformed from $B \rightarrow B / \sqrt{4 \pi}$. (See also the note in the Castro documentation about this.)

So when converting from CGS-Gaussian units to code units, it is necessary to divide by $\sqrt{4 \pi}$ (in addition to the base dimensional factors).

When converting from code units to CGS-Gaussian units, it is necessary to multiply by $\sqrt{4 \pi}$ (in addition to the base dimensional factors).

@BenWibking BenWibking changed the title add sqrt(4pi) to cgs B-field units add sqrt(4pi) factor to magnetic field unit conversion Nov 5, 2024
@pgrete
Copy link
Contributor

pgrete commented Nov 8, 2024

I also checked the code neither code_magnetic_cgs nor gauss nor microgauss (which use the former) were used anywhere in the code, so I don't this this fix has (or had) any imminent impact.

@BenWibking BenWibking merged commit 9d0dde3 into main Nov 8, 2024
4 checks passed
@pgrete pgrete deleted the BenWibking/fix-magnetic-units branch November 29, 2024 21:07
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

Successfully merging this pull request may close these issues.

2 participants