feat(vfp2d): couple ion hydro and kinetic-electron pressure - #347
Draft
joglekara wants to merge 7 commits into
Draft
feat(vfp2d): couple ion hydro and kinetic-electron pressure#347joglekara wants to merge 7 commits into
joglekara wants to merge 7 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Field-solver hierarchy
maxwellremains the physical fully explicit Vlasov-Maxwell mode.ampereuses a configurablerelative_permittivity >= 1to divide the complete Ampere residual. This slows the light and plasma frequencies bysqrt(relative_permittivity)without changing the steady targetJ = c^2 curl(B). Its saved electric-field energy uses the corresponding permittivity weight.oshun-implicitadvances Faraday explicitly, constructs the local discrete 3x3 kinetic responsedJ_i/dE_j, and directly solves for the electric field that makes the updated distribution satisfyJ = c^2 curl(B). It updates the full harmonic distribution through the Vlasov force operator rather than projectingf1.kinetic-ohmremains the long-timescale algebraic closure used by the moving-ion path.The OSHUN-style mode is an implicit kinetic-current response, not a fully implicit Maxwell solve. It and the slowed-Ampere mode are currently stationary-ion capabilities; moving-ion coupling remains restricted to kinetic Ohm. The implicit mode is also intentionally rejected under spatial sharding until a distributed response solve is validated.
Saved outputs now include the Ampere target current, pointwise residual, residual Linf history, magnetic field energy, solver mode, and relative permittivity. Explicit modes additionally save electric and total electromagnetic field energy.
Nonlinear energy gate
The coupled map is now the symmetric composition
The kinetic-Ohm Ampere projection changes only
f1, but in a moving ion frame that changes lab-frame electron energy byu_i . Delta p_e. Runs now accumulate that projection work explicitly and save bothtotal_energyandaccounted_total_energy = total_energy - current_projection_energy. A direct unit test compares the ledger to the independently measured lab-frame energy jump.The nonlinear periodic benchmark evolves nonuniform electron density and temperature, accelerates the ions through the full
f0 + f2electron pressure, and generates magnetic field. Its declared accounted-energy tolerance is3.1e-9:dt = 2e-3, 1e-3, 5e-4;nv = 24tonv = 96; andnx = 6tonx = 12.Gate 0b benchmarks
1e5strong-shock tubes are compared with an exact Euler Riemann solution on both coordinate axes; normalized L1 tolerances are 3.5% and 12%, respectively.2e-12absolute tolerance.Physics demonstrated
u_i = 0f0plus tracelessf2electron pressure and equal-and-opposite pressure workZ*response recovering the analytic Spitzer-HarmT^(5/2)heat-flux coefficientf2, rigid-rotation, and accelerating-frame checksExplicit boundary
This remains a draft and is not ready for production parameter scans. Moving-ion production is still periodic, nonrelativistic, unsharded, kinetic-Ohm, and quasineutral.
ElectronIonExchangeremains a weak-drift moment model rather than a full finite-mass Landau operator. Nonperiodic coupled boundaries and production-scale validation remain future gates.Verification
uv run pytest -q tests/test_vfp2d-- 72 passedtest-vfp2d-- 72 passeduvx ruff checkon all touched solver and test files -- passeduvx ruff format --checkon all touched solver and test files -- passedgit diff --check-- passedThe earlier repository-wide non-slow run was interrupted after 7 passing tests because the existing
test_reuse_config_dictpath remained inurllib3network retry for four minutes. The complete relevant VFP2D suite is green.