@@ -183,6 +183,22 @@ divergence_cleaning_field(u, equations::AbstractIdealGlmMhdMultiIonEquations) =
183
183
return rho
184
184
end
185
185
186
+ @inline function pressure (u, equations:: AbstractIdealGlmMhdMultiIonEquations )
187
+ B1, B2, B3, _ = u
188
+ p = zero (MVector{ncomponents (equations), real (equations)})
189
+ for k in eachcomponent (equations)
190
+ rho, rho_v1, rho_v2, rho_v3, rho_e = get_component (k, u, equations)
191
+ v1 = rho_v1 / rho
192
+ v2 = rho_v2 / rho
193
+ v3 = rho_v3 / rho
194
+ gamma = equations. gammas[k]
195
+ p[k] = (gamma - 1 ) *
196
+ (rho_e - 0.5f0 * rho * (v1^ 2 + v2^ 2 + v3^ 2 ) -
197
+ 0.5f0 * (B1^ 2 + B2^ 2 + B3^ 2 ))
198
+ end
199
+ return SVector {ncomponents(equations), real(equations)} (p)
200
+ end
201
+
186
202
# Convert conservative variables to primitive
187
203
function cons2prim (u, equations:: AbstractIdealGlmMhdMultiIonEquations )
188
204
@unpack gammas = equations
@@ -471,4 +487,173 @@ end
471
487
472
488
return dissipation
473
489
end
490
+
491
+ @doc raw """
492
+ source_terms_collision_ion_ion(u, x, t,
493
+ equations::AbstractIdealGlmMhdMultiIonEquations)
494
+
495
+ Compute the ion-ion collision source terms for the momentum and energy equations of each ion species as
496
+ ```math
497
+ \b egin{aligned}
498
+ \v ec{s}_{\r ho_k \v ec{v}_k} =& \r ho_k\s um_{l}\b ar{\n u}_{kl}(\v ec{v}_{l} - \v ec{v}_k),\\
499
+ s_{E_k} =&
500
+ 3 \s um_{l} \l eft(
501
+ \b ar{\n u}_{kl} \f rac{\r ho_k M_1}{M_{l} + M_k} R_1 (T_{l} - T_k)
502
+ \r ight) +
503
+ \s um_{l} \l eft(
504
+ \b ar{\n u}_{kl} \r ho_k \f rac{M_{l}}{M_{l} + M_k} \|\v ec{v}_{l} - \v ec{v}_k\| ^2
505
+ \r ight)
506
+ +
507
+ \v ec{v}_k \c dot \v ec{s}_{\r ho_k \v ec{v}_k},
508
+ \e nd{aligned}
509
+ ```
510
+ where ``M_k`` is the molar mass of ion species `k` provided in `equations.molar_masses`,
511
+ ``R_k`` is the specific gas constant of ion species `k` provided in `equations.gas_constants`, and
512
+ ``\b ar{\n u}_{kl}`` is the effective collision frequency of species `k` with species `l`, which is computed as
513
+ ```math
514
+ \b egin{aligned}
515
+ \b ar{\n u}_{kl} = \b ar{\n u}^1_{kl} \t ilde{B}_{kl} \f rac{\r ho_{l}}{T_{k l}^{3/2}},
516
+ \e nd{aligned}
517
+ ```
518
+ with the so-called reduced temperature ``T_{k l}`` and the ion-ion collision constants ``\t ilde{B}_{kl}`` provided
519
+ in `equations.ion_electron_collision_constants` (see [`IdealGlmMhdMultiIonEquations2D`](@ref)).
520
+
521
+ The additional coefficient ``\b ar{\n u}^1_{kl}`` is a non-dimensional drift correction factor proposed by Rambo and Denavit.
522
+
523
+ References:
524
+ - P. Rambo, J. Denavit, Interpenetration and ion separation in colliding plasmas, Physics of Plasmas 1 (1994) 4050–4060.
525
+ [DOI: 10.1063/1.870875](https://doi.org/10.1063/1.870875).
526
+ - Schunk, R. W., Nagy, A. F. (2000). Ionospheres: Physics, plasma physics, and chemistry.
527
+ Cambridge university press. [DOI: 10.1017/CBO9780511635342](https://doi.org/10.1017/CBO9780511635342).
528
+ """
529
+ function source_terms_collision_ion_ion (u, x, t,
530
+ equations:: AbstractIdealGlmMhdMultiIonEquations )
531
+ s = zero (MVector{nvariables (equations), eltype (u)})
532
+ @unpack gas_constants, molar_masses, ion_ion_collision_constants = equations
533
+
534
+ prim = cons2prim (u, equations)
535
+
536
+ for k in eachcomponent (equations)
537
+ rho_k, v1_k, v2_k, v3_k, p_k = get_component (k, prim, equations)
538
+ T_k = p_k / (rho_k * gas_constants[k])
539
+
540
+ S_q1 = zero (eltype (u))
541
+ S_q2 = zero (eltype (u))
542
+ S_q3 = zero (eltype (u))
543
+ S_E = zero (eltype (u))
544
+ for l in eachcomponent (equations)
545
+ # Do not compute collisions of an ion species with itself
546
+ k == l && continue
547
+
548
+ rho_l, v1_l, v2_l, v3_l, p_l = get_component (l, prim, equations)
549
+ T_l = p_l / (rho_l * gas_constants[l])
550
+
551
+ # Reduced temperature
552
+ T_kl = (molar_masses[l] * T_k + molar_masses[k] * T_l) /
553
+ (molar_masses[k] + molar_masses[l])
554
+
555
+ delta_v2 = (v1_l - v1_k)^ 2 + (v2_l - v2_k)^ 2 + (v3_l - v3_k)^ 2
556
+
557
+ # Compute collision frequency without drifting correction
558
+ v_kl = ion_ion_collision_constants[k, l] * rho_l / T_kl^ (3 / 2 )
559
+
560
+ # Correct the collision frequency with the drifting effect
561
+ z2 = delta_v2 / (p_l / rho_l + p_k / rho_k)
562
+ v_kl /= (1 + (2 / (9 * pi ))^ (1 / 3 ) * z2)^ (3 / 2 )
563
+
564
+ S_q1 += rho_k * v_kl * (v1_l - v1_k)
565
+ S_q2 += rho_k * v_kl * (v2_l - v2_k)
566
+ S_q3 += rho_k * v_kl * (v3_l - v3_k)
567
+
568
+ S_E += (3 * molar_masses[1 ] * gas_constants[1 ] * (T_l - T_k)
569
+ +
570
+ molar_masses[l] * delta_v2) * v_kl * rho_k /
571
+ (molar_masses[k] + molar_masses[l])
572
+ end
573
+
574
+ S_E += (v1_k * S_q1 + v2_k * S_q2 + v3_k * S_q3)
575
+
576
+ set_component! (s, k, 0 , S_q1, S_q2, S_q3, S_E, equations)
577
+ end
578
+ return SVector {nvariables(equations), real(equations)} (s)
579
+ end
580
+
581
+ @doc raw """
582
+ source_terms_collision_ion_electron(u, x, t,
583
+ equations::AbstractIdealGlmMhdMultiIonEquations)
584
+
585
+ Compute the ion-electron collision source terms for the momentum and energy equations of each ion species. We assume ``v_e = v^+``
586
+ (no effect of currents on the electron velocity).
587
+
588
+ The collision sources read as
589
+ ```math
590
+ \b egin{aligned}
591
+ \v ec{s}_{\r ho_k \v ec{v}_k} =& \r ho_k \b ar{\n u}_{ke} (\v ec{v}_{e} - \v ec{v}_k),
592
+ \\
593
+ s_{E_k} =&
594
+ 3 \l eft(
595
+ \b ar{\n u}_{ke} \f rac{\r ho_k M_{1}}{M_k} R_1 (T_{e} - T_k)
596
+ \r ight)
597
+ +
598
+ \v ec{v}_k \c dot \v ec{s}_{\r ho_k \v ec{v}_k},
599
+ \e nd{aligned}
600
+ ```
601
+ where ``T_e`` is the electron temperature computed with the function `equations.electron_temperature`,
602
+ ``M_k`` is the molar mass of ion species `k` provided in `equations.molar_masses`,
603
+ ``R_k`` is the specific gas constant of ion species `k` provided in `equations.gas_constants`, and
604
+ ``\b ar{\n u}_{ke}`` is the collision frequency of species `k` with the electrons, which is computed as
605
+ ```math
606
+ \b egin{aligned}
607
+ \b ar{\n u}_{ke} = \t ilde{B}_{ke} \f rac{e n_e}{T_e^{3/2}},
608
+ \e nd{aligned}
609
+ ```
610
+ with the total electron charge ``e n_e`` (computed assuming quasi-neutrality), and the
611
+ ion-electron collision coefficient ``\t ilde{B}_{ke}`` provided in `equations.ion_electron_collision_constants`,
612
+ which is scaled with the elementary charge (see [`IdealGlmMhdMultiIonEquations2D`](@ref)).
613
+
614
+ References:
615
+ - P. Rambo, J. Denavit, Interpenetration and ion separation in colliding plasmas, Physics of Plasmas 1 (1994) 4050–4060.
616
+ [DOI: 10.1063/1.870875](https://doi.org/10.1063/1.870875).
617
+ - Schunk, R. W., Nagy, A. F. (2000). Ionospheres: Physics, plasma physics, and chemistry.
618
+ Cambridge university press. [DOI: 10.1017/CBO9780511635342](https://doi.org/10.1017/CBO9780511635342).
619
+ """
620
+ function source_terms_collision_ion_electron (u, x, t,
621
+ equations:: AbstractIdealGlmMhdMultiIonEquations )
622
+ s = zero (MVector{nvariables (equations), eltype (u)})
623
+ @unpack gas_constants, molar_masses, ion_electron_collision_constants, electron_temperature = equations
624
+
625
+ prim = cons2prim (u, equations)
626
+ T_e = electron_temperature (u, equations)
627
+ T_e_power32 = T_e^ (3 / 2 )
628
+
629
+ v1_plus, v2_plus, v3_plus, vk1_plus, vk2_plus, vk3_plus = charge_averaged_velocities (u,
630
+ equations)
631
+
632
+ # Compute total electron charge
633
+ total_electron_charge = zero (real (equations))
634
+ for k in eachcomponent (equations)
635
+ rho, _ = get_component (k, u, equations)
636
+ total_electron_charge += rho * equations. charge_to_mass[k]
637
+ end
638
+
639
+ for k in eachcomponent (equations)
640
+ rho_k, v1_k, v2_k, v3_k, p_k = get_component (k, prim, equations)
641
+ T_k = p_k / (rho_k * gas_constants[k])
642
+
643
+ # Compute effective collision frequency
644
+ v_ke = ion_electron_collision_constants[k] * total_electron_charge / T_e_power32
645
+
646
+ S_q1 = rho_k * v_ke * (v1_plus - v1_k)
647
+ S_q2 = rho_k * v_ke * (v2_plus - v2_k)
648
+ S_q3 = rho_k * v_ke * (v3_plus - v3_k)
649
+
650
+ S_E = 3 * molar_masses[1 ] * gas_constants[1 ] * (T_e - T_k) * v_ke * rho_k /
651
+ molar_masses[k]
652
+
653
+ S_E += (v1_k * S_q1 + v2_k * S_q2 + v3_k * S_q3)
654
+
655
+ set_component! (s, k, 0 , S_q1, S_q2, S_q3, S_E, equations)
656
+ end
657
+ return SVector {nvariables(equations), real(equations)} (s)
658
+ end
474
659
end
0 commit comments