-
Notifications
You must be signed in to change notification settings - Fork 121
Smooth MHD Convergence Cases #1040
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
Merged
sbryngelson
merged 10 commits into
MFlowCode:master
from
danieljvickers:mhd-smooth-magnetric-vortex
Nov 14, 2025
+528
−0
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fabc797
Added case files and a hard coded patch for MHD with a smooth case
danieljvickers 9410535
Generated gold files for test
danieljvickers 9f59035
minor case changes
danieljvickers ca41b2c
comment change
danieljvickers 07586f1
case file completes
danieljvickers b4db3c3
Added smooth case for alfvin waves in 1D
danieljvickers 9cbd81a
grammar
danieljvickers 1a9dbca
Merge branch 'MFlowCode:master' into mhd-smooth-magnetric-vortex
danieljvickers 695809d
Updated grid dim to appropriate size
danieljvickers 7a6566e
Format
danieljvickers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| #!/usr/bin/env python3 | ||
| import json | ||
| import math | ||
|
|
||
| # Case for smooth Alfven waves from section 6.3.1 of: | ||
| # The ∇·B=0 Constraint in Shock-Capturing Magnetohydrodynamics Codes | ||
| # Gábor Tóth | ||
|
|
||
| print( | ||
| json.dumps( | ||
| { | ||
| # Logistics | ||
| "run_time_info": "T", | ||
| # Computational Domain Parameters | ||
| "x_domain%beg": 0.0, | ||
| "x_domain%end": 1.0, | ||
| "m": 1023, | ||
| "n": 0, | ||
| "p": 0, | ||
| "dt": 1.0e-5, | ||
| "t_step_start": 0, | ||
| "t_step_stop": 100000, | ||
| "t_step_save": 10000, | ||
| # Simulation Algorithm Parameters | ||
| "num_patches": 1, | ||
| "model_eqns": 2, | ||
| "alt_soundspeed": "F", | ||
| "num_fluids": 1, | ||
| "mpp_lim": "F", | ||
| "mixture_err": "F", | ||
| "time_stepper": 3, | ||
| "weno_order": 3, | ||
| "weno_eps": 1e-7, | ||
| "null_weights": "F", | ||
| "mp_weno": "F", | ||
| "riemann_solver": 4, | ||
| "wave_speeds": 1, | ||
| "avg_state": 2, | ||
| "bc_x%beg": -1, | ||
| "bc_x%end": -1, | ||
| # Formatted Database Files Structure Parameters | ||
| "format": 1, | ||
| "precision": 2, | ||
| "prim_vars_wrt": "T", | ||
| "rho_wrt": "T", | ||
| "parallel_io": "F", | ||
| # MHD | ||
| "mhd": "T", | ||
| "Bx0": 1.0, | ||
| "patch_icpp(1)%geometry": 1, | ||
| "patch_icpp(1)%hcid": 150, | ||
| "patch_icpp(1)%x_centroid": 0.5, | ||
| "patch_icpp(1)%length_x": 1.0, | ||
| "patch_icpp(1)%vel(1)": 0.0, | ||
| "patch_icpp(1)%vel(2)": 0.0, | ||
| "patch_icpp(1)%vel(3)": 0.0, | ||
| "patch_icpp(1)%pres": 0.1, | ||
| "patch_icpp(1)%By": 0.0, | ||
| "patch_icpp(1)%Bz": 0.0, | ||
| "patch_icpp(1)%alpha_rho(1)": 1.0, | ||
| "patch_icpp(1)%alpha(1)": 1.0, | ||
| # Fluids Physical Parameters | ||
| "fluid_pp(1)%gamma": 1.0e00 / (5.0 / 3.0 - 1.0e00), | ||
| "fluid_pp(1)%pi_inf": 0.0, | ||
| } | ||
| ) | ||
| ) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| #!/usr/bin/env python3 | ||
| import json | ||
| import math | ||
|
|
||
| # Case for smoothmagnetic vortex from: | ||
| # Implicit hybridized discontinuous Galerkin methods for | ||
| # compressible magnetohydrodynamics | ||
| # C. Ciuca, P. Fernandez, A. Christophe, N.C. Nguyen, J. Peraire | ||
|
|
||
| # A 2D magnetic vortex advects for a period of T=10 diagonally | ||
|
|
||
| # Configuring case dictionary | ||
| print( | ||
| json.dumps( | ||
| { | ||
| # Logistics | ||
| "run_time_info": "T", | ||
| # Computational Domain Parameters | ||
| "x_domain%beg": -5.0, | ||
| "x_domain%end": 5.0, | ||
| "y_domain%beg": -5.0, | ||
| "y_domain%end": 5.0, | ||
| "m": 1024, | ||
| "n": 1024, | ||
| "p": 0, | ||
| "dt": 1.0e-4, | ||
| "t_step_start": 0, | ||
| "t_step_stop": 100000, | ||
| "t_step_save": 1000, | ||
| # Simulation Algorithm Parameters | ||
| "num_patches": 1, | ||
| "model_eqns": 2, | ||
| "alt_soundspeed": "F", | ||
| "num_fluids": 1, | ||
| "mpp_lim": "F", | ||
| "mixture_err": "F", | ||
| "time_stepper": 3, | ||
| "weno_order": 5, | ||
| "weno_eps": 1.0e-12, | ||
| "null_weights": "F", | ||
| "mp_weno": "F", | ||
| "riemann_solver": 4, | ||
| "wave_speeds": 1, | ||
| "avg_state": 2, | ||
| "bc_x%beg": -1, | ||
| "bc_x%end": -1, | ||
| "bc_y%beg": -1, | ||
| "bc_y%end": -1, | ||
| # Formatted Database Files Structure Parameters | ||
| "format": 1, | ||
| "precision": 2, | ||
| "prim_vars_wrt": "T", | ||
| "rho_wrt": "T", | ||
| "parallel_io": "T", | ||
| # MHD | ||
| "mhd": "T", | ||
| "patch_icpp(1)%hcid": 252, | ||
| "patch_icpp(1)%geometry": 3, | ||
| "patch_icpp(1)%x_centroid": 0.0, | ||
| "patch_icpp(1)%y_centroid": 0.0, | ||
| "patch_icpp(1)%length_x": 10.0, | ||
| "patch_icpp(1)%length_y": 10.0, | ||
| "patch_icpp(1)%vel(1)": 0.0, | ||
| "patch_icpp(1)%vel(2)": 0.0, | ||
| "patch_icpp(1)%vel(3)": 0.0, | ||
| "patch_icpp(1)%pres": 5.0 / (12 * math.pi), | ||
| "patch_icpp(1)%Bx": 0.0, | ||
| "patch_icpp(1)%By": 0.0, | ||
| "patch_icpp(1)%Bz": 0.0, | ||
| "patch_icpp(1)%alpha_rho(1)": 25.0 / (36.0 * math.pi), | ||
| "patch_icpp(1)%alpha(1)": 1.0, | ||
| # Fluids Physical Parameters | ||
| "fluid_pp(1)%gamma": 1.0e00 / (5.0 / 3.0 - 1.0e00), | ||
| "fluid_pp(1)%pi_inf": 0.0, | ||
| } | ||
| ) | ||
| ) |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High-level Suggestion
The 2D magnetic vortex test case is known to fail its convergence test due to existing solver limitations. It should be removed from this PR and introduced later, along with the necessary solver fixes, to avoid adding non-functional code and maintenance overhead. [High-level, importance: 8]
Solution Walkthrough:
Before:
After: