Skip to content
Projects

Null-collision method

The equations of plasmacoll.mcc, declared on the code that implements them and checked by the tests.

attenuation

functionsource

Return sum_k n_k(x) sigma_k(E) (1/m), the inverse mean free path.

attenuation
1λ=∑knk(x) σk(Ek),Ek=mkv22e\frac{1}{\lambda} = \sum_k n_k(\mathbf x)\,\sigma_k(E_k), \qquad E_k = \frac{m_k v^2}{2e}
Assumes
  • targets at rest: g=∣v∣g = |\mathbf v|, their temperature and drift ignored, for markers much faster than the neutrals
Built from

collide

functionsource

Collide one species' markers for one time step dt (s).

max speed
gmax⁡,b=vmax⁡+∣ub∣+8e TbFT,bMb,vmax⁡=max⁡i∣vi∣g_{\max,b} = v_{\max} + |\mathbf u_b| + 8\sqrt{\frac{e\,T_b F_{T,b}}{M_b}}, \qquad v_{\max} = \max_i |\mathbf v_i|
probability
P=1−e−νmax⁡ΔtP = 1 - e^{-\nu_{\max}\Delta t}
selection
∑j<kνj≤R νmax⁡<∑j≤kνj ⇒ process k,R νmax⁡≥∑jνj ⇒ null collision\sum_{j<k}\nu_j \le R\,\nu_{\max} < \sum_{j\le k}\nu_j \ \Rightarrow\ \text{process } k, \qquad R\,\nu_{\max} \ge \sum_j \nu_j \ \Rightarrow\ \text{null collision}
rate
P νkνmax⁡=νkΔt+O((νmax⁡Δt)2)P\,\frac{\nu_k}{\nu_{\max}} = \nu_k\Delta t + O\big((\nu_{\max}\Delta t)^2\big)
Assumes
  • at most one collision per marker and step, so νmax⁡Δt≪1\nu_{\max}\Delta t \ll 1; warns once when PP exceeds max_collision_probability (0.1)
  • with a NumPy generator the gaps between candidates are geometric(P)(P), the same independent draw per marker at O(candidates); other generators draw one number per marker
  • each candidate draws one neutral velocity w\mathbf w per background and RR uniform in [0,1)[0, 1); the real frequencies use the density factor where the marker is (exact thinning)
  • candidates whose total frequency exceeds νmax⁡(1+10−9)\nu_{\max}(1 + 10^{-9}) are counted in bound_violations and warned about once: their rate is too low
  • FT,bF_{T,b} the largest temperature factor; eight thermal speeds leave about 10−1510^{-15} per component for a faster neutral
References
Built from

collide_now

functionsource

Collide the markers indices (all if None) now, each with a real process.

choice
P(k)=νk(g,x)∑jνj(g,x)P(k) = \frac{\nu_k(g, \mathbf x)}{\sum_j \nu_j(g, \mathbf x)}
Assumes
  • every given marker collides with a real process (no null collision); a draw that rounding leaves above the sum goes to the last process
  • for event-driven transport: the free path is sampled from attenuation outside; raises where the attenuation is zero
Built from

frequency_bound

functionsource

Return nu_max (1/s) valid for relative speeds up to max_relative_speed.

bound
νmax⁡=s∑bFbmax⁡g≤gmax⁡,b∑k∈bnb σk(Ek) g\nu_{\max} = s \sum_b F_b \max_{g \le g_{\max,b}} \sum_{k \in b} n_b\,\sigma_k(E_k)\,g
table
max⁡g≤gmax⁡,bνb(g)≈max⁡(max⁡gi≤gmax⁡,bνb(gi), νb(gmax⁡,b))\max_{g \le g_{\max,b}} \nu_b(g) \approx \max\Big(\max_{g_i \le g_{\max,b}} \nu_b(g_i),\ \nu_b(g_{\max,b})\Big)
Assumes
  • ss = bound_safety (1.02) covers the maxima of a piecewise-linear σ\sigma times gg between grid speeds; 1 is exact for piecewise-constant cross sections
  • the running maximum is tabulated per species and background on 4096 (num_bound_samples) logarithmic speeds from 10−810^{-8} times the speed of the largest table energy, merged with the speeds of every table point and gth(1+10−12)g_\mathrm{th}(1 + 10^{-12}) of every threshold
  • beyond the table every σ\sigma is constant and ν∝g\nu \propto g, which the direct evaluation at gmax⁡,bg_{\max,b} covers
  • with tabulated cross sections νb(gmax⁡,b)\nu_b(g_{\max,b}) is interpolated linearly between the grid speeds (its error between them is the one ss covers) and extended as ν∝g\nu \propto g beyond the grid, exact there; other cross sections are evaluated
  • a sum of per-background bounds bounds the sum; a fixed profile is tabulated at its largest density, a DynamicProfile at the reference density and scaled by its current max_factor FbF_b
Built from

process_frequency

functionsource

Return n sigma(E) g (1/s) for relative speeds g (m/s).

frequency
νk(g,x)=nbfb(x) σk(Ek) g\nu_k(g, \mathbf x) = n_b f_b(\mathbf x)\,\sigma_k(E_k)\,g
lookup energy
Ek=mkg22e,mk={μ=mMm+Mcenter of massmlabE_k = \frac{m_k g^2}{2e}, \qquad m_k = \begin{cases} \mu = \dfrac{mM}{m + M} & \text{center of mass} \\ m & \text{lab} \end{cases}
Assumes
  • process kk on background bb of reference density nbn_b and density profile fbf_b; gg the relative speed
  • without a density factor the largest the background reaches, FbF_b = max_factor: the bound the null-collision method needs

scattering_cosine

functionsource

Return the cosine of the scattering angle for incident energy (eV).

isotropic
cos⁡χ=1−2R\cos\chi = 1 - 2R
vahedi surendra
cos⁡χ=2+E−2(1+E)RE,E in eV\cos\chi = \frac{2 + E - 2(1 + E)^R}{E}, \qquad E \text{ in eV}
okhrimovskyy
cos⁡χ=1−2R(1−ξ)1+ξ(1−2R),ξ=4ϵ1+4ϵ,ϵ=E27.211386 eV\cos\chi = 1 - \frac{2R(1 - \xi)}{1 + \xi(1 - 2R)}, \qquad \xi = \frac{4\epsilon}{1 + 4\epsilon}, \quad \epsilon = \frac{E}{27.211386\ \mathrm{eV}}
Assumes
  • each the inverse of the model's cumulative distribution in cos⁡χ\cos\chi, RR uniform in [0,1)[0, 1)
  • EE clipped at zero; Vahedi-Surendra isotropic below 10−610^{-6} eV; both anisotropic forms clipped to [−1,1][-1, 1]
  • the scattering angle about the incident direction g^\hat{\mathbf g}, at the pre-collision lookup energy; the azimuth uniform
References