Repository navigation
v0.0.3
New features
Fieldhas a new optional attributeg_sup_rr, the radial metric element
|grad(rho)|^2. It is computed automatically when loading from DESC, VMEC,
booz_xformand IPP.bcfiles, and can be passed toFieldand
Field.from_boozerdirectly.- New
DKESolutionoutputs:"<momentum_flux>": radial flux of parallel momentum times field strength."Phi_1": variation of the electrostatic potential on the surface from
quasi-neutrality."n1","n","p1","p": density and pressure perturbations and
totals on the surface, with the totals including the Boltzmann response to
Phi_1."<classical_particle_flux>"and"<classical_heat_flux>": classical
transport fluxes, including the effect ofPhi_1. The Coulomb logarithm can
be overridden with thecoulomb_logkeyword."Vperp","V^theta","V^zeta": perpendicular (diamagnetic and ExB)
flow, and the contravariant poloidal and toroidal components of the total flow.
Vperpand the classical fluxes requireField.g_sup_rr.
- New smoothers, including a theta/zeta plane smoother using surface averaged wind
and fast diagonalization via a 2d Fourier transform, and theta/zeta line smoothers retaining coupling
between the L0 and L1 Legendre modes in pitch to damp errors that are not smoothed
by collisions. - The multigrid option
smooth_typeis now a comma separated string listing the
smoothers to apply and their order, for both the DKE and MDKE. The new defaults are
"plane,s,x,a,l01t,l01z"for the DKE (the frozen plane, block-Jacobi lines in
species, speed and pitch, and new"l01t"and"l01z"theta and zeta line
smoothers acting on the lowest two Legendre moments in pitch) and"plane,a,t,z"
for the MDKE (the frozen plane and pitch, theta and zeta lines). The previous integer
values are no longer accepted. See the tuning guide. - The multigrid option
smooth_weightscan now be a dict mapping entries of
smooth_typeto their relaxation weight, with the other smoothers using their
defaults. A single value now applies to every smoother. - The recycled Krylov subspace
info["U"],info["C"]returned bysolve_dke
andDKESolution.f1_krylovare now tuples of the parts forf1and for the
source terms, rather than single stacked arrays. TheUandf1warm start
options ofsolve_dkeaccept either form. solve_dkenow stops once the remaining residual is at the level that rounding
error in the matrix-vector product can explain. At very high collisionality the large
pitch angle scattering frequency at the lowest speed nodes limits the attainable
residual, and the solve previously ran tomaxiterand reported failure even
though the solution was as accurate as it could be.- New
solve_dkeoptionfluid_correction(defaultTrue) that combines the
multigrid preconditioner with an exact correction of the density, energy and parallel
momentum of each species at every point on the flux surface. This makes the solve
much more robust at high collisionality, often cutting the number of iterations by
5-10x for less than 2% extra cost per iteration. Each species' correction is weighted
smoothly from 0 at low collisionality to 1 at high collisionality, and the correction
is skipped entirely when no species is collisional. solve_dkeandsolve_dke_ambipolartake a newmeshargument, a
jax.sharding.Meshwith axes"species"and/or"speed", to split a single
solve across several devices and reduce the memory needed on each. See the
"Multiple devices" section of the performance docs.
Performance improvements
- The DKE multigrid preconditioner no longer fixes the density and energy gauge by
replacing equations at a grid point. The levels keep the null space of the DKE, and
the direct solve on the coarsest level shifts it away from zero instead. This
removes nearly singular coarse modes that slowed or stalled convergence at low
collisionality, and reduces the number of iterations on most problems. The point
gauge is still available with the multigrid optiongauge=True. - The direct solve on the coarsest multigrid level now applies a step of iterative
refinement against the coarse operator, removing most of the error left by the LU
factorization of badly scaled multispecies coarse matrices. - All smoothers on a multigrid level are now built from a single shared operator,
reducing the compile time of the preconditioner by about a third. - Reduced rounding error in the pitch angle scattering operator, which at high
collisionality could act as a large spurious sink of isotropic (density and energy)
perturbations. - The Fokker-Planck collision operator no longer includes the flux surface averaged
exchange of density and energy between species (the equilibration of the background
Maxwellian temperatures). This happens over the slower transport timescale and
doesn't belong in the DKE. Removing it puts each species' surface-constant density
and temperature perturbations in the null space of the operator, which makes
convergence much smoother at high collisionality. The local exchange between
species' temperature perturbations is kept, because it sets the fluxes at high
collisionality, so fluxes are unaffected.
Bug fixes
- The field particle collision operators now project from pitch nodes to Legendre
modes with a weighted Galerkin projection rather than an unweighted least squares
fit, so the density and energy moments match the pitch quadrature used elsewhere and
unresolved high order modes are not mixed into the low order ones.
Full Changelog: v0.0.2...v0.0.3