Skip to content

Dougherty: Francisquez LBO-G cross-species moments (dougherty_g, beta) - #73

Open
rogeriojorge wants to merge 65 commits into
feature/dougherty-collisionsfrom
feature/dougherty-francisquez-g
Open

rogeriojorge wants to merge 65 commits into
feature/dougherty-collisionsfrom
feature/dougherty-francisquez-g

Conversation

@rogeriojorge

Copy link
Copy Markdown
Member

Compares #71 with Francisquez, Juno, Hakim, Hammett, Ernst, JPP 88, 905880303 (arXiv:2109.10381).

  • Conservative Dougherty collision operator in the moving Hermite basis #71 default = their LBO-EM (eqs 2.18-2.20): u_sr=(U_s+U_r)/2, common T_sr, m_s n_s nu_sr = m_r n_r nu_rs. With nu_sr = alpha_E(m_s+m_r)/(m_s n_s) it matches the Morse momentum rate exactly, but its temperature-difference rate is 2x Morse (mass-ratio independent).
  • Adds opt-in collision_model="dougherty_g" (TOML cross_species="francisquez_g", beta=...): their LBO-G (eqs 2.8-2.9, delta_s=1). beta=0 matches both Morse rates and conserves momentum/energy exactly.
  • Default path unchanged bitwise.

Tests: conservation (pair and spectral, round-off), eq 2.8/2.9 formulas, Morse rates (EM = 2x, G = 1x), end-to-end temperature relaxation at the Morse rate, TOML.

…ectrum exposed

filter_spectrum(Nn, Nm, Np, order, keep=2) gives s(n) = (n/(N-1))**order for n > keep, summed over
axes; exponential_filter(Ck, strength, s) applies exp(-strength*s) between steps (zero strength is
bitwise identity). Passed as collision_matrix with nu = rate it is the equivalent RHS damping.
Moments of total degree <= 2 are untouched for any basis.
A [species.<name>] table with charge, mass, density, vth, drift and an optional density perturbation replaces hand-built Hermite-Fourier coefficients. The electric field solves Gauss's law, and Ns, qs, Omega_cs, alpha_s and u_s follow from the species. Old-style TOML files are unchanged.
plot(output) shows the field and kinetic energy exchange, energy conservation, the strongest field modes, the Hermite spectrum of each species over time, the phase-space perturbation of each species and, in 2D, the field in the plane. The CLI saves input.png next to the TOML. diagnostics now also returns electric_energy and magnetic_energy.
Landau damping and two-stream are described entirely in their TOML files and run with spectrax input.toml; their scripts shrink to a few lines. The growth- and damping-rate scans reuse those files through load_parameters overrides, so two duplicated TOML files and their index arithmetic go away.
With adaptive_time_step=False and many saves on step ends, Diffrax 0.7.2
RecursiveCheckpointAdjoint gives gradients a few percent off (2.5% for 201
saves at dt = 0.01). Add a strict-xfail regression test against ForwardMode,
a passing test of the exact workaround (checkpoints = max_steps) and a
docstring warning.
ode_rtol and ode_atol default to ode_tolerance, so existing runs are bitwise
unchanged. FlooredPIDController adds an absolute error floor per state
component (pytree, None = no floor) so round-off far below a component's own
scale cannot drive the step size; floor=None is exactly PIDController.
twothirds_mask and rfft_weights alias the internal functions so companion
codes and user diagnostics need not import private names.
…ugherty_g)

#71's default is the LBO-EM form (momentum rate matches Morse, temperature-difference rate 2x Morse).
LBO-G with beta=0 matches both; opt-in, default unchanged bitwise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant