Fluid model
ViscoResistiveMHD
Full (non-linear) visco-resistive MHD equations discretized with a variational method.
Overview
entropy formulation. It is the most complete variational MHD model in this family when both viscosity and resistivity are required.
Use cases
- nonlinear dissipative MHD simulations
- entropy-based variational MHD benchmarks
- studies where both viscosity and resistivity matter
Governing equations
PDEs solved by model:
Continuity:
Momentum:
Entropy:
Induction:
where the internal energy per unit mass is , and and are artificial viscosity and resistivity coefficients.
Normalization
thermodynamic units inherited from the chosen internal-energy functional.
Discretization
VariationalDensityEvolveVariationalMomentumAdvectionVariationalEntropyEvolveVariationalMagFieldEvolveVariationalViscosity(ifwith_viscosityis True)VariationalResistivity(ifwith_resistivityis True)
Diagnostics
The following scalars are tracked during simulation:
- Kinetic energy:
en_U - Thermodynamic energy:
en_thermo - Magnetic energy:
en_mag - Total energy:
en_tot - Total density / entropy:
dens_tot,entr_tot - Divergence diagnostic:
tot_div_B
Examples

Resistively damped Alfvén wave
A standing Alfvén wave in a resistive plasma oscillates at the Alfvén frequency while its amplitude decays at the rate η k² / 2. Struphy's nonlinear resistive MHD is run at three resistivities and compared with the exact rate. The initial fields are with on ; the scan uses .

Orszag–Tang vortex
Nonlinear evolution of crossed velocity and magnetic vortices in ideal MHD, with density, magnetic field lines, pressure and conservation diagnostics. The initial vortices are with uniform density on the periodic square .

Resistive diffusion of a magnetic field
A sinusoidal magnetic field in a resistive plasma at rest decays without changing shape, at the rate η k². Struphy's variational discretization converts the lost magnetic energy into thermal energy and keeps the total energy constant. The initial state is on , with resistivities .

Resistive magnetic X-point
A periodic magnetic X-point is squeezed by an incompressible strain and evolved with Struphy's nonlinear visco-resistive MHD model. Finite resistivity supports an out-of-plane electric field at the null, changes the flux connecting the X- and O-points, and converts magnetic energy into internal energy while the compatible FEEC discretization controls div B. The initial magnetic field and strain are on , with resistivity .