Skip to content

Modifying MHD equations #552

Answered by c-white
zhouhz1992 asked this question in Q&A
Dec 25, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The short answer is that the code does not have any easy way to modify the magnetic field, by design. Athena is extremely careful to evolve the field correctly, without ever adding a magnetic divergence, and tampering with this can easily break the code.

If you truly want to add a source term for the induction equation, the place to do it is src/field/calculate_corner_e.cpp. The function in that file has two steps. First, it calculates a cell-centered electric field from the cell-centered magnetic field and other quantities. The precise formulas depend on Newtonian/SR/GR. Second, it combines the cell-centered electric fields with the face-centered electric fields returned by the Riemann s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@zhouhz1992
Comment options

Answer selected by zhouhz1992
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants