-
Notifications
You must be signed in to change notification settings - Fork 112
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
Implement collision source terms for multi-ion MHD #2213
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. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2213 +/- ##
==========================================
+ Coverage 96.37% 96.38% +0.01%
==========================================
Files 486 487 +1
Lines 39186 39291 +105
==========================================
+ Hits 37764 37869 +105
Misses 1422 1422
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
v_mag = sqrt(v1^2 + v2^2 + v3^2) | ||
gamma = equations.gammas[k] | ||
p[k] = (gamma - 1) * | ||
(rho_e - 0.5f0 * rho * v_mag^2 - 0.5f0 * (B1^2 + B2^2 + B3^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 is a little inconsistent as there is v_mag
but no B_mag
.
References: | ||
- P. Rambo, J. Denavit, Interpenetration and ion separation in colliding plasmas, Physics of Plasmas 1 (1994) 4050–4060. | ||
- Schunk, R. W., Nagy, A. F. (2000). Ionospheres: Physics, plasma physics, and chemistry. | ||
Cambridge university press. |
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.
Could you provide the DOI here?
function source_terms_collision_ion_ion(u, x, t, | ||
equations::AbstractIdealGlmMhdMultiIonEquations) |
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.
Out of curiosity: Could one re-use this for a 2 fluid (ion-electron) Euler-Poisson Plasma approximation?
References: | ||
- P. Rambo, J. Denavit, Interpenetration and ion separation in colliding plasmas, Physics of Plasmas 1 (1994) 4050–4060. | ||
- Schunk, R. W., Nagy, A. F. (2000). Ionospheres: Physics, plasma physics, and chemistry. | ||
Cambridge university press. |
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
- Schunk, R. W., & Nagy, A. F. (2000). Ionospheres: Physics, plasma physics, and chemistry. | ||
Cambridge university press. |
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.
As above: DOI would be nice.
gas_constants = (1.0, 1.0), # [nondimensional] | ||
molar_masses = (1.0, 1.0), # [nondimensional] | ||
ion_ion_collision_constants = [0.0 0.4079382480442680; | ||
0.4079382480442680 0.0], # [nondimensional] (computed with eq (4.142) of Schunk&Nagy (2009)) |
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.
0.4079382480442680 0.0], # [nondimensional] (computed with eq (4.142) of Schunk&Nagy (2009)) | |
0.4079382480442680 0.0], # [nondimensional] (computed with eq (4.142) of Schunk & Nagy (2009)) |
rho_1, _ = Trixi.get_component(1, u, equations) | ||
p = pressure(u, equations) | ||
|
||
return p[1] / rho_1 / equations.gas_constants[1] |
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 a bit strange - maybe add some parantheses?
return p[1] / rho_1 / equations.gas_constants[1] | |
return p[1] / (rho_1 * equations.gas_constants[1]) |
rho_2, _ = Trixi.get_component(2, u, equations) | ||
p = pressure(u, equations) | ||
|
||
return p[2] / rho_2 / equations.gas_constants[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.
Same as above
return p[2] / rho_2 / equations.gas_constants[2] | |
return p[2] / (rho_2 * equations.gas_constants[2]) |
mesh = TreeMesh(coordinates_min, coordinates_max, | ||
initial_refinement_level = 1, |
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.
Maybe mention again here why such a coarse mesh is used?
Compute the ion-ion collision source terms for the momentum and energy equations of each ion species as | ||
```math | ||
\begin{aligned} | ||
\vec{s}_{\rho_k \vec{v}_k} =& \rho_k\sum_{k'}\bar{\nu}_{kk'}(\vec{v}_{k'} - \vec{v}_k),\\ |
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 assume you have k'
for consistency with the paper. Alternatively, one could maybe think about using l
as in the implementation?
The additional coefficient ``\bar{\nu}^1_{kk'}`` is a non-dimensional drift correction factor proposed by Rambo and | ||
Denavit. |
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.
The additional coefficient ``\bar{\nu}^1_{kk'}`` is a non-dimensional drift correction factor proposed by Rambo and | |
Denavit. | |
The additional coefficient ``\bar{\nu}^1_{kk'}`` is a non-dimensional drift correction factor proposed by Rambo and Denavit. |
The ion-ion and ion-electron collision source terms can be computed using the functions | ||
[`source_terms_collision_ion_ion`](@ref) and [`source_terms_collision_ion_electron`](@ref), respectively. | ||
|
||
For ion-ion collision terms, the optional arguments `gas_constants`, `molar_masses`, and `ion_ion_collision_constants` |
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.
For ion-ion collision terms, the optional arguments `gas_constants`, `molar_masses`, and `ion_ion_collision_constants` | |
For ion-ion collision terms, the optional keyword arguments `gas_constants`, `molar_masses`, and `ion_ion_collision_constants` |
[`source_terms_collision_ion_ion`](@ref) and [`source_terms_collision_ion_electron`](@ref), respectively. | ||
|
||
For ion-ion collision terms, the optional arguments `gas_constants`, `molar_masses`, and `ion_ion_collision_constants` | ||
must be provided. For ion-electron collision terms, the optional arguments `gas_constants`, `molar_masses`, |
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.
must be provided. For ion-electron collision terms, the optional arguments `gas_constants`, `molar_masses`, | |
must be provided. For ion-electron collision terms, the optional keyword arguments `gas_constants`, `molar_masses`, |
This PR introduces collision source terms for multi-ion MHD, accompanied by detailed documentation and a physically relevant test case based on the following reference:
The Figure shows the temperature of two ion species for the second frictional slow-down test described in the reference above, as computed with
examples/tree_2d_dgsem/elixir_mhdmultiion_collisions.jl
andsource_terms = source_terms_collision_ion_ion
.