fokker_planck_test
moment_kinetics.fokker_planck_test
— ModuleModule for including functions used in testing the implementation of the the full-F Fokker-Planck collision operator.
moment_kinetics.fokker_planck_test.Cflux_vpa_Maxwellian_inputs
— MethodCalculates the collisional flux $\Gamma_\|$ given Maxwellian input $F_s$ and $F_{s^\prime}$. The input Maxwellians are specified through their moments.
moment_kinetics.fokker_planck_test.Cflux_vperp_Maxwellian_inputs
— MethodCalculates the collisional flux $\Gamma_\perp$ given Maxwellian input $F_s$ and $F_{s^\prime}$. The input Maxwellians are specified through their moments.
moment_kinetics.fokker_planck_test.Cssp_Maxwellian_inputs
— MethodCalculates the fully expanded form of the collision operator $C_{s s^\prime}[F_s,F_{s^\prime}]$ given Maxwellian input $F_s$ and $F_{s^\prime}$. The input Maxwellians are specified through their moments.
moment_kinetics.fokker_planck_test.Cssp_fully_expanded_form
— MethodFunction calculating the fully expanded form of the collision operator taking as arguments the derivatives of $F_s$, $G_{s^\prime}$ and $H_{s^\prime}$. This function is designed to be used at the lowest level of a coordinate loop, with derivatives and integrals all previously calculated.
moment_kinetics.fokker_planck_test.F_Maxwellian
— MethodFunction computing $ F_{\rm Maxwellian} $.
moment_kinetics.fokker_planck_test.G_Maxwellian
— MethodFunction computing G, defined by
\[\nabla^4 G = -\frac{8}{\sqrt{\pi}} F \]
with
\[F = c_{\rm ref}^3 \pi^{3/2} F_{\rm Maxwellian} / n_{\rm ref} \]
the normalised Maxwellian. See Plasma Confinement, R. D. Hazeltine & J. D. Meiss, 2003, Dover Publications, pg 184, Chpt 5.2, Eqn (5.49).
moment_kinetics.fokker_planck_test.H_Maxwellian
— MethodFunction computing H, defined by
\[\nabla^2 H = -\frac{4}{\sqrt{\pi}} F \]
with
\[F = c_{\rm ref}^3 \pi^{3/2} F_{\rm Maxwellian} / n_{\rm ref} \]
the normalised Maxwellian. See Plasma Confinement, R. D. Hazeltine & J. D. Meiss, 2003, Dover Publications, pg 184, Chpt 5.2, Eqn (5.49).
moment_kinetics.fokker_planck_test.calculate_collisional_fluxes
— MethodCalculates the collisional fluxes given input $F_s$ and $G_{s^\prime}$, $H_{s^\prime}$.
moment_kinetics.fokker_planck_test.d2Fdvpa2_Maxwellian
— MethodFunction computing
\[\frac{\partial^2 F}{\partial v_\|^2}\]
for $ F = F_{\rm Maxwellian}$.
moment_kinetics.fokker_planck_test.d2Fdvperp2_Maxwellian
— MethodFunction computing
\[\frac{\partial^2 F}{\partial v_\perp^2}.\]
for $ F = F_{\rm Maxwellian}$.
moment_kinetics.fokker_planck_test.d2Fdvperpdvpa_Maxwellian
— MethodFunction computing
\[\frac{\partial^2 F}{\partial v_\perp \partial v_\|}\]
for $ F = F_{\rm Maxwellian}$.
moment_kinetics.fokker_planck_test.d2Gdvpa2_Maxwellian
— MethodFunction computing
\[\frac{\partial^2 G }{ \partial v_\|^2}\]
for Maxwellian input. See G_Maxwellian()
.
moment_kinetics.fokker_planck_test.d2Gdvperp2_Maxwellian
— MethodFunction computing
\[\frac{\partial^2 G}{\partial v_\perp^2}\]
for Maxwellian input. See G_Maxwellian()
.
moment_kinetics.fokker_planck_test.d2Gdvperpdvpa_Maxwellian
— MethodFunction computing
\[\frac{\partial^2 G}{\partial v_\perp \partial v_\|}\]
for Maxwellian input. See G_Maxwellian()
.
moment_kinetics.fokker_planck_test.dFdvpa_Maxwellian
— MethodFunction computing
\[\frac{\partial F}{\partial v_\|}\]
for $ F = F_{\rm Maxwellian}$.
moment_kinetics.fokker_planck_test.dFdvperp_Maxwellian
— MethodFunction computing
\[\frac{\partial F}{\partial v_\perp}\]
for $ F = F_{\rm Maxwellian}$.
moment_kinetics.fokker_planck_test.dGdvperp_Maxwellian
— MethodFunction computing
\[\frac{\partial G}{\partial v_\perp}\]
for Maxwellian input. See G_Maxwellian()
.
moment_kinetics.fokker_planck_test.dHdvpa_Maxwellian
— MethodFunction computing
\[\frac{\partial H}{\partial v_\|}\]
for Maxwellian input. See H_Maxwellian()
.
moment_kinetics.fokker_planck_test.dHdvperp_Maxwellian
— MethodFunction computing
\[\frac{\partial H}{\partial v_\perp}\]
for Maxwellian input. See H_Maxwellian()
.
moment_kinetics.fokker_planck_test.eta_func
— MethodFunction computing the normalised speed variable
\[\eta = \frac{\sqrt{(v_\| - u_\|)^2 + v_\perp^2}}{v_{\rm th}}\]
with $v_{\rm th} = \sqrt{2 p / n m}$ the thermal speed, and $p$ the pressure, $n$ the density and $m$ the mass.
moment_kinetics.fokker_planck_test.print_test_data
— MethodFunction to print the maximum error ${\rm MAX}(|f_{\rm numerical}-f_{\rm exact}|)$.
moment_kinetics.fokker_planck_test.print_test_data
— MethodFunction to print the maximum error ${\rm MAX}(|f_{\rm numerical}-f_{\rm exact}|)$ and the $L_2$ norm of the error
\[\sqrt{\int (f - f_{\rm exact})^2 v_\perp d v_\perp d v_\|/\int v_\perp d v_\perp d v_\|}.\]
moment_kinetics.fokker_planck_test.save_fkpl_error_data
— MethodUtility function that saves error data to a HDF5 file for later use.
moment_kinetics.fokker_planck_test.save_fkpl_integration_error_data
— MethodUtility function that saves error data to a HDF5 file for later use.