The equations of carafe.fluid1d , declared on the code that implements them and checked by the tests.
The condition of one species at one end.
wall Γ o u t = 1 − r 1 + r ( max ( z μ E o u t , 0 ) + s v ˉ ) n , v ˉ = 8 e T π m \Gamma_\mathrm{out} = \frac{1 - r}{1 + r}\Big(\max(z\mu E_\mathrm{out}, 0) + s\,\bar v\Big)\, n, \qquad \bar v = \sqrt{\frac{8 e T}{\pi m}} Γ out = 1 + r 1 − r ( max ( z μ E out , 0 ) + s v ˉ ) n , v ˉ = π m 8 e T wall energy Γ w , o u t = 1 − r 1 + r ( 5 3 max ( z μ E o u t , 0 ) + 4 3 s v ˉ ) w ( 2 T e per thermal electron ) \Gamma_{w,\mathrm{out}} = \frac{1 - r}{1 + r}\Big(\tfrac53\max(z\mu E_\mathrm{out}, 0) + \tfrac43 s\,\bar v\Big)\, w \quad (2 T_e \text{ per thermal electron}) Γ w , out = 1 + r 1 − r ( 3 5 max ( z μ E out , 0 ) + 3 4 s v ˉ ) w ( 2 T e per thermal electron ) density Γ = SG flux between n b and n c e l l over h / 2 , w b = 3 2 n b T b \Gamma = \text{SG flux between } n_b \text{ and } n_\mathrm{cell} \text{ over } h/2, \qquad w_b = \tfrac32 n_b T_b Γ = SG flux between n b and n cell over h /2 , w b = 2 3 n b T b flux Γ i n = value , Γ w , i n = 2 T Γ i n \Gamma_\mathrm{in} = \text{value}, \qquad \Gamma_{w,\mathrm{in}} = 2T\, \Gamma_\mathrm{in} Γ in = value , Γ w , in = 2 T Γ in outflow Γ o u t = v n c e l l , Γ w , o u t = f T e v n c e l l \Gamma_\mathrm{out} = v\, n_\mathrm{cell}, \qquad \Gamma_{w,\mathrm{out}} = f\, T_e\, v\, n_\mathrm{cell} Γ out = v n cell , Γ w , out = f T e v n cell momentum wall Γ o u t = 2 c b + b 2 + 4 a c + s v ˉ n , a = 2 h n , b = e M μ , c = 2 Π h + z e E o u t n M \Gamma_\mathrm{out} = \frac{2c}{b + \sqrt{b^2 + 4ac}} + s\,\bar v\, n, \qquad a = \frac{2}{h n}, \quad b = \frac{e}{M\mu}, \quad c = \frac{2\Pi}{h} + \frac{z e E_\mathrm{out} n}{M} Γ out = b + b 2 + 4 a c 2 c + s v ˉ n , a = hn 2 , b = M μ e , c = h 2Π + M z e E out n Assumes n n n , T T T those of the cell next to the end (T e T_e T e for electrons, T g T_g T g for the rest); a species without a condition has a walls = 1 / 2 s = 1/2 s = 1/2 : the density of the outgoing half-Maxwellian (Hagelaar et al. 2000); s = 1 / 4 s = 1/4 s = 1/4 : a full Maxwellian; the two floating sheaths differ by T e ln 2 T_e \ln 2 T e ln 2 the momentum wall: the half cell's steady momentum balance, nothing coming back (supersonic), Π \Pi Π the momentum flux arriving; zero if c ≤ 0 c \le 0 c ≤ 0 References A plasma between x = 0 and length on cells cells; see the module docstring.
continuity ∂ t n s + ∂ x Γ s = S s , Γ s = z s μ s n s E − D s ∂ x n s \partial_t n_s + \partial_x \Gamma_s = S_s, \qquad \Gamma_s = z_s \mu_s n_s E - D_s \partial_x n_s ∂ t n s + ∂ x Γ s = S s , Γ s = z s μ s n s E − D s ∂ x n s energy ∂ t w + ∂ x Γ w = − Γ e E − P l o s s + P e x t e , w = 3 2 n e T e , Γ w = Γ [ 5 3 μ e , 5 3 D e ] ( w ) \partial_t w + \partial_x \Gamma_w = -\Gamma_e E - P_\mathrm{loss} + \frac{P_\mathrm{ext}}{e}, \qquad w = \tfrac32 n_e T_e, \qquad \Gamma_w = \Gamma[\tfrac53\mu_e, \tfrac53 D_e](w) ∂ t w + ∂ x Γ w = − Γ e E − P loss + e P ext , w = 2 3 n e T e , Γ w = Γ [ 3 5 μ e , 3 5 D e ] ( w ) poisson ∂ x 2 ϕ = − e ε 0 ∑ s z s n s , E = − ∂ x ϕ \partial_x^2 \phi = -\frac{e}{\varepsilon_0}\sum_s z_s n_s, \qquad E = -\partial_x\phi ∂ x 2 ϕ = − ε 0 e s ∑ z s n s , E = − ∂ x ϕ momentum ∂ t Γ + ∂ x Γ 2 n = z e M n E − e T g M ∂ x n − ( ν + L n ) Γ , ν = e M μ \partial_t \Gamma + \partial_x \frac{\Gamma^2}{n} = \frac{z e}{M} n E - \frac{e T_g}{M} \partial_x n - \left(\nu + \frac{L}{n}\right)\Gamma, \qquad \nu = \frac{e}{M\mu} ∂ t Γ + ∂ x n Γ 2 = M z e n E − M e T g ∂ x n − ( ν + n L ) Γ , ν = M μ e losses P l o s s = ∑ R ε e − ∑ S ε s r c P_\mathrm{loss} = \sum R\,\varepsilon_e - \sum S\,\varepsilon_\mathrm{src} P loss = ∑ R ε e − ∑ S ε src grid x i = ( i + 1 2 ) h , E i + 1 / 2 = − ϕ i + 1 − ϕ i h , E i − 1 / 2 − E i + 1 / 2 h + e ρ i ε 0 = 0 x_i = (i + \tfrac12) h, \qquad E_{i+1/2} = -\frac{\phi_{i+1} - \phi_i}{h}, \qquad \frac{E_{i-1/2} - E_{i+1/2}}{h} + \frac{e\rho_i}{\varepsilon_0} = 0 x i = ( i + 2 1 ) h , E i + 1/2 = − h ϕ i + 1 − ϕ i , h E i − 1/2 − E i + 1/2 + ε 0 e ρ i = 0 staggered Γ i + 1 / 2 = u i + 1 / 2 n i + n i + 1 2 , Π i + 1 − Π i h − ν Γ i + 1 / 2 S G + ( ν + L / n ‾ ) Γ i + 1 / 2 = 0 \Gamma_{i+1/2} = u_{i+1/2}\, \frac{n_i + n_{i+1}}{2}, \qquad \frac{\Pi_{i+1} - \Pi_i}{h} - \nu \Gamma^\mathrm{SG}_{i+1/2} + \left(\nu + \overline{L/n}\right)\Gamma_{i+1/2} = 0 Γ i + 1/2 = u i + 1/2 2 n i + n i + 1 , h Π i + 1 − Π i − ν Γ i + 1/2 SG + ( ν + L / n ) Γ i + 1/2 = 0 Order 2 Assumes D = μ T D = \mu T D = μ T unless given (T e T_e T e for electrons, T g T_g T g otherwise); constant transport coefficients; no gas or ion energy equationScharfetter-Gummel fluxes on uniform cells; D e D_e D e on a face with the mean T e T_e T e of its cells; the Joule term the mean of − Γ E -\Gamma E − Γ E on the two faces a momentum ion: its face velocity an unknown, Π = Γ 2 / n ˉ \Pi = \Gamma^2/\bar n Π = Γ 2 / n ˉ upwinded on the cells, its force e / ( M μ ) e/(M\mu) e / ( M μ ) times the SG flux with D = μ T g D = \mu T_g D = μ T g ; without inertia the SG flux exactly L L L the rate of the reactions destroying it (ions born at rest); Poisson's equation needs the Debye length resolvedthe order is that of a steady diffusion problem with held densities (the problem of the tests) References Built from Return the steady state.
backward euler u n + 1 − u n Δ t = F ( u n + 1 ) ( Poisson included ) , then F ( u ) = 0 \frac{u^{n+1} - u^n}{\Delta t} = F(u^{n+1}) \quad (\text{Poisson included}), \qquad \text{then } F(u) = 0 Δ t u n + 1 − u n = F ( u n + 1 ) ( Poisson included ) , then F ( u ) = 0 newton J δ = − r , u = ( ln n s , ln w , u i + 1 / 2 , ϕ ) , J : , j ≈ r ( u + ϵ j e j ) − r ( u − ϵ j e j ) 2 ϵ j , ϵ j = 10 − 6 max ( 1 , ∣ u j ∣ ) J\,\delta = -r, \qquad u = (\ln n_s,\ \ln w,\ u_{i+1/2},\ \phi), \qquad J_{:,j} \approx \frac{r(u + \epsilon_j e_j) - r(u - \epsilon_j e_j)}{2\epsilon_j}, \quad \epsilon_j = 10^{-6}\max(1, |u_j|) J δ = − r , u = ( ln n s , ln w , u i + 1/2 , ϕ ) , J : , j ≈ 2 ϵ j r ( u + ϵ j e j ) − r ( u − ϵ j e j ) , ϵ j = 1 0 − 6 max ( 1 , ∣ u j ∣ ) damping δ ← δ min ( 1 , 2 max ∣ δ ln ∣ ) , converged: ∣ δ ln ∣ < 10 − 10 , ∣ δ l i n ∣ < 10 − 10 ( 1 + max ∣ u ∣ ) \delta \leftarrow \delta\, \min\left(1, \frac{2}{\max |\delta_{\ln}|}\right), \qquad \text{converged: } |\delta_{\ln}| < 10^{-10},\ |\delta_\mathrm{lin}| < 10^{-10}(1 + \max|u|) δ ← δ min ( 1 , max ∣ δ l n ∣ 2 ) , converged: ∣ δ l n ∣ < 1 0 − 10 , ∣ δ lin ∣ < 1 0 − 10 ( 1 + max ∣ u ∣ ) pseudo time Δ t ← growth ⋅ Δ t after a step , Δ t ← Δ t / 4 after a failure \Delta t \leftarrow \text{growth}\cdot\Delta t \text{ after a step}, \qquad \Delta t \leftarrow \Delta t / 4 \text{ after a failure} Δ t ← growth ⋅ Δ t after a step , Δ t ← Δ t /4 after a failure Assumes the Jacobian on a 3-colouring of the cells (a residual depends on its neighbours only), spsolve; at most 30 iterations stops growing once a step of at least max_dt succeeds (at most max_steps), or fails below 10 − 6 10^{-6} 1 0 − 6 of the first step with a momentum species the upwinded Π \Pi Π reaches two cells, which the colouring misses: only the convergence rate can suffer The Scharfetter-Gummel flux from left to right, a distance apart.
flux Γ i + 1 / 2 = D h ( B ( − P e ) n i − B ( P e ) n i + 1 ) , P e = z μ E h D , B ( x ) = x e x − 1 \Gamma_{i+1/2} = \frac{D}{h}\Big(B(-\mathrm{Pe})\, n_i - B(\mathrm{Pe})\, n_{i+1}\Big), \qquad \mathrm{Pe} = \frac{z \mu E h}{D}, \qquad B(x) = \frac{x}{e^x - 1} Γ i + 1/2 = h D ( B ( − Pe ) n i − B ( Pe ) n i + 1 ) , Pe = D z μ E h , B ( x ) = e x − 1 x series B ( x ) = 1 − x 2 + x 2 12 − x 4 720 ( ∣ x ∣ < 10 − 3 ) B(x) = 1 - \frac{x}{2} + \frac{x^2}{12} - \frac{x^4}{720} \quad (|x| < 10^{-3}) B ( x ) = 1 − 2 x + 12 x 2 − 720 x 4 ( ∣ x ∣ < 1 0 − 3 ) drift only Γ = z μ E n u p w i n d ( D = 0 ) \Gamma = z\mu E\, n_\mathrm{upwind} \quad (D = 0) Γ = z μ E n upwind ( D = 0 ) Order 2 Assumes exact for a constant flux and field between the two points, so a steady state has no artificial diffusion the series below ∣ x ∣ = 10 − 3 |x| = 10^{-3} ∣ x ∣ = 1 0 − 3 is exact to round-off; a shorter one errs by x 2 / 12 x^2/12 x 2 /12 , noise in a finite-difference Jacobian the order is that of the face flux of a smooth profile in a varying field References