Overview¶
NEOPAX is a JAX-native stellarator transport package built around modular flux, source, geometry, and solver components. It is designed to support both physics studies and numerical experimentation without forcing all workflows through a single monolithic execution path.
At a high level, NEOPAX can be used as:
a predictive 1D radial transport solver
an ambipolarity root-finding tool for \(E_r\)
a flux-evaluation driver on fixed profiles
a source-evaluation driver on fixed profiles
The active runtime entry points are selected through mode in the input
configuration:
transportambipolarityfluxessources
Capabilities And Advantages¶
NEOPAX currently offers the following strengths.
JAX-native execution - the main transport, ambipolarity, source, and flux pathways operate on
JAX arrays and are compatible with JIT-oriented workflows
Modular physics composition - neoclassical, turbulent, and classical transport contributions are composed
through a shared flux-model interface
Multiple solver backends - Diffrax backends, a custom Radau solver, and theta-based implicit solvers
are all available through the same runtime orchestration layer
Boundary-aware finite-volume transport - transport equations are assembled from cell-centered profiles with explicit
face reconstruction and boundary-condition handling
Ambipolarity workflow integrated with transport - the package supports both standalone ambipolarity runs and ambipolar
initialization inside transport calculations
Registry-driven model selection - flux models and source models are selected from registries rather than
hard-coded branches scattered through the solver
Practical diagnostics and output modes - NEOPAX supports plots, HDF5 outputs, debug summaries, and comparison
against reference profiles
Equations Solved¶
NEOPAX solves a flux-surface-averaged 1D transport system for densities, pressures, and optionally the radial electric field. The underlying transport equations have the conservative form
In the radial 1D representation used by NEOPAX, the conservative operator is written as
With this notation:
The particle and heat fluxes are decomposed as
For the full mathematical description of the transport equations and the built-in flux models, see Transport Physics And Flux Models.
Algorithms And Numerical Methods¶
Spatial discretization¶
NEOPAX uses a radial finite-volume discretization based on:
cell-centered state profiles on
r_gridface-centered fluxes on
r_grid_halfconservative divergence assembly using
VprimeandVprime_half
Depending on the equation and reconstruction settings, NEOPAX can use:
reconstructed face fluxes from cell-centered model outputs
face-flux closures supplied directly by the transport model
NTSS-like face state construction
ghost-cell-aware boundary reconstruction
Time integration¶
The active solver backends currently include:
thetatheta_newtonradauDiffrax backends such as
diffrax_kvaerno5
The custom Radau implementation is a fixed-stage Radau IIA collocation method with Newton stage solves, embedded error control, and optional lagged-response RHS modes.
For a solver-focused description, see Solver Backends.
Ambipolarity algorithms¶
The ambipolarity subsystem supports:
initialization of ambipolar best roots for transport startup
standalone radial root solving in
mode = "ambipolarity"local particle-flux evaluators to reduce the cost of repeated \(E_r\) evaluation
multiple initializer and branch-tracking pathways inside
NEOPAX/_ambipolarity.py
Flux Models¶
Flux models are assembled through the transport-flux registry in
NEOPAX/_transport_flux_models.py. The main runtime pattern is:
build one neoclassical model
build one turbulent model
optionally build one classical model
combine them through
CombinedTransportFluxModel
This gives a unified interface returning species-resolved particle and heat fluxes, with optional face-flux evaluation support.
For the mathematical structure of the NTX/NTSS-inspired neoclassical models and the built-in turbulent closures, see Transport Physics And Flux Models.
Built-in transport flux models¶
The currently registered transport flux models include:
ntx_database- database-driven neoclassical modelntx_scan_runtime- on-the-fly NTX monoenergetic scan built from VMEC/Boozer inputs and TOML scan gridsntx_database_with_momentum- database-driven neoclassical model with momentum-correction pathwayturbulent_analytical- analytical turbulent transport modelturbulent_power_analytical- analytical turbulent transport model normalized to total powerntss_power_over_n- power-normalized analytical turbulent model aligned with NTSS-style usagefluxes_r_file- fluxes loaded from a radial profile filenone- zero-flux model
Important architectural points¶
neoclassical, turbulent, and classical contributions are kept separate until composition
face-flux evaluation is supported explicitly for transport assembly
turbulent particle transport can be disabled independently of turbulent heat transport in the combined model
Source Models¶
Source models are assembled through the registry in
NEOPAX/_source_models.py. Density and temperature equations consume source
models through a shared component-assembly pathway.
Built-in source models¶
The currently registered source models include:
fusion_power_fraction_electronsdt_reactionpower_exchangebremsstrahlung_radiationanalyticexample_state
The source framework also supports CombinedSourceModel, which merges
multiple named source contributions into one model output.
Current source handling features¶
density-source assembly by named component
pressure-source assembly by named component
species-aware component routing
active-temperature masking for power exchange
direct use in
mode = "sources"for source-only evaluation workflows
Benchmarks And Current Validation¶
The current validation picture has two complementary parts:
automated regression tests - the active test suite covers boundary conditions, flux-file transport
models, finite-volume discretization helpers, geometry volume integration, main helper utilities, orchestration and solver helpers, source models, state/cell-variable helpers, transport equation helpers, and transport state handling
physics and solver benchmarking - the repository contains benchmark-oriented planning and solver-performance
notes in
PLAN.mdcurrent benchmark work especially tracks ambipolarity behavior and solver backend performance
Available benchmark figure¶
The repository currently includes the ambipolar root benchmark figure below.
Current ambipolar-root benchmark figure stored in the repository. This is
the main benchmark plot currently available in docs/benchmark/figures.¶