-
Couldn't load subscription status.
- Fork 131
WIP: Sc/flux ruedaramirez etal normal direction #2446
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: main
Are you sure you want to change the base?
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
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.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
JuliaFormatter
[JuliaFormatter] reported by reviewdog 🐶
| (rho_e_rr - 0.5f0 * rho_rr * vel_norm_rr - 0.5f0 * mag_norm_rr - |
[JuliaFormatter] reported by reviewdog 🐶
| vk3_plus_ll[k] * B3_ll |
[JuliaFormatter] reported by reviewdog 🐶
| vk3_plus_rr[k] * B3_rr |
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/src/equations/ideal_glm_mhd_multiion_2d.jl
Lines 1213 to 1214 in a29b2e2
| f2 = (f1 * v1_avg + p_mean) * normal_direction[1] + f1 * v1_avg * normal_direction[2] | |
| f3 = f1 * v2_avg * normal_direction[1] + (f1 * v2_avg + p_mean) * normal_direction[2] |
[JuliaFormatter] reported by reviewdog 🐶
| vk1_plus_rr[k] * mag_norm_rr) |
[JuliaFormatter] reported by reviewdog 🐶
| vk2_plus_rr[k] * mag_norm_rr) |
[JuliaFormatter] reported by reviewdog 🐶
| f2 * v1_avg + f3 * v2_avg + f4 * v3_avg |
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/src/equations/ideal_glm_mhd_multiion_2d.jl
Lines 1227 to 1239 in a29b2e2
| 0.5f0 * v1_plus_mag_avg * normal_direction[1] - 0.5f0 * v2_plus_mag_avg + normal_direction[2] + | |
| (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) * vel_dot_mag_avg # Same terms as in Derigs (but with v_plus) | |
| + f9 * psi_avg - equations.c_h * (psi_B1_avg * normal_direction[1] + psi_B1_avg * normal_direction[2]) # GLM term | |
| + | |
| 0.5f0 * (vk1_plus_avg * normal_direction[1] + vk2_plus_avg * normal_direction[2]) * mag_norm_avg - | |
| vk1_plus_avg * (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) * B1_avg - | |
| vk2_plus_avg * (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) * B2_avg - | |
| vk3_plus_avg * (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) * B3_avg # Additional terms related to the Lorentz non-conservative term (momentum eqs) | |
| - | |
| B2_avg * (vk1_minus_avg * B2_avg - vk2_minus_avg * B1_avg) * normal_direction[1] - | |
| B3_avg * (vk1_minus_avg * B3_avg - vk3_minus_avg * B1_avg) * normal_direction[1] - | |
| B1_avg * (vk2_minus_avg * B1_avg - vk1_minus_avg * B2_avg) * normal_direction[2] - | |
| B3_avg * (vk2_minus_avg * B3_avg - vk3_minus_avg * B2_avg) * normal_direction[2]) # Terms related to the multi-ion non-conservative term (induction equation!) |
[JuliaFormatter] reported by reviewdog 🐶
| v_ll = max(v_ll, abs((rho_v1 * normal_direction[1] + rho_v2 * normal_direction[2]) / rho)) |
[JuliaFormatter] reported by reviewdog 🐶
| v_rr = max(v_rr, abs((rho_v1 * normal_direction[1] + rho_v2 * normal_direction[2]) / rho)) |
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/src/equations/ideal_glm_mhd_multiion_2d.jl
Lines 1418 to 1420 in a29b2e2
| sqrt(0.5f0 * (a_square + b_square) + | |
| 0.5f0 * | |
| sqrt((a_square + b_square)^2 - 4 * a_square * (b1 *normal_direction[1] + b2 * normal_direction[2])^2))) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2446 +/- ##
==========================================
- Coverage 96.83% 96.26% -0.57%
==========================================
Files 504 504
Lines 41813 42061 +248
==========================================
Hits 40487 40487
- Misses 1326 1574 +248
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
JuliaFormatter
[JuliaFormatter] reported by reviewdog 🐶
| vk1_plus_rr[k] * mag_norm_rr) |
[JuliaFormatter] reported by reviewdog 🐶
| vk2_plus_rr[k] * mag_norm_rr) |
[JuliaFormatter] reported by reviewdog 🐶
| f2 * v1_avg + f3 * v2_avg + f4 * v3_avg |
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/src/equations/ideal_glm_mhd_multiion_2d.jl
Lines 1228 to 1240 in 31cc07d
| 0.5f0 * v1_plus_mag_avg * normal_direction[1] - 0.5f0 * v2_plus_mag_avg + normal_direction[2] + | |
| (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) * vel_dot_mag_avg # Same terms as in Derigs (but with v_plus) | |
| + f9 * psi_avg - equations.c_h * (psi_B1_avg * normal_direction[1] + psi_B1_avg * normal_direction[2]) # GLM term | |
| + | |
| 0.5f0 * (vk1_plus_avg * normal_direction[1] + vk2_plus_avg * normal_direction[2]) * mag_norm_avg - | |
| vk1_plus_avg * (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) * B1_avg - | |
| vk2_plus_avg * (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) * B2_avg - | |
| vk3_plus_avg * (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) * B3_avg # Additional terms related to the Lorentz non-conservative term (momentum eqs) | |
| - | |
| B2_avg * (vk1_minus_avg * B2_avg - vk2_minus_avg * B1_avg) * normal_direction[1] - | |
| B3_avg * (vk1_minus_avg * B3_avg - vk3_minus_avg * B1_avg) * normal_direction[1] - | |
| B1_avg * (vk2_minus_avg * B1_avg - vk1_minus_avg * B2_avg) * normal_direction[2] - | |
| B3_avg * (vk2_minus_avg * B3_avg - vk3_minus_avg * B2_avg) * normal_direction[2]) # Terms related to the multi-ion non-conservative term (induction equation!) |
[JuliaFormatter] reported by reviewdog 🐶
| v_ll = max(v_ll, abs((rho_v1 * normal_direction[1] + rho_v2 * normal_direction[2]) / rho)) |
[JuliaFormatter] reported by reviewdog 🐶
| v_rr = max(v_rr, abs((rho_v1 * normal_direction[1] + rho_v2 * normal_direction[2]) / rho)) |
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/src/equations/ideal_glm_mhd_multiion_2d.jl
Lines 1419 to 1421 in 31cc07d
| sqrt(0.5f0 * (a_square + b_square) + | |
| 0.5f0 * | |
| sqrt((a_square + b_square)^2 - 4 * a_square * (b1 *normal_direction[1] + b2 * normal_direction[2])^2))) |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Thanks for adding this @SimonCan!
Besides the formatting, I think that you can improve the implementation by precomputing the inner product of vector quantities with the normal direction. Here some examples:
| f1 = rho_v1 * normal_direction[1] + rho_v2 * normal_direction[2] | ||
| f2 = (rho_v1 * v1 + p) * normal_direction[1] + rho_v2 * v1 * normal_direction[2] | ||
| f3 = rho_v1 * v2 * normal_direction[1] + (rho_v2 * v2 + p) * normal_direction[2] | ||
| f4 = rho_v1 * v3 * normal_direction[1] + rho_v2 * v3 * normal_direction[2] | ||
| f5 = ((kin_en + gamma * p / (gamma - 1)) * v1 + 2 * mag_en * vk1_plus[k] - | ||
| B1 * (vk1_plus[k] * B1 + vk2_plus[k] * B2 + vk3_plus[k] * B3) + | ||
| equations.c_h * psi * B1) * normal_direction[1] + | ||
| ((kin_en + gamma * p / (gamma - 1)) * v2 + 2 * mag_en * vk2_plus[k] - | ||
| B2 * (vk1_plus[k] * B1 + vk2_plus[k] * B2 + vk3_plus[k] * B3) + | ||
| equations.c_h * psi * B2) * normal_direction[2] |
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 looks correct (up to formatting), but you can get a cleaner and better performing implementation by precomputing the inner product of the vector quantities with the normal direction. This is what is done in other equations.
I already implemented this flux using normal_direction instead of orientation for IdealGlmMhdMultiIonEquations3D. It's already in main, so you can have a look there to see how it's implemented. For instance, here is this part:
Trixi.jl/src/equations/ideal_glm_mhd_multiion_3d.jl
Lines 281 to 298 in fa9d6b1
| v_normal = v1 * normal_direction[1] + v2 * normal_direction[2] + | |
| v3 * normal_direction[3] | |
| rho_v_normal = rho * v_normal | |
| vk_plus_normal = vk1_plus[k] * normal_direction[1] + | |
| vk2_plus[k] * normal_direction[2] + | |
| vk3_plus[k] * normal_direction[3] | |
| gamma = equations.gammas[k] | |
| p = (gamma - 1) * (rho_e - kin_en - mag_en - div_clean_energy) | |
| f1 = rho_v_normal | |
| f2 = rho_v_normal * v1 + p * normal_direction[1] | |
| f3 = rho_v_normal * v2 + p * normal_direction[2] | |
| f4 = rho_v_normal * v3 + p * normal_direction[3] | |
| f5 = (kin_en + gamma * p / (gamma - 1)) * v_normal + | |
| 2 * mag_en * vk_plus_normal - | |
| B_normal * (vk1_plus[k] * B1 + vk2_plus[k] * B2 + vk3_plus[k] * B3) + | |
| equations.c_h * psi * B_normal |
It should look pretty much identical for IdealGlmMhdMultiIonEquations2D, but removing the terms that depend on normal_direction[3]
| f2 = charge_ratio_ll[k] * ((0.5f0 * mag_norm_avg - B1_avg * B1_avg + pe_mean) * normal_direction[1] + (-B2_avg * B1_avg) * normal_direction[2]) | ||
| f3 = charge_ratio_ll[k] * ((-B1_avg * B2_avg) * normal_direction[1] + (-B2_avg * B2_avg + 0.5f0 * mag_norm_avg + pe_mean) * normal_direction[2]) | ||
| f4 = charge_ratio_ll[k] * (-B1_avg * B3_avg * normal_direction[1] - B2_avg * B3_avg * normal_direction[2]) | ||
| f5 = (vk1_plus_ll[k] * normal_direction[1] + vk2_plus_ll[k] * normal_direction[2]) * pe_mean |
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.
Same as above. Here the 3D implementation:
Trixi.jl/src/equations/ideal_glm_mhd_multiion_3d.jl
Lines 576 to 587 in fa9d6b1
| f2 = charge_ratio_ll[k] * | |
| ((0.5f0 * mag_norm_avg + pe_mean) * normal_direction[1] - | |
| B_dot_n_avg * B1_avg) | |
| f3 = charge_ratio_ll[k] * | |
| ((0.5f0 * mag_norm_avg + pe_mean) * normal_direction[2] - | |
| B_dot_n_avg * B2_avg) | |
| f4 = charge_ratio_ll[k] * | |
| ((0.5f0 * mag_norm_avg + pe_mean) * normal_direction[3] - | |
| B_dot_n_avg * B3_avg) | |
| f5 = (vk1_plus_ll[k] * normal_direction[1] + | |
| vk2_plus_ll[k] * normal_direction[2] + | |
| vk3_plus_ll[k] * normal_direction[3]) * pe_mean |
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.
Done!
…github.com/trixi-framework/Trixi.jl into sc/flux_ruedaramirez_etal_normal_direction
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.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
JuliaFormatter
[JuliaFormatter] reported by reviewdog 🐶
| v_rr = max(v_rr, abs((rho_v1 * normal_direction[1] + rho_v2 * normal_direction[2]) / rho)) |
[JuliaFormatter] reported by reviewdog 🐶
Trixi.jl/src/equations/ideal_glm_mhd_multiion_2d.jl
Lines 1425 to 1427 in c461f93
| sqrt(0.5f0 * (a_square + b_square) + | |
| 0.5f0 * | |
| sqrt((a_square + b_square)^2 - 4 * a_square * (b1 *normal_direction[1] + b2 * normal_direction[2])^2))) |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
Currently the test simulation in src/callbacks_step/analysis_dg2d.jl runs into instabilities. This examples should be very similar to the tree mesh example with a comparable resolution. |
| f5 += (f6 * B1_avg + f7 * B2_avg + f8 * B3_avg - | ||
| 0.5f0 * v1_plus_mag_avg * normal_direction[1] - 0.5f0 * v2_plus_mag_avg + | ||
| normal_direction[2] + | ||
| (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) * |
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 would be more efficient if you computed B_dot_n_avg at the beginning of the function, as in the 3D version. This quantity is the same for all species.
See #2446 (comment).
| (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) * B1_avg - | ||
| vk2_plus_avg * | ||
| (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) * B2_avg - | ||
| vk3_plus_avg * | ||
| (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) * B3_avg # Additional terms related to the Lorentz non-conservative term (momentum eqs) |
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.
Here, again, B_dot_n_avg is computed three more times for each species.
| f2 = charge_ratio_ll[k] * | ||
| ((0.5f0 * mag_norm_avg - B1_avg * B1_avg + pe_mean) * normal_direction[1] + | ||
| (-B2_avg * B1_avg) * normal_direction[2]) | ||
| f3 = charge_ratio_ll[k] * ((-B1_avg * B2_avg) * normal_direction[1] + | ||
| (-B2_avg * B2_avg + 0.5f0 * mag_norm_avg + pe_mean) * normal_direction[2]) | ||
| f4 = charge_ratio_ll[k] * (-B1_avg * B3_avg * normal_direction[1] - | ||
| B2_avg * B3_avg * normal_direction[2]) | ||
| f5 = (vk1_plus_ll[k] * normal_direction[1] + | ||
| vk2_plus_ll[k] * normal_direction[2]) * pe_mean |
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.
I had already suggested changing this in #2446 (comment).
This would be more efficient if you computed B_dot_n_avg at the beginning of the function, as in the 3D version. This quantity is the same for all species.
Co-authored-by: Andrés Rueda-Ramírez <[email protected]>
Co-authored-by: Andrés Rueda-Ramírez <[email protected]>
Co-authored-by: Andrés Rueda-Ramírez <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andrés Rueda-Ramírez <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| # f2 = charge_ratio_ll[k] * | ||
| # ((0.5f0 * mag_norm_avg - B1_avg * B1_avg + pe_mean) * normal_direction[1] + | ||
| # (-B2_avg * B1_avg) * normal_direction[2]) | ||
| # f3 = charge_ratio_ll[k] * ((-B1_avg * B2_avg) * normal_direction[1] + | ||
| # (-B2_avg * B2_avg + 0.5f0 * mag_norm_avg + pe_mean) * normal_direction[2]) | ||
| # f4 = charge_ratio_ll[k] * (-B1_avg * B3_avg * normal_direction[1] - | ||
| # B2_avg * B3_avg * normal_direction[2]) |
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.
[JuliaFormatter] reported by reviewdog 🐶
| # f2 = charge_ratio_ll[k] * | |
| # ((0.5f0 * mag_norm_avg - B1_avg * B1_avg + pe_mean) * normal_direction[1] + | |
| # (-B2_avg * B1_avg) * normal_direction[2]) | |
| # f3 = charge_ratio_ll[k] * ((-B1_avg * B2_avg) * normal_direction[1] + | |
| # (-B2_avg * B2_avg + 0.5f0 * mag_norm_avg + pe_mean) * normal_direction[2]) | |
| # f4 = charge_ratio_ll[k] * (-B1_avg * B3_avg * normal_direction[1] - | |
| # B2_avg * B3_avg * normal_direction[2]) | |
| # f2 = charge_ratio_ll[k] * | |
| # ((0.5f0 * mag_norm_avg - B1_avg * B1_avg + pe_mean) * normal_direction[1] + | |
| # (-B2_avg * B1_avg) * normal_direction[2]) | |
| # f3 = charge_ratio_ll[k] * ((-B1_avg * B2_avg) * normal_direction[1] + | |
| # (-B2_avg * B2_avg + 0.5f0 * mag_norm_avg + pe_mean) * normal_direction[2]) | |
| # f4 = charge_ratio_ll[k] * (-B1_avg * B3_avg * normal_direction[1] - | |
| # B2_avg * B3_avg * normal_direction[2]) |
| # f5 += dot(B_ll, cross(vk_minus_avg, B_avg)) ⋅ normal_direction | ||
| f5 += dot(B_ll, cross(vk_minus_avg, B_avg)) * dot(normal_direction, normal_direction) | ||
| # f5 += (B2_ll * (vk1_minus_avg * B2_avg - vk2_minus_avg * B1_avg) + | ||
| # B3_ll * (vk1_minus_avg * B3_avg - vk3_minus_avg * B1_avg)) * | ||
| # normal_direction[1] | ||
| # f5 += (B1_ll * (vk2_minus_avg * B1_avg - vk1_minus_avg * B2_avg) + | ||
| # B3_ll * (vk2_minus_avg * B3_avg - vk3_minus_avg * B2_avg)) * | ||
| # normal_direction[2] |
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.
[JuliaFormatter] reported by reviewdog 🐶
| # f5 += dot(B_ll, cross(vk_minus_avg, B_avg)) ⋅ normal_direction | |
| f5 += dot(B_ll, cross(vk_minus_avg, B_avg)) * dot(normal_direction, normal_direction) | |
| # f5 += (B2_ll * (vk1_minus_avg * B2_avg - vk2_minus_avg * B1_avg) + | |
| # B3_ll * (vk1_minus_avg * B3_avg - vk3_minus_avg * B1_avg)) * | |
| # normal_direction[1] | |
| # f5 += (B1_ll * (vk2_minus_avg * B1_avg - vk1_minus_avg * B2_avg) + | |
| # B3_ll * (vk2_minus_avg * B3_avg - vk3_minus_avg * B2_avg)) * | |
| # normal_direction[2] | |
| # f5 += dot(B_ll, cross(vk_minus_avg, B_avg)) ⋅ normal_direction | |
| f5 += dot(B_ll, cross(vk_minus_avg, B_avg)) * | |
| dot(normal_direction, normal_direction) | |
| # f5 += (B2_ll * (vk1_minus_avg * B2_avg - vk2_minus_avg * B1_avg) + | |
| # B3_ll * (vk1_minus_avg * B3_avg - vk3_minus_avg * B1_avg)) * | |
| # normal_direction[1] | |
| # f5 += (B1_ll * (vk2_minus_avg * B1_avg - vk1_minus_avg * B2_avg) + | |
| # B3_ll * (vk2_minus_avg * B3_avg - vk3_minus_avg * B2_avg)) * | |
| # normal_direction[2] |
| # normal_direction[2] | ||
|
|
||
| # Compute Godunov-Powell term | ||
| GP_term = charge_ratio_ll[k] * (B_ll * dot(B_avg, SVector((normal_direction..., 0)))) |
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.
[JuliaFormatter] reported by reviewdog 🐶
| GP_term = charge_ratio_ll[k] * (B_ll * dot(B_avg, SVector((normal_direction..., 0)))) | |
| GP_term = charge_ratio_ll[k] * | |
| (B_ll * dot(B_avg, SVector((normal_direction..., 0)))) |
| # f2 += charge_ratio_ll[k] * B1_ll * | ||
| # (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) | ||
| # f3 += charge_ratio_ll[k] * B2_ll * | ||
| # (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) | ||
| # f4 += charge_ratio_ll[k] * B3_ll * | ||
| # (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) |
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.
[JuliaFormatter] reported by reviewdog 🐶
| # f2 += charge_ratio_ll[k] * B1_ll * | |
| # (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) | |
| # f3 += charge_ratio_ll[k] * B2_ll * | |
| # (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) | |
| # f4 += charge_ratio_ll[k] * B3_ll * | |
| # (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) | |
| # f2 += charge_ratio_ll[k] * B1_ll * | |
| # (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) | |
| # f3 += charge_ratio_ll[k] * B2_ll * | |
| # (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) | |
| # f4 += charge_ratio_ll[k] * B3_ll * | |
| # (B1_avg * normal_direction[1] + B2_avg * normal_direction[2]) |
|
|
||
| # total energy flux is complicated and involves the previous eight components | ||
| vk1_plus_mag_avg = 0.5f0 * (vk1_plus_ll[k] * mag_norm_ll + | ||
| vk1_plus_rr[k] * mag_norm_rr) |
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.
[JuliaFormatter] reported by reviewdog 🐶
| vk1_plus_rr[k] * mag_norm_rr) | |
| vk1_plus_rr[k] * mag_norm_rr) |
Added fluxes using
normal_directioninstead oforientationtoIdealGlmMhdMultiIonEquations2D.