Skip to content
Projects

Charge changes

The equations of beamtracer.solver.charge_changing, declared on the code that implements them and checked by the tests.

AxialProfile

classsource

A target density (m^-3) along x (m), linear between the points.

profile
n(x)=ni+x−xixi+1−xi(ni+1−ni),xi≤x≤xi+1;n(x)=n0, nlast beyondn(x) = n_i + \frac{x - x_i}{x_{i+1} - x_i} (n_{i+1} - n_i), \quad x_i \le x \le x_{i+1}; \qquad n(x) = n_0,\ n_\mathrm{last} \text{ beyond}
line density
∫abn dx=the trapezoidal rule on a, the points inside (a,b),b(exact)\int_a^b n\, dx = \text{the trapezoidal rule on } a, \text{ the points inside } (a, b), b \quad \text{(exact)}
Assumes
  • at least two points, increasing xx, densities ≥0\ge 0
  • in the tracer the density is taken at the midpoint of each step, as if uniform over it

ChargeChanging

classsource

The targets a beam changes charge on, and how its trajectories follow the changes.

master
dFds=∑tnt(x) Mt F,(Mt)js=σt(s→j),(Mt)ss=−∑j≠sσt(s→j)\frac{d\mathbf F}{ds} = \sum_t n_t(x)\, M_t\, \mathbf F, \qquad (M_t)_{js} = \sigma_t(s \to j), \quad (M_t)_{ss} = -\sum_{j \ne s} \sigma_t(s \to j)
force
qˉ=e∑szsFs (fractions),q=e zs (analog)\bar q = e \sum_s z_s F_s \ \text{(fractions)}, \qquad q = e\, z_s \ \text{(analog)}
current
Nk=∣Ik∣e in every state,ΔQ=Nk e∑szsFˉs ΔtN_k = \frac{|I_k|}{e} \ \text{in every state}, \qquad \Delta Q = N_k\, e \sum_s z_s \bar F_s\, \Delta t
Assumes
  • F\mathbf F the fractions of a trajectory over the states ss of charge zsz_s (default -, 0, +), ss the path length, MtM_t from plasmacoll.ChargeStateTransitions
  • fractions mode: a trajectory feels the force of its mean charge, so states do not part where the field would separate them (fine in a weak field, as in a neutralizer; not in a residual-ion dump or inside an accelerator)
  • analog mode: one state per trajectory, changed at sampled events; the mean over trajectories is the fractions mode
  • a trajectory starting with ∣z∣≠1|z| \ne 1 counts Nk=∣Ik∣/eN_k = |I_k| / e as if ∣z∣=1|z| = 1
References
  • plasmacoll ChargeStateTransitions, charge_state_fractions
Built from

advance

functionsource

The fractions (states, N) after the steps of line densities lines, third order.

taylor
F←F+MF+12M2F+16M3F,M=∑tnt(x1/2) Δs Mt\mathbf F \leftarrow \mathbf F + M \mathbf F + \tfrac12 M^2 \mathbf F + \tfrac16 M^3 \mathbf F, \qquad M = \sum_t n_t(x_{1/2})\, \Delta s\, M_t
conservation
∑s(Mt)sj=0⇒∑sFs=const\sum_s (M_t)_{s j} = 0 \quad \Rightarrow \quad \sum_s F_s = \text{const}
Order
3
Assumes
  • the third-order Taylor polynomial of eMe^{M} per step; the densities at the step's midpoint, uniform over the step
  • the order is in the line density per step nΔsn \Delta s

sample

functionsource

Use up the optical depth of one step and sample the events where it runs out.

rate
λs(x)=∑tnt(x)∑j≠sσt(s→j)\lambda_s(x) = \sum_t n_t(x) \sum_{j \ne s} \sigma_t(s \to j)
depth
τ∼Exp(1),τ←τ−λsΔs,an event where τ≤0, at the share 1+τλsΔs of the step\tau \sim \mathrm{Exp}(1), \qquad \tau \leftarrow \tau - \lambda_s \Delta s, \qquad \text{an event where } \tau \le 0, \text{ at the share } 1 + \frac{\tau}{\lambda_s \Delta s} \text{ of the step}
channel
P(t,j)=nt σt(s→j)λsP(t, j) = \frac{n_t\, \sigma_t(s \to j)}{\lambda_s}
splitting
at each of the first events: k trajectories of I/k, drawing their new states independently\text{at each of the first events: } k \text{ trajectories of } I / k, \text{ drawing their new states independently}
Assumes
  • the probability of no event over a path is exp⁡(−∫λs ds)\exp(-\int \lambda_s\, ds), so the depth of the event is Exp(1)\mathrm{Exp}(1) in ∫λs ds\int \lambda_s\, ds
  • several events per step followed in turn, each new state using up the rest of the step; the force changes from the next step on
  • random numbers from seed and the MPI rank, afresh on every trace, so the Vlasov iteration has a fixed point

ChargeTallies

classsource

What the beam did to its targets, summed over trajectories (see the module docstring).

path
paths=∑kNk∫Fs,k ds\text{path}_s = \sum_k N_k \int F_{s,k}\, ds
changes
changest,s→j=σt(s→j)∑kNk∫Fs,k nt ds\text{changes}_{t, s \to j} = \sigma_t(s \to j) \sum_k N_k \int F_{s,k}\, n_t\, ds
ionization
ionizationt,s=σt,sion∑kNk∫Fs,k nt ds\text{ionization}_{t, s} = \sigma^\mathrm{ion}_{t, s} \sum_k N_k \int F_{s,k}\, n_t\, ds
Assumes
  • in particles per second (per metre of depth in planar geometry); the integrals summed step by step with the mean fractions Fˉ\bar F of each step
  • the ionization cross sections are tallied only: they do not change the beam
  • analog mode also sums the sampled events, whose mean is changes

conductance_profile

functionsource

Return the gas density through a stack of grid apertures in free-molecular flow.

drops
Δni=(nup−ndown)1/(ai2Ki)∑j1/(aj2Kj),Ki=11+3li/(8ai)\Delta n_i = (n_\mathrm{up} - n_\mathrm{down}) \frac{1 / (a_i^2 K_i)}{\sum_j 1 / (a_j^2 K_j)}, \qquad K_i = \frac{1}{1 + 3 l_i / (8 a_i)}
flow
Q=Ci Δni,Ci=vˉ4πai2KiQ = C_i\, \Delta n_i, \qquad C_i = \frac{\bar v}{4} \pi a_i^2 K_i
Assumes
  • free-molecular flow through round apertures of radius aia_i and length lil_i; one flow QQ through all of them, so the mean speed vˉ\bar v cancels
  • uniform density in the gaps between the grids (no pumping across them), linear through each aperture
  • KiK_i Dushman's approximation of Clausing's transmission probability
References
  • S. Dushman, Scientific Foundations of Vacuum Technique (Wiley)