Repository navigation
Alfven: initialize magnetic components with face averages - #1386
Open
agourakis82 wants to merge 1 commit into
Open
agourakis82 wants to merge 1 commit into
agourakis82 wants to merge 1 commit into
Conversation
Integrate the sinusoidal perturbation analytically over each lower face. Keep the continuous field and restart initialization unchanged. Add standalone coverage for oblique waves, anisotropic cells and whole periods. LLM-offload-review: provider: Darwin coder-next task: math-review issue: numerical quadrature can alias complete wave periods; confirmed in C++23 and replaced by analytic face integrals Review-fallback: independent providers unavailable or incomplete; no two-vendor approval claimed
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #1309.
Initialize the Alfven magnetic field with analytic averages over the lower x,
y and z faces instead of sampling all three components at the cell centre.
The continuous wave, parameters and restart behaviour are unchanged.
Using the closed-form sine/cosine integrals also avoids aliasing in the
existing Romberg routine when a face spans complete wave periods.
The standalone test covers aligned and oblique waves, unequal cell widths,
zero amplitude, complete periods and small cells, with long-double reference
values and an independent numerical-integration check on a resolved wave.
Validation:
bash testpackage/test_alfven_face_averages.shpassed 7,779 checksin C++23. AddressSanitizer and UndefinedBehaviorSanitizer also passed.
On the oblique reproducer, maximum discrete divergence decreased from
3.97e-18 to 4.54e-30 T/m.
A clean native C++23 build in the project's CI image passed, as did
initialization of the official Alfven configuration with two MPI ranks
and
timestep_max=0. This checks initialization, not time evolution.This only addresses the Alfven project, not all initializers in #1309.