Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/KineticForces/EnergyIntegration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ end
Collision frequency ν(x) at normalized energy x = E/T.

- `"zero"`: collisionless (ν = 0)
- `"small"`: 1e-5 * we
- `"small"`: 1e-5 * |we|, a positive Krook width for either rotation direction
- `"krook"`: unmodified Krook operator
- `"harmonic"`: (1 + (l/2)²) * krook * x^(-3/2)
"""
Expand All @@ -62,7 +62,7 @@ Collision frequency ν(x) at normalized energy x = E/T.
nux = if id == 1
0.0
elseif id == 2
1e-5 * p.we
1e-5 * abs(p.we)
elseif id == 3
p.nuk
else
Expand Down
18 changes: 18 additions & 0 deletions test/runtests_kinetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,24 @@
# qt multiplies by (x - 2.5) = 0.5
@test val_qt ≈ (x - 2.5) * val_no atol = 1e-14
end

@testset "small collisions damp for either rotation sign" begin
# Match a positive Krook width for either rotation direction.
for we in (2.0, -2.0)
p_small = KF.EnergyParams(
1.0, 0.5, we, 0.5, 1.0, 0.0, 1.0, 1,
"small", "maxwellian", 1.0, false
)
p_krook = KF.EnergyParams(
1.0, 0.5, we, 0.5, 1.0, 1e-5 * abs(we), 1.0, 1,
"krook", "maxwellian", 1.0, false
)
for x in (0.3, 1.0, 3.0)
@test KF.energy_integrand_scalar(x, p_small) ≈
KF.energy_integrand_scalar(x, p_krook) rtol = 1e-14
end
end
end
end

# =========================================================================
Expand Down
Loading