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

[WIP] Compute emf #900

Draft
wants to merge 102 commits into
base: development
Choose a base branch
from
Draft

[WIP] Compute emf #900

wants to merge 102 commits into from

Conversation

BenWibking
Copy link
Collaborator

@BenWibking BenWibking commented Feb 22, 2025

Description

TODO:

  • is the amount of numerical resistivity consistent with other second-order CT codes?
  • fix wavespeeds
  • reconstruct face-centered Riemann velocities to edges
  • print warning when running MHD problems that MHD is currently experimental
  • prevent users from turning on both MHD and AMR (for now)
  • require a gamma-law EOS when MHD is enabled
  • compute error norm in the same way as the HydroWave test?

Related issues

Fixes #648.

Checklist

Before this pull request can be reviewed, all of these tasks should be completed. Denote completed tasks with an x inside the square brackets [ ] in the Markdown source below:

  • I have added a description (see above).
  • I have added a link to any related issues (if applicable; see above).
  • I have read the Contributing Guide.
  • I have added tests for any new physics that this PR adds to the code.
  • (For quokka-astro org members) I have manually triggered the GPU tests with the magic comment /azp run.

AstroKriel and others added 30 commits May 8, 2024 13:44
… with different permutations can live in the same multifab
… with different permutations can live in the same multifab
@BenWibking BenWibking added the enhancement New feature or request label Feb 23, 2025
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@BenWibking
Copy link
Collaborator Author

BenWibking commented Feb 25, 2025

The current sheet problem (https://www.astro.princeton.edu/~jstone/Athena/tests/current-sheet/current-sheet.html) runs, but produces very low densities, so I stopped it after the timestep got too small to continue (at about t ~ 1.9). It is stable with either arithmetic averaging scheme, but it has significant oscillations in the magnetic field (which is expected for arithmetic averaging):
visit0005

@BenWibking
Copy link
Collaborator Author

BenWibking commented Feb 25, 2025

This is not very clear from the text, but the average transverse face-centered velocity ${\bar v}_i$ (Equation 29) is actually (almost exactly) the face-centered velocity returned by the HLLD solver that we already compute and store in the face-centered Multifabs. (Strictly speaking, it is only identical if we were to use an HLL solver for the hydro fluxes, since Equation 29 is the exact face-centered Riemann velocity state for the HLL solver.)

Neco has currently implemented Equation 27 below.

But I think it will make the code much simpler (and avoid the problematic method of reconstructing two directions in two different ways from Felker & Stone) to instead implement Equation 28 (https://ui.adsabs.harvard.edu/abs/2021JCoPh.42409748M/abstract):

Screenshot 2025-02-25 at 11 44 24 AM

@BenWibking
Copy link
Collaborator Author

BenWibking commented Feb 25, 2025

Ok, so it crashes in the AlfvenWave test if you turn on the HLL emf solver from LD04:
https://github.com/quokka-astro/quokka/actions/runs/13528028184/job/37803398004?pr=900

@BenWibking
Copy link
Collaborator Author

It probably makes sense to use a much larger tolerance for the magnetic field L1 norm:

Checking cc-quantities
Relative rms L1 error norm = 1.762394815e-08
Checking fc-quantities in the 0 direction
Relative rms L1 error norm = 0, with err_norm = 0 and sol_norm = 12384
Checking fc-quantities in the 1 direction
Relative rms L1 error norm = 0.03801034604, with err_norm = 0.0003221579543 and sol_norm = 0.008475533318
Checking fc-quantities in the 2 direction
Relative rms L1 error norm = 0.03801035536, with err_norm = 0.0003345151396 and sol_norm = 0.008800631733

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request MHD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use one extra ghost cell for MHD
3 participants