HARTMAX

HARTMAX simulates liquid metal flowing through strong magnetic fields, the physics of fusion blanket channels. It solves fully developed ducts and pipes and checks them against analytical references. It also solves three-dimensional ducts and pipes, ducts with an inlet and an outlet in a field that changes along them, heat transfer, and a depth-averaged (Q2D) model with Hartmann-layer damping. HARTMAX is written in JAX, so you can differentiate its solutions and run them on a CPU or a GPU. HARTMAX builds the physics, and SOLVAX supplies the numerical solvers.

HARTMAX was called LMhdX until 2.0. If you used lmhdx, install hartmax instead and read Migrating from 1.x to 2.0.

Hartmann-layer collapse, flow-rate error against a spectral reference, and mesh convergence

After python -m pip install hartmax, a first duct takes three lines:

import hartmax

solution = hartmax.solve(hartmax.duct(20.0, 24))   # Hartmann number 20, 24 x 24 cells
print(float(solution.flow_rate))               # 0.15614...

The model is inductionless, which means the flow does not change the applied field.

Start here

Install and run

Install HARTMAX, select a JAX backend, and check the command line.

Install HARTMAX
First duct solve

Solve and validate a Hartmann duct from Python or TOML.

Run a first duct case
A duct leaving a magnet

Solve the flow through the ANL fringe with an inlet and an outlet, and differentiate its pressure drop.

A duct leaving a magnet
Q2D vortex dynamics

Evolve a depth-averaged strong-field model and reproduce its poster and movie.

Evolve a Q2D vortex field
Validation

See the analytical, numerical, and FreeMHD evidence for every claim.

Validation