Discretization
Fields are represented in B-spline finite element spaces forming a discrete de Rham complex. Kinetic species are represented by weighted markers (particle-in-cell), with an optional δf method.
Struphy is an open-source Python package for the numerical solution of fluid, kinetic and hybrid plasma models. Fields are discretized with structure-preserving (geometric) finite elements and kinetic species with particle-in-cell methods.

Loading interactive domain…
Generated from the current Struphy catalogue at build time.ReleasesIssue trackerBuild status
Struphy provides a common interface for fluid, kinetic and hybrid plasma models, together with the discretization, time stepping and post-processing tools needed to run them.
Fields are represented in B-spline finite element spaces forming a discrete de Rham complex. Kinetic species are represented by weighted markers (particle-in-cell), with an optional δf method.
Fluid, kinetic and hybrid models are composed from shared propagators, so that the same substeps are reused across models.
Simulations run on mapped domains, including Cartesian, cylindrical and toroidal geometries, and on domains generated externally.
The interface is written in Python; performance-critical kernels are compiled. A simulation is defined by a model, a domain, an equilibrium, perturbations and numerical parameters, which are stored together with the output.
Numerical methodsSearch the catalogueCitation and reproducibility
The equations of plasma physics have structural properties such as conservation of energy and mass and the divergence-free condition on the magnetic field. Standard discretizations satisfy these only up to truncation error, which can accumulate over long simulations. Struphy builds its finite element discretization on a discrete de Rham complex, for which the vector-calculus identities underlying these properties, such as ∇·(∇×A) = 0, hold at the discrete level up to round-off and not only in the limit of vanishing grid size. Conservation of energy additionally depends on the time discretization.
Struphy supports three classes of plasma models, all built on the same discretization.
Maxwell, MHD and multi-fluid models, discretized with compatible finite elements.
Vlasov and drift-kinetic models, represented by markers (particle-in-cell).
Coupled field–particle models, including MHD-kinetic models.
Install Struphy and compile its kernels.
A simulation is defined by a model, a domain and grid, the discretization parameters and the time stepping, which are collected in one Simulation object; see building a simulation.
Continue with the installation guide, the quick start guide, and tutorials.
$ pip install struphy
$ struphy compileA selection of papers on the methods and algorithms implemented in Struphy. See the full publication list for more.