fokker_planck
moment_kinetics.fokker_planck
— ModuleModule for including the Full-F Fokker-Planck Collision Operator.
The functions in this module are split into two groups.
The first set of functions implement the weak-form Collision operator using the Rosenbluth-MacDonald-Judd formulation in a divergence form. The Green's functions for the Rosenbluth potentials are used to obtain the Rosenbluth potentials at the boundaries. To find the potentials everywhere else elliptic solves of the PDEs for the Rosenbluth potentials are performed with Dirichlet boundary conditions. These routines provide the default collision operator used in the code.
The second set of functions are used to set up the necessary arrays to compute the Rosenbluth potentials everywhere in vpa, vperp by direct integration of the Green's functions. These functions are supported for the purposes of testing and debugging.
Lower-level routines are provided by functions from moment_kinetics.fokker_planck_calculus
.
Parallelisation of the collision operator uses a special 'anyv' region type, see Collision operator and anyv
region.
moment_kinetics.fokker_planck.allocate_fokkerplanck_arrays_direct_integration
— MethodFunction that allocates the required ancilliary arrays for direct integration routines.
moment_kinetics.fokker_planck.conserving_corrections!
— MethodFunction that applies numerical-error correcting terms to ensure numerical conservation of the moments density, upar, pressure
in the self-collision operator. Modifies the collision operator such that the operator becomes
\[C_{ss} = C^\ast_{ss}[F_s,F_{s}] - \left(x_0 + x_1(v_{\|}-u_{\|})+ x_2(v_\perp^2 +(v_{\|}-u_{\|})^2)\right)F_s\]
where $C^\ast_{ss}[F_s,F_{s}]$ is the weak-form self-collision operator computed using the finite-element implementation, $u_{\|}$ is the parallel velocity of $F_s$, and $x_0,x_1,x_2$ are parameters that are chosen so that $C_{ss}$ conserves density, parallel velocity and pressure of $F_s$.
moment_kinetics.fokker_planck.density_conserving_correction!
— MethodFunction that applies a numerical-error correcting term to ensure numerical conservation of the density
in the collision operator.
\[C_{ss^\prime} = C^\ast_{ss}[F_s,F_{s^\prime}] - x_0 F_s\]
where $C^\ast_{ss}[F_s,F_{s^\prime}]$ is the weak-form collision operator computed using the finite-element implementation.
moment_kinetics.fokker_planck.explicit_fokker_planck_collisions_weak_form!
— MethodFunction for advancing with the explicit, weak-form, self-collision operator.
moment_kinetics.fokker_planck.explicit_fp_collisions_weak_form_Maxwellian_cross_species!
— MethodFunction for advancing with the explicit, weak-form, self-collision operator using the existing method for computing the Rosenbluth potentials, with the addition of cross-species collisions against fixed Maxwellian distribution functions where the Rosenbluth potentials are specified using analytical results.
moment_kinetics.fokker_planck.fokker_planck_collision_operator_weak_form!
— MethodFunction for evaluating $C_{ss'} = C_{ss'}[F_s,F_{s'}]$
The result is stored in the array fkpl_arrays.CC
.
The normalised collision frequency for collisions between species s and s' is defined by
\[\tilde{\nu}_{ss'} = \frac{L_{\mathrm{ref}}}{c_{\mathrm{ref}}}\frac{\gamma_{ss'} n_\mathrm{ref}}{m_s^2 c_\mathrm{ref}^3}\]
with $\gamma_{ss'} = 2 \pi (Z_s Z_{s'})^2 e^4 \ln \Lambda_{ss'} / (4 \pi \epsilon_0)^2$. The input parameter to this code is
\[\tilde{\nu}_{ii} = \frac{L_{\mathrm{ref}}}{c_{\mathrm{ref}}}\frac{\gamma_\mathrm{ref} n_\mathrm{ref}}{m_\mathrm{ref}^2 c_\mathrm{ref}^3}\]
with $\gamma_\mathrm{ref} = 2 \pi e^4 \ln \Lambda_{ii} / (4 \pi \epsilon_0)^2$. This means that $\tilde{\nu}_{ss'} = (Z_s Z_{s'})^2\tilde{\nu}_\mathrm{ref}$ and this conversion is handled explicitly in the code with the charge number input provided by the user.
moment_kinetics.fokker_planck.fokker_planck_collision_operator_weak_form_Maxwellian_Fsp!
— MethodFunction for computing the collision operator
\[\sum_{s^\prime} C[F_{s},F_{s^\prime}]\]
when $F_{s^\prime}$ is an analytically specified Maxwellian distribution and the corresponding Rosenbluth potentials are specified using analytical results.
moment_kinetics.fokker_planck.init_fokker_planck_collisions_direct_integration
— MethodFunction that initialises the arrays needed to calculate the Rosenbluth potentials by direct integration. As this function is only supported to keep the testing of the direct integration method, the struct 'fka' created here does not contain all of the arrays necessary to compute the weak-form operator. This functionality could be ported if necessary.
moment_kinetics.fokker_planck.init_fokker_planck_collisions_weak_form
— MethodFunction that initialises the arrays needed for Fokker Planck collisions using numerical integration to compute the Rosenbluth potentials only at the boundary and using an elliptic solve to obtain the potentials in the rest of the velocity space domain.
moment_kinetics.fokker_planck.setup_fkpl_collisions_input
— MethodFunction for reading Fokker Planck collision operator input parameters. Structure the namelist as follows.
[fokker_planck_collisions]
use_fokker_planck = true
nuii = 1.0
frequency_option = "manual"
moment_kinetics.fokker_planck.symmetric_matrix_inverse
— MethodFunction that solves A x = b
for a matrix of the form
\[\begin{array}{ccc} A_{00} & 0 & A_{02} \\ 0 & A_{11} & A_{12} \\ A_{02} & A_{12} & A_{22} \\ \end{array}\]
appropriate for the moment numerical conserving terms used in the Fokker-Planck collision operator.
moment_kinetics.fokker_planck.symmetric_matrix_inverse
— MethodFunction that solves A x = b
for a matrix of the form
\[\begin{array}{ccc} A_{00} & A_{01} & A_{02} \\ A_{01} & A_{11} & A_{12} \\ A_{02} & A_{12} & A_{22} \\ \end{array}\]
appropriate for moment numerical conserving terms.