Module kompaneets

Source
Expand description

Kompaneets equation: Compton scattering of photons off thermal electrons.

The Kompaneets equation describes the Fokker-Planck (diffusion) approximation to Compton scattering in the non-relativistic limit:

dn/dτ|_C = (θ_e / x²) ∂/∂x [x⁴ (∂n/∂x + φ n(n+1))]

where φ = T_z/T_e, θ_e = kT_e/(m_e c²), τ = t/t_C.

For small distortions Δn = n - n_pl, the linearized form is:

dΔn/dτ|_C = (θ_e / x²) ∂/∂x [x⁴ (∂Δn/∂x + φ(2n_pl+1)Δn)] + source

Discretized with second-order conservative finite differences and solved with Crank-Nicolson time stepping → tridiagonal system.

References:

  • Kompaneets (1957), JETP
  • Chluba & Sunyaev (2012), MNRAS 419, 1294 [Eq. 4]

Structs§

DcbrCoupling
DC/BR coupling data for implicit backward Euler within the Kompaneets step.
KompaneetsWorkspace
Pre-allocated workspace for Kompaneets solver.
RhoECoupling
Parameters for coupling ρ_e into the bordered Newton system.

Functions§

kompaneets_step_coupled_inplace
In-place Kompaneets + DC/BR step using pre-allocated workspace.
kompaneets_step_nonlinear
Perform one implicit step of the NONLINEAR Kompaneets equation on Δn.
thomas_solve
Solve a tridiagonal system (allocating version for tests/convenience).
thomas_solve_inplace
Solve a tridiagonal system Ax = d using the Thomas algorithm.