-
Notifications
You must be signed in to change notification settings - Fork 133
Fix/mhd cleaning speed #1235
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
base: master
Are you sure you want to change the base?
Fix/mhd cleaning speed #1235
Changes from all commits
d51aaa7
36bf826
b90fc2c
d24ce52
5b7ee95
a502d7e
5319d6c
e553bbc
8b37c79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -652,11 +652,6 @@ contains | |
| call s_compute_fast_magnetosonic_speed(rho_R, c_R, B%R, norm_dir, c_fast%R, H_R) | ||
| end if | ||
|
|
||
| if (hyper_cleaning) then ! mhd | ||
| c_fast%L = min(c_fast%L, -hyper_cleaning_speed) | ||
| c_fast%R = max(c_fast%R, hyper_cleaning_speed) | ||
| end if | ||
|
|
||
| if (viscous) then | ||
| if (chemistry) then | ||
| call compute_viscosity_and_inversion(T_L, Ys_L, T_R, Ys_R, Re_L(1), Re_R(1)) | ||
|
|
@@ -694,6 +689,12 @@ contains | |
| s_R = max(vel_R(dir_idx(1)) + c_R, vel_L(dir_idx(1)) + c_L) | ||
| end if | ||
|
|
||
| if (hyper_cleaning) then | ||
| ! Dedner GLM: (B_n, psi) subsystem has eigenvalues +/- c_h in the lab frame. | ||
| s_L = min(s_L, -hyper_cleaning_speed) | ||
| s_R = max(s_R, hyper_cleaning_speed) | ||
|
Comment on lines
+692
to
+695
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Negative c_h flips bounds The new hyper_cleaning clamp in m_riemann_solvers.fpp assumes hyper_cleaning_speed is positive; if a user supplies a negative c_h, s_L/s_R are clamped in the wrong direction and no longer bound the GLM eigenvalues. The toolchain currently allows negative hyper_cleaning_speed because it has no range constraint and check_mhd_simulation does not validate its sign. Agent Prompt
Comment on lines
+692
to
+695
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Require a positive This assumes Suggested hardening- s_L = min(s_L, -hyper_cleaning_speed)
- s_R = max(s_R, hyper_cleaning_speed)
+ s_L = min(s_L, -abs(hyper_cleaning_speed))
+ s_R = max(s_R, abs(hyper_cleaning_speed))Based on learnings: Add physics validation checks in |
||
| end if | ||
|
|
||
| s_S = (pres_R - pres_L + rho_L*vel_L(dir_idx(1))* & | ||
| (s_L - vel_L(dir_idx(1))) - & | ||
| rho_R*vel_R(dir_idx(1))* & | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
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.
This assumes
hyper_cleaning_speedis positive (since you use both-hyper_cleaning_speedandhyper_cleaning_speedas left/right bounds). If a user provides a negative value (there’s no validation in the toolchain currently), the bounds become inverted and the Riemann fan won’t be properly enclosed. Consider clamping withabs(hyper_cleaning_speed)here and/or adding a case-validator constraint thathyper_cleaning_speed > 0wheneverhyper_cleaning=T.