WorksComputer Science
Sample-Efficient Control of Magnetoconvective Flows via Differentiable Simulation
Abstract
Magnetohydrodynamic (MHD) fluid flows are central to demanding engineering applications, most prominently fusion blanket cooling, where flow control is a promising tool to optimize key properties such as heat transfer. While active flow control (AFC) has recently advanced through machine learning, its application to MHD flows remains largely unexplored. In this work, we present -PICT, a novel differentiable GPU-accelerated MHD solver targeted at AFC. We validate -PICT against MHD benchmarks and demonstrate its high computational efficiency. Integrated into FluidGym, -PICT enables sample-efficient gradient-based algorithms to improve heat transfer by % and allows optimizers to achieve higher accuracy in inverse design than black-box methods. -PICT is publicly available at https://github.com/upb-sciml/phiPICT.
Introduction
Control of large-scale physical systems governed by high-dimensional, non-linear partial differential equations (PDEs) remains a fundamental challenge at the intersection of machine learning, physics, and control theory [10]. Among such systems, magnetohydrodynamics (MHD) introduces distinct control challenges driven by the interaction between an electrically conducting fluid and external magnetic field. In thermal flows, this coupling leads to so-called magnetoconvection, which fundamentally alters the flow structures and heat transfer. Liquid metal magnetoconvection is key to many engineering applications, such as cooling in nuclear-power facilities [32] or fusion reactor blankets [1, 53].
In fusion blanket duct flows, Zikanov and Listratov [51] showed that strong temperature fluctuations can be explained by wall jets destabilizing into large quasi-2D (Q2D) vortices that induce strong mixing. Subsequent works have explored passive strategies to mitigate these thermal stresses, including asymmetric heat loads [8] and modified inlet geometries [52]. However, passive strategies cannot adapt dynamically to non-stationary, evolving turbulent structures. Consequently, closed-loop active flow control (AFC) emerges as a promising candidate for real-time flow stabilization and heat transfer improvement in magnetoconvective fluid dynamics.
Data-driven approaches, particularly reinforcement learning (RL), have emerged as a promising technique for AFC and have achieved notable successes in drag reduction, heat transfer enhancement, and flow separation [31, 6, 41, 18, 28, 36]. Concurrently, differentiable simulators enable direct backpropagation through physical dynamics and can substantially improve sample-efficiency over traditional RL [5, 39]. Despite these advances, the application of RL and gradient-based control to liquid metal flows in closed channels or ducts remains largely unexplored, primarily due to the lack of differentiable, RL-compatible MHD simulators.
To bridge this gap, we introduce -PICT, a GPU-accelerated, differentiable MHD solver and integrate it into the open-source FluidGym framework. In summary, our main contributions are (1) -PICT Solver: A differentiable, GPU-accelerated MHD solver for low magnetic Reynolds numbers that enables end-to-end backpropagation through coupled MHD and thermal dynamics and is validated against canonical MHD and convection direct numerical simulation benchmarks; (2) FluidGym Integration: A modular 3D liquid metal Rayleigh-Bénard convection control environment in FluidGym for black-box RL and gradient-based policy learning; and (3) Empirical Evaluation: Demonstrations showing that gradient-based optimization via -PICT is substantially more sample-efficient across both domains, outperforming black-box RL to increase heat transfer by and achieving 3 orders of magnitude higher accuracy in inverse wall-defect detection1.
Related Work
Numerical Solvers for MHD Flows. Simulating liquid metal flows in the presence of strong magnetic fields in fusion reactors typically relies on the inductionless, quasistatic approximation with magnetic Reynolds numbers [12]. Common numerical software includes epotFOAM [38], based on openFOAM [44] and specialized algorithms like Tensor-Product Thomas solvers [24].
Differentiable Solvers. Differentiable fluid solvers [21, 9, 15] have become a promising tool for general PDE control [22] and gradient-based policy learning [5, 50, 39]. Existing differentiable MHD frameworks focus on high- astrophysics in geometries with simpler boundary conditions than those at solid walls [35]. To the best of our knowledge, no differentiable solver exists for low- magnetoconvective flows in closed geometries.
Reinforcement Learning for Active Flow Control. Recently, deep RL has shown great success in closed-loop flow control. Studies range from aerodynamic drag reduction [31, 17, 28] to convective heat transfer enhancement [6]. For spatially distributed control, multi-agent reinforcement learning (MARL; see Albrecht et al., [2] for an introduction) has shown promising results in terms of generalization and sample-efficiency [18, 41, 40, 26]. In nuclear fusion research, RL has been used for magnetic control of plasma in Tokamak reactors [13, 29]. However, RL for AFC has not yet been applied to liquid metal flows present, for instance, in cooling blankets. We address this gap by introducing a differentiable MHD control benchmark integrated into FluidGym [5], an open-source plug-and-play benchmark for RL and gradient-based methods for AFC.
-PICT: Differentiable Simulation of Magnetoconvective Fluid Flows
Our differentiable solver -PICT for MHD fluid dynamics builds on PICT [15], which provides a differentiable PISO loop, basic boundary conditions, and the adjoint mechanism for the standard velocity and pressure linear solves. To adapt this to MHD, -PICT implements -PISO [27 see Appendix A for details]. Specifically, it adds (1) the electric potential Poisson solver, (2) a conservative current density formulation, (3) the Lorentz force coupling, and crucially, (4) the custom gradient functions required to backpropagate through the new PISO steps related to the electric potential, current density, and Lorentz force (see Figure 1).
Figure 1. Computation of given in -PICT. Solid and dotted lines denote explicit analytical routines and autograd, respectively.
Governing Equations. Following previous works [8], we consider the so-called inductionless or quasi-static approximation. Here, the magnetic field is considered static and not affected by the fluid [see 12 for details]. Under this formulation, the incompressible momentum and continuity equations are
The thermal transport and the buoyancy force based on the Boussinesq approximation are given by
Finally, the current density, charge conservation, and Lorentz force are defined as
The non-dimensional parameters of the coupled magnetohydrodynamic and convective heat transfer system are the Reynolds number , Hartmann number , Prandtl number , Grashof number , and Stuart number . Here, is the characteristic velocity, is the characteristic length scale, is the kinematic viscosity, is the magnetic field magnitude, is the electrical conductivity, is the fluid density, is the thermal diffusivity, is the gravitational acceleration, is the thermal expansion coefficient, is the reference temperature, and is the characteristic temperature difference.
Forward Simulation. An overview of the forward simulation steps computing from is shown in Figure 1. From the charge conservation in Equation (3), we can derive the Poisson equation for the electric potential : via . Following [27, 38], we apply the conservative Lorentz force scheme proposed by Ni et al. [30].
Gradient Computation. To enable end-to-end backpropagation through -PICT, we derive analytical gradients alongside the forward simulation steps (see Figure 1). Following Franz et al. [15], denotes the gradient of the loss w.r.t. , and the vector-Jacobian product yields the contribution to via . Backpropagation starts from and reaches through along two paths: directly via the
face current fluxes, and indirectly via the electric potential . Analytical gradients are derived for two core operations: (i) the conservative face-based current density construction, which couples adjacent cells via face flux sensitivities to yield and , and (ii) the linear potential solve. For the discrete linear system of the electric potential with discrete potential matrix and , we solve the adjoint system to obtain , which gives the gradient function . In contrast to naive unrolling of Conjugate Gradient (CG), solving the adjoint allows memory scaling w.r.t. linear solve iterations. Standard cell operations, such as the cross products producing and finally , are handled by PyTorch autograd (dotted lines in Figure 1). Although is assumed constant in this work, -PICT also enables gradient backpropagation with respect to . Detailed gradient derivations are stated in Appendix § 9.§ 3.
Solver Validation. In the following, we describe how we thoroughly evaluate our MHD solver. First, we run Hartmann, Shercliff, and Hunt flows and match the analytical velocity profiles. A grid refinement study shows how the relative errors decrease with higher resolutions. Furthermore, we compare our results to the jet detachments in a duct flow discussed by Arlt [4]. To further validate our solver for magnetoconvective flows, we run validation cases spanning various Hartmann numbers and wall conduction ratios that match results previously published by Krasnov et al. [24], see Table 7 and Table 8. To validate the correctness and informativeness of simulation gradients, we run the PyTorch gradcheck tool as well as an optimization task where we learn the Stuart number of a reference simulation via backpropagation. Together, these results show the correctness of our proposed solver in both forward and backward passes (see Appendix B for detailed results).
| Ha | Nu | Nu | (%) |
| 0 | 3.751 | 3.800 | 1.302 |
| 162 | 4.453 | 5.150 | 13.529* |
| 325 | 4.417 | 4.440 | 0.518 |
| 487 | 3.621 | 3.440 | 5.265* |
| 650 | 3.181 | 3.150 | 0.975 |
| 796 | 3.034 | 3.010 | 0.812 |
Table 7. Experimental results for the convection in a box case [24]. *In these cases, the flow is unstable and does not converge to a steady-state solution, as pointed out by Krasnov et al. [24]. Therefore, our results do not match the reference numbers.
| Nu | Nu | (%) | |
| No MHD | 3.359 | 3.331 | 0.838 |
| 0 | 3.241 | 3.245 | 0.139 |
| 0.01 | 3.040 | 3.046 | 0.183 |
| 0.1 | 2.276 | 2.277 | 0.050 |
| 1 | 1.537 | 1.527 | 0.681 |
| 50 | 1.387 | 1.390 | 0.184 |
Table 8. Experimental results for the convection in a box case [24].
Further Improvements. Due to the large computational cost associated with fluid simulations, we incorporate a series of improvements into -PICT to enhance its efficiency and consequently the downstream performance of FluidGym for (magnetoconvective) environments. To fully utilize the GPU, we introduce batched simulations of over 250 parallel FluidGym environments, yielding substantial speedups over FluidGym based on PICT. To further reduce simulation runtime at scale, we introduce three core optimizations to the CG solver in -PICT: (i) transferring the whole CG solve execution to the GPU without intermediate CPU communication, (ii) warm-starting the pressure solve from the previous time step, and (iii) adopting adaptable solver tolerances during intermediate iterations, following OpenFOAM. Consequently, -PICT achieves a substantial average speedup over the baseline PICT solver in FluidGym. Notably, for some environments, speedups of up to approx. are achieved (see Table 2 in Appendix § 9.§ 4). Specifically for MHD, we additionally leverage preconditioning of the electric potential Poisson linear system through the algebraic multigrid (AMG; Ruge and Stüben [34]) method via PyAMG (Bell et al. [7]).
| Environment | -PICT | |
| Airfoil2D-easy | 64 | |
| Airfoil2D-hard | 96 | |
| Airfoil2D-medium | 96 | |
| Airfoil3D-easy | 2 | |
| Airfoil3D-hard | 2 | |
| Airfoil3D-medium | 4 | |
| CylinderJet2D-easy | 384 | |
| CylinderJet2D-hard | 128 | |
| CylinderJet2D-medium | 192 | |
| CylinderJet3D-easy | 24 | |
| CylinderJet3D-hard | 2 | |
| CylinderJet3D-medium | 12 | |
| CylinderRot2D-easy | 384 | |
| CylinderRot2D-hard | 512 | |
| CylinderRot2D-medium | 192 | |
| RBC2D-easy | 64 | |
| RBC2D-hard | 128 | |
| RBC2D-medium | 192 | |
| RBC2D-wide-easy | 96 | |
| RBC2D-wide-hard | 96 | |
| RBC2D-wide-medium | 96 | |
| RBC3D-easy | 96 | |
| RBC3D-hard | 96 | |
| RBC3D-medium | 96 | |
| RBC3D-wide-easy | 24 | |
| RBC3D-wide-hard | 24 | |
| RBC3D-wide-medium | 24 | |
| TCFLarge3D-both-easy | 48 | |
| TCFLarge3D-both-hard | 96 | |
| TCFLarge3D-both-medium | 96 | |
| TCFLarge3D-bottom-easy | 32 | |
| TCFLarge3D-bottom-hard | 96 | |
| TCFLarge3D-bottom-medium | 96 | |
| TCFSmall3D-both-easy | 96 | |
| Mean |
Table 2. Individual speedups per environment of -PICT over PICT in FluidGym with optimal batch size , determined on a NVIDIA A100 with 80GB VRAM. Optimal batch sizes might differ on different GPUs.

Figure 2. Geometric mean runtime improvements of -PICT over PICT across all non-MHD FluidGym environments. Dots indicate speedup factors for individual environments.
Learning Closed-loop Control: Liquid Metal Rayleigh-Bénard Convection
Experimental Setup
In the following, we present a novel control setup for 3D liquid metal Rayleigh-Bénard convection (RBC) in a closed box of size following Yanagisawa et al. [49] that is heated at the bottom and cooled from the top. The setup is visualized in Figure 3.

Figure 3. Uncontrolled MHD RBC setup with electrodes at the Hartmann walls at .
Motivated by the idea that quasi-two-dimensional convection rolls have desirable properties in fusion blankets, the control environment aims to stabilize these rolls. The stability of the rolls depends on the ratio of the Rayleigh number to the Chandrasekhar number . When fixing and increasing , the flow exhibits decreasing magnetic damping and higher instability, which increases control difficulty. As studied by Yanagisawa et al. [49], there are distinct flow regimes one could consider regarding in terms of . Particularly, these can be characterized by (i) a transition from five to four rolls between and ; and (ii) a four-roll oscillation and a transition from four to three rolls between and . Based on these findings, we consider and .
Numerical Setup. We simulate the flow with -PICT, solving Equations (1)–(3) with a uniform horizontal magnetic field and gravity . We use and . All walls are no-slip and electrically insulating. The bottom and top plates are isothermal at and , with , and the side walls are adiabatic. The magnetic field damps velocity gradients along , so the rolls align with and are stacked along , and the walls at and are the Hartmann walls, i.e., the walls perpendicular to the magnetic field. The grid has cells, with tanh refinement towards all walls. Along , the grading resolves the Hartmann layers of thickness with at least three cells. The time step adapts to a CFL number of with control step length free-fall time units. Discrete control steps are denoted by index . A set of 30 initial states for training, validation, and testing is obtained by evolving the conduction profile with small temperature perturbations for 30 free-fall times. At each reset, we randomize the roll configuration by applying a random combination of mirroring, small temperature noise, and a short random warm-up similar to the procedures in FluidGym (Becktepe et al. [5]).
Actuation, Observations, Reward. Following Becktepe et al. [5], we formalize the control task as a partially observable stochastic game (POSG) for multi-agent reinforcement learning (MARL) based on Albrecht et al. [2]. In particular, we consider individual agents acting in the fluid domain. While all agents share the same policy, each agent with index acts locally via and receives an individual reward and observation . Here, each agent corresponds to one of electrode stations distributed along on both Hartmann walls. Each station holds two electrodes along , so agent sets two normalized currents . Opposing electrodes on both walls carry the same current, keeping the forcing symmetric about . Since the box is otherwise insulating, the joint action is projected onto zero net current before being applied. A zero action thus recovers the uncontrolled flow. Each agent observes 960 velocity and temperature sensors on the full – grid, within a local z-window that covers its own station and its neighbours’ actuators, padded beyond the side walls with zero velocity and the conduction-profile temperature. The global reward at control step balances heat transfer enhancement against electrical power consumption:
where both terms are averaged over the inner solver steps of step . Here, is the volume-averaged Nusselt number. Quantities indexed with ref denote the uncontrolled baseline. The injected electrical power over electrode surface is normalized by the thermal driving power . Following Vignon et al. [41], individual rewards blend local and global quantities.
Control Algorithms. As a black-box RL algorithm we consider Soft Actor-Critic (SAC; [19]) implemented in the Stable-Baselines3 (SB3; [33]) framework using its default hyperparameters. To leverage the differentiable simulation, we train policies using backpropagation through time (BPTT/APG; [45, 16]) and Short-Horizon Actor-Critic (SHAC; [48]). In both approaches, policy parameters are updated by backpropagating the gradient of the discounted return over a horizon of 10 control steps through the physics simulation. Notably, the naive BPTT algorithm does not leverage explicit exploration, value function estimation, or experience replay. All algorithms are trained across 5 random seeds on the FluidGym train split. After training, policies are evaluated deterministically on 10 test episodes. Detailed hyperparameters are stated in Appendix § 11.§ 2.
Results
To account for the computational overhead of activation checkpointing and backward passes for differentiable methods, we measure training progress in forward-equivalent simulation steps. Figure 4 shows the mean training reward trajectories. Notably, BPTT shows the fastest convergence and reaches its final reward after forward-equivalent steps, corresponding to environment steps. SHAC and SAC perform similarly at , while SHAC slightly outperforms SAC at . However, neither SAC nor SHAC reaches the reward achieved by BPTT throughout 10k forward-equivalent training steps. Notably, despite lacking SHAC’s stabilization mechanisms, BPTT proves more effective here, demonstrating the sample-efficiency enabled by -PICT. This is consistent with the final evaluation of policies on the test set (see Table 1). Over 10 test episodes, BPTT achieves the highest mean reward across all methods and regimes. Qualitative temperature fields generated by the final BPTT policy are shown in Figure 5. Notably, for the regime, BPTT is able to stabilize five convection rolls, improving heat transfer by over 25% throughout testing. For the regime, quantitative results show more than a 15% increase in . However, due to the higher Rayleigh number and associated turbulence, stabilizing the system becomes substantially harder in this regime. These findings align with the final temperature fields controlled by BPTT, where four instead of five rolls are stabilized by the controller compared to the regime.
Figure 4. Mean training reward per step over forward-equivalent control steps for BPTT, SAC, and SHAC (accounting for the step cost of backpropagation and activation checkpointing). Solid lines and shaded areas represent mean standard deviation across seeds, respectively.

Figure 5. MHD-RBC temperature fields stabilized by the final BPTT policies.
| SAC | BPTT | SHAC | |
| 20Q | 0.133 | 0.236 | 0.146 |
| 50Q | −0.018 | 0.116 | 0.033 |
Table 1. Interquartile mean reward over 10 test episodes across regimes (best method in bold).
When inspecting the actions applied by the final BPTT policy, we observe current injection related to the five convection rolls. Figure 6 shows the wall potential at the Hartmann wall at , where actuators are visualized through gray rectangles. Notably, we observe five large patches of alternating positive and negative electric potential spanning the wall from to , likely injecting current in a way that produces a Lorentz force stabilizing the convection rolls.
Figure 6. BPTT policy producing five convection rolls, visualized through the wall potential .
These results further suggest that control policies learned through the differentiable physics systematically leverage the underlying equations to stabilize the system and improve its overall heat transfer. Detailed qualitative and quantitative results across all algorithms are stated in Appendix § 12.
Inverse Design: Detecting Defective Wall Patches in a Convection Box
Experimental Setup
In the following, we consider an inverse design problem in a 3D buoyant liquid metal flow in a cube ([37]). Motivated by the idea that cracks in the insulating coatings of fusion blankets can locally short-circuit the electric currents, the task aims to detect such effects from sparse velocity measurements in the bulk of the flow (see Figure 7). The walls are divided into 24 patches, each with its own wall conductance ratio , and the task is to recover this map solely from a small number of velocity probes in the bulk of the flow. Each candidate map is evaluated by simulating the flow and comparing its probe signals with those produced by the hidden ground truth. In addition to black-box optimization, the differentiability of -PICT provides the gradient of this mismatch with respect to all patches, which enables gradient-based optimization.
Figure 7. Defective wall patch detection setup. Based on sparse sensor probes, the goal is to recover defective wall patches in a convective box.
Flow Configuration. The flow setup follows the convection benchmark of Tagawa et al. [37], subject to a horizontal magnetic field and gravity . The dimensionless parameters are set to , , and . Simulations are conducted in the unit cube of size . A hot wall with constant temperature is prescribed at , a cold wall with is set at . Temperatures are relative to a reference temperature , and the remaining walls are adiabatic. All walls are no-slip. Using the thin-wall condition, a fixed is prescribed per patch. The grid has 64 cells per dimension, i.e., cells in total, with tanh refinement (see Krasnov et al. [24] for details) towards all walls. We use a fixed time step of free-fall time units. All runs start from the same statistically steady flow obtained with a uniform .
Parameterization and Target. Each of the six cube surfaces is equally divided into patches, resulting in 24 design parameters , bounded by . A random seed defines the hidden ground-truth map: Each face receives a base value shared by its four patches, and each patch is independently marked as defective with probability 0.25, which raises its by an offset drawn from . Simulating this map for steps from yields the target flow . Starting from random maps drawn from the same distribution, the optimizers have no prior information about defect locations.
Sensors and Objective. The flow is observed only through 64 point probes, each measuring all three velocity components in a single cell, i.e., 192 measurements in total. The probe cells are drawn once, uniformly at random from the core of the domain at a distance of at least 0.1 from all walls, and are kept fixed across all seeds and optimizers. With the sensor operator , each evaluation of a candidate restarts from an initial, steady-state velocity field , simulates the same steps to obtain , and computes the objective measuring the deviation from the target measurements:
Optimization Algorithms. For this task, we consider the black-box optimization algorithm CMA-ES [20] with an initial step size of and its default population size as a baseline. Further, we evaluate the gradient-based L-BFGS-B algorithm [11] implemented in SciPy [42]. An optimization run stops after reaching or after a wall-time limit of 30 minutes. Detailed hyperparameters are stated in Appendix § 11.§ 3.
Results
In the following, we discuss the optimization results of CMA-ES and L-BFGS-B on the defective detection task. The optimization progress over time is shown in Figure 8. We compare the methods in terms of the objective over the wall-clock time. Dots mark where the median reaches the stop objective . Notably, within the given time budget, the gradient-based L-BFGS-B reaches an objective value approximately 3 orders of magnitude smaller than CMA-ES. Similarly, the RMSE between the optimized and ground-truth wall patch conductivities is substantially smaller for the gradient-based optimizer. These results demonstrate the efficiency of gradient-based optimization via differentiable simulation for inverse problems.

Figure 8. Defect detection optimization using CMA-ES and L-BFGS-B: best objective over wall-clock time. Lines and shading show median and min–max range across seeds, respectively.
When inspecting the final obtained wall patch conductivities by the optimizers, we observe notable differences. Figure 9 shows the ground-truth maps per wall as well as the respective errors of the best configuration returned by each optimizer. For the walls at , both optimizer errors are comparably low. However, for the remaining four walls, CMA-ES exhibits substantial errors, whereas the errors of L-BFGS-B remain small. Most importantly, for the walls and , the errors of L-BFGS-B are negligible. Together, these results highlight that differentiating through -PICT yields informative gradients, which enable gradient-based optimizers to recover the true underlying defective patches accurately. Across additional seeds, residual errors vary across walls without favoring specific coordinates, which indicates this localized variation is not systematic.
Figure 9. Final wall conductance ratio maps for CMA-ES and L-BFGS-B (seed 0). We visualize the ground-truth maps per cube wall and the respective errors of the final results of both optimizers.
Similarly, the final velocity fields generated with the optimized maps differ in the errors with respect to the ground-truth velocity field. As shown in Figure 10, the velocity field produced by the CMA-ES map shows relative errors on the order of 10%, while the L-BFGS-B velocity field errors are negligible. This comparison demonstrates that the solution obtained through differentiable physics is robust and accurately recovers the underlying physical properties of the target flow.
Figure 10. Ground-truth velocity fields and relative errors of velocity fields produced by the final maps optimized via CMA-ES and L-BFGS-B.
Limitations & Future Work
In this work, we present -PICT, a differentiable GPU-accelerated solver for liquid metal MHD flows targeted at control and inverse design problems. Despite its GPU acceleration and efficiency optimizations, computational limitations remain. Currently, the solver requires a CUDA-capable GPU and is restricted to single-GPU execution, though scaling to multi-GPU architectures presents a viable direction for future research. Furthermore, high-resolution 3D simulations remain computationally demanding and highlight the need for surrogate modeling approaches.
Beyond addressing the aforementioned limitations, -PICT can serve as an efficient data generator to train fast surrogate models, ranging from machine learning surrogates to physics foundation models ([46, 3, 23]) and possibly future models targeted at controlled flows. While combining RL and differentiable physics has proven highly sample-efficient in robotics ([48, 47]), its application to fluids remains largely unaddressed, a gap our benchmark aims to bridge. Finally, we plan to extend this framework to more control and inverse problems spanning both hydrodynamics and magnetohydrodynamics.
Generative AI Use
Generative AI tools were used for implementation, code optimization, and refactoring, as well as for improving the written text of the manuscript. The authors reviewed and verified all AI-assisted content and take responsibility for the final content of the paper.
Acknowledgments
JB and SP acknowledge funding from the European Research Council (ERC Starting Grant “Ko-OpeRaDE”) under the European Union’s Horizon 2020 research and innovation programme (Grant agreement No. 101161457). The computations were performed on the compute cluster of the Lamarr Institute for Machine Learning and Artificial Intelligence, as well as on the high-performance computers “Noctua 2” and “Otus” at the NHR Center Paderborn Center for Parallel Computing (PC2), both of which are funded by the Federal Ministry of Research, Technology and Space and by the state of North Rhine-Westphalia. The work of DK and JS is supported by the Deutsche Forschungsgemeinschaft.
Differentiable Simulation of Magnetoconvective Fluid Flows
Governing Equations
Adapting the formulation of Mas de les Valls [27], we extend the PISO algorithm implemented in PICT (Franz et al. [15]) to -PISO. From the charge conservation in Equation (3), we can derive the Poisson equation for the electric potential :
Boundary Conditions For the electric potential , boundary conditions are defined by the wall conductance ratio
with
As formulated by Walker [43], for walls with a constant conduction ratio and wall thickness , we employ the so called thin-wall boundary condition
Finite Volume Formulation
Notation For consistency and direct compatibility with the underlying solver, we adopt the finite volume method (cf. Maliska [25]) notation used by Franz et al. [15], summarized below:
Current cell
Set of valid neighbor cells of
Set of faces between and
Set of (virtual) boundary neighbor cells of
Set of boundary-faces between and
Set of diagonal neighbors ’tangential’ to
Set of diagonal boundary faces ’tangential’ to
Sign of logical face direction on computational grid
Evaluated/value at current cell or
Evaluated/value at neighbor cell or
(Linear) Interpolation Following this convention, for cell (index ) and neighbor cell (index ), the entries of a discretized operator matrix are indexed as:
Potential Solve To solve the Poisson equation for the electric potential (), we leverage the Conjugate Gradient (CG) solver in PICT. The discrete potential matrix is constructed similarly to the discrete pressure matrix , but the diagonal entries are omitted. This leaves us with the Laplace coefficients :
Non-orthogonal grid corrections follow the same formulation as the pressure equation.
Applying the divergence theorem, the right-hand side of the potential equation is discretized as
In the generalized coordinate systems, this can be expressed as
Face-based Lorentz Force To ensure discrete charge conservation, we compute the Lorentz force from face-centered current density fluxes following the conservative scheme of Ni et al. [30]:
The cell-centered current density is obtained by averaging opposite face fluxes along each coordinate direction and transforming to the physical domain:
The resulting Lorentz body force is then evaluated as .
Thin-Wall Approximation For walls with arbitrary conductance ratio , we apply the thin-wall boundary condition. For a fluid cell adjacent to a boundary face , this condition couples the potential to the tangential neighbor cells . For each tangential direction , we define the surface Laplace coefficient as:
where denotes the orthogonal Laplace coefficient along . The discrete potential matrix in Equation (10) is updated accordingly:
while the wall-normal face contribution remains zero as in the insulating case. For cells bordered by multiple thin-wall boundaries (such as corner cells), these corrections accumulate additively across all adjacent boundary faces .
Gradients
For gradient computation, we adopt the notation of Franz et al. [15]. In this work, denotes the adjoint, i.e., the gradient of a scalar loss with respect to , rather than a differential. For a function , the vector-Jacobian product yields the contribution to that flows through and has the same shape as . If influences the loss through multiple quantities, the individual contributions are summed to obtain . We denote the function by to avoid confusion with the face index . Standard operations handled automatically by PyTorch’s autograd are omitted.
Local Formulation. and denote arbitrary physical quantities in the computational graph, e.g., the potential or the velocity . As in Franz et al. [15], we write them per cell or face: is considered a scalar and a vector of three components, although the corresponding fields are vectors over all cells. Since every operation, except for the linear solves, only couples a cell to its neighbors, the global Jacobian is sparse and never assembled. Instead, we write the vector-Jacobian product for a single cell . Since only enters quantities of itself and of its neighbors , all other terms of the global product vanish. For a cell-based quantity , we have
and analogously, for a face-based quantity , a sum over the bounding faces :
Inserting the local forward rule for turns this into an explicit per-cell expression that maps directly onto a GPU kernel.
Overview of the Backward Pass. The velocity affects the Lorentz force through along two paths: directly via the face current flux, and indirectly via the electric potential , whose Poisson equation has the right-hand side . Starting from the downstream gradient , the backward pass proceeds as follows:
Lorentz force: .
Cell current density to face fluxes: (Eq. (18)).
Face fluxes to potential: (Eq. (22)).
Face fluxes to , direct path: (Eq. (23)).
Potential to , indirect path: adjoint solve , followed by the backward divergence (Paragraph Potential Solve).
Both contributions to from steps 4 and 5 are summed.
Cross product: .
The following paragraphs derive steps 2 – 5 in detail.
Face-based Lorentz Force. We trace the analytical backward pass starting from the Lorentz body force . Backpropagating through the face-averaged current density in Equation (13) yields the face flux sensitivity:
The cell gradient is thus distributed across all bounding faces via .
Substituting the potential difference , the face current flux formulation (see Equation (12)) simplifies to
with sensitivity with respect to :
Because the flux at face couples both cell and neighbor , the individual derivatives are:
Consequently, each face receives two gradient contributions:
from the cell’s current density gradient , denoted as , and
from neighbor cell ’s current density gradient , denoted as .
Accounting for the reversed face normal sign () from neighbor , the total potential gradient for cell is:
Following the definition of , we get
This leads us to the gradient function
Accumulating contributions from adjacent cells gives the total gradient:
The complete gradients and follow directly by substituting the face sensitivities (see Equation (18)) into Equation (22) and Equation (23), respectively.
Potential Solve Because the discrete potential matrix depends purely on static grid geometry, it requires no gradient backpropagation. Following Franz et al. [15], given the downstream potential gradient , we compute () by solving the linear adjoint system for the potential Poisson equation (see Equations (5) and (10)):
where . Differentiating through the discretized divergence operator in Equation (11) then yields the gradient with respect to :
The remaining gradient pathways back to the velocity field are handled by PyTorch’s autograd.
Further Improvements
To assess the computational efficiency of -PICT and quantify individual solver improvements, we benchmark throughput across the non-MHD environments in FluidGym. For each environment, we measure throughput in environment steps per second across different configurations: unbatched PICT, -PICT without batching, leave-one-out feature ablations, and full -PICT across a sweep of batch sizes. The optimal batch size for -PICT is automatically determined as the throughput-maximizing size that satisfies a peak GPU memory threshold (i.e., staying within a predefined percentage of device memory). Ablation variants are subsequently evaluated at this optimal batch size. The resulting speedups over original PICT, evaluated across multiple environments, are summarized in Table 2.
Linear Upwind Advection Scheme For the MHD flows studied in this work, we found the linear upwind differencing scheme for the advection term to be more stable than the previously implemented central difference scheme (see e.g. Maliska, [25]).
Potential Solve Preconditioning To accelerate CG convergence, we precondition the system using Algebraic Multigrid (AMG; [34]) via PyAMG ([7]) for the elec tric potential. Since the discrete potential matrix depends only on the grid, the preconditioning can efficiently be computed once and re-used throughout the simulation. Furthermore, AMG preconditioning is applied to decrease the number of CG iterations of the adjoint solve in the backward pass.
Intermediate Pressure Tolerance In line with OpenFOAM [44], we integrate a lower intermediate tolerance for the first pressure correction step in combination with the previous final tolerance value2.
Activation Checkpointing To enable backpropagation of reward gradients through long horizons of, for instance, 25 or RL steps, we implement activation checkpointing. This allows users to trade off computational runtime and memory requirements. In our experiments, forward and backward passes through segments of 10 PISO steps can be computed on a GPU with 80 GB VRAM.
Solver Validation
We validate our differentiable MHD implementation across canonical flow configurations with known analytical solutions, following standard validation protocols from prior MHD solver literature [27, 38, 24, 14]. These benchmarks evaluate the solver’s accuracy under varying Hartmann numbers, wall conductivity ratios, and thermal boundary conditions.
Forward Validation
In the following, we discuss the validation of -PICT against canonical MHD cases. We denote spatial coordinates as , , and and spatial averaging over a direction is written as .
Hartmann Flow
The Hartmann flow is a 2D flow between two infinite walls separated by a distance exposed to a magnetic field of strength perpendicular to the walls. To maintain a constant mean streamwise velocity, we dynamically update the pressure gradient depending on the difference between the current and target velocity, i.e.,
with . The analytical solution for the velocity profile is given as
with reference velocity . Following Mas de les Valls [27], we estimate the solver accuracy using the mean absolute error (MAE). We additionally normalize by the peak analytical velocity
For our experiments, we set and .
Figure 11. Hartmann case: Analytical and numerical velocity profiles for different Hartmann numbers. Numerical results are averaged over the streamwise () direction.
| 0.00 | 100 | 50 | 10 | 0.04 |
| 5.00 | 100 | 50 | 10 | 0.02 |
| 10.00 | 100 | 50 | 10 | 0.03 |
| 20.00 | 100 | 50 | 10 | 0.08 |
| 20.00 | 200 | 100 | 10 | 0.02 |
| 20.00 | 400 | 200 | 10 | 0.01 |
Table 3. Experimental results for the Hartmann case.
Shercliff and Hunt Flows
| Case | ||
| I | 20 | 9 |
| II | 100 | 10 |
| III | 1000 | 100 |
Table 4. Experimental setup for Shercliff and Hunt cases.
| 20 | 50 | 40 | 40 | 200 | 50 | 0.22 | 0.48 |
| 100 | 50 | 40 | 60 | 200 | 50 | 0.31 | 0.65 |
| 1000 | 50 | 50 | 50 | 200 | 50 | 7.98 | 10.97 |
| 1000 | 50 | 100 | 100 | 200 | 50 | 2.07 | 2.75 |
| 1000 | 100 | 150 | 150 | 200 | 50 | 0.75 | 0.94 |
Table 5. Validation results for the Shercliff case.
| 20 | 50 | 40 | 40 | 200 | 50 | 0.15 | 0.28 |
| 100 | 50 | 40 | 60 | 200 | 50 | 0.11 | 0.31 |
| 1000 | 50 | 50 | 50 | 200 | 50 | 0.11 | 0.94 |
| 1000 | 50 | 100 | 100 | 200 | 50 | 0.03 | 0.22 |
| 1000 | 100 | 150 | 150 | 200 | 50 | 0.02 | 0.10 |
Table 6. Validation results for the Hunt case.
For the Shercliff and Hunt cases, the analytical profile is given by a Fourier series
with , , and . For the Shercliff case, we set , , and . For the Hunt case, we set for the walls at .
For the Shercliff and Hunt cases, we additionally consider the cell-volume-weighted relative RMSE, denoted as
where denotes the volume of cell and the sums run over all cells in the domain.
Figure 12. Shercliff case: Analytical and numerical velocity profiles for different Hartmann numbers. Numerical results are averaged over the streamwise () direction.
Figure 13. Shercliff case: Velocity for different Hartmann numbers.
Figure 14. Hunt case: Analytical and numerical velocity profiles for different Hartmann numbers. Numerical results are averaged over the streamwise () direction.
Figure 15. Hunt case: Velocity for different Hartmann numbers.
Jet Detachments in a Duct Flow with and .
To validate the solver in a high- magnetohydrodynamic regime, we simulate Hunt flow in a rectangular duct following Krasnov et al. [24] and Arlt [4]. The flow domain has dimensions discretized on a grid of . The grid is refined towards the walls along and . Periodic boundary conditions are applied along the streamwise -direction. The flow is governed by and , with an external magnetic field oriented along the -axis. The duct walls parallel to the magnetic field are electrically insulated (), whereas the perpendicular (Hartmann) walls have a finite conductance ratio (). Under these conditions, the fully developed regime exhibits characteristic high-velocity side-layer jets and jet detachment phenomena as described by Arlt [4] and Krasnov et al. [24] (see Figure 16 and Figure 17).
Figure 16. Jet detachments in a duct flow with and .
Figure 17. Jet detachments represented by the streamwise velocity over the duct length in a duct flow with and .
Convection in a Tall Box
Following the benchmark configuration in Krasnov et al. [24], we consider natural convection of liquid metal (mercury) in a tall box with dimensions . Gravity acts in the negative -direction, while an external uniform magnetic field is applied along the horizontal -axis. Constant temperatures are applied at the vertical walls perpendicular to ( at the hot wall, at the cold wall), with all other walls thermally and electrically insulated. The flow is simulated at () across varying magnetic field strengths spanning .
As summarized in Figure 18, our computed Nusselt numbers () show strong agreement with the reference values across most regimes (). At intermediate values ( and ), the flow is inherently unsteady and subject to transitions between multiple flow states [24], leading to higher relative deviations.
Figure 18. Convection case I: Temperature and velocity arrows for different Hartmann numbers.
Convection in a Square Box
The second configuration evaluates horizontally driven natural convection of a fluid in a unit cubic cavity () at () and [24]. While maintaining the same orthogonal orientation of gravity (), magnetic field (), and temperature gradient (), this setup benchmarks the effect of finite wall electrical conductivity by varying the uniform wall conductance ratio , alongside a hydrodynamic baseline (No MHD).
As shown in Table 8, our steady-state results closely match the reference data across all conductance ratios, with relative errors remaining below 0.84%.
Figure 19. Convection case II: Temperature and velocity arrows for different wall conductance ratios.
Backward Validation
Similar to the PISO steps in PICT [cf. 15], we use the PyTorch gradcheck tool to validate the -PICT gradient operations. Additionally, we perform a learning task where we learn a physical parameter through the differentiable MHD simulation (see Figure 20) on three previously discussed flow settings. The goal is to learn the Stuart number of a reference simulation given the final velocity field after a fixed number of steps, where the loss function is the MSE between the velocity of the optimized and the reference simulation. Based on the loss with respect to the reference, a backward pass through the differentiable MHD simulation is performed, and the learned Stuart number is updated using SGD. The procedure is repeated until the loss is below .
Figure 20. Stuart number learning results for validating solver gradients. Gray dashed line indicates the Stuart number of the reference simulation.
Experiments
Hardware and Software Configuration
Reproducibility and Data Availability. All validation, RL, and inverse design results are publicly available in our HuggingFace dataset3. Further, all scripts to run the experiments presented in this work are available on GitHub4.
General Experimental Setup. Experiments were conducted on the following types of nodes with the following specifications: A100-40GB nodes:
Python: 3.12.13
PyTorch: 2.10.0+cu128
CUDA: 12.8
System Memory: 32 GB RAM
CPU: 32 cores of an AMD EPYC 7763
GPU: NVIDIA A100 (40 GB)
A100-80GB nodes:
Python: 3.12.13
PyTorch: 2.10.0+cu128
CUDA: 12.8
System Memory: 32 GB RAM
CPU: 32 cores of an AMD EPYC 7742
GPU: NVIDIA A100 (80 GB)
All SAC runs were computed on A100-40GB nodes and BPTT and SHAC experiments were conducted on A100-80GB nodes.
Control Algorithm Hyperparameters
| Hyperparameter | Value |
| Policy Network Type | MlpPolicy |
| Policy Network Layers | [256, 256] |
| Critic Network Layers | [256, 256] |
| Learning Rate | |
| Discount Factor () | 0.99 |
| Soft Update Coefficient () | 0.005 |
| Replay Buffer Size | |
| Batch Size | 256 |
| Learning Starts | 100 |
| Training Frequency | 1 |
| Gradient Steps per Update | −1 (equal to train_freq) |
| Entropy Coefficient () | auto |
| Target Entropy | auto |
| Target Update Interval | 1 |
| Device | CUDA |
Table 9. SAC hyperparameters used in all RBC-MHD experiments.
| Hyperparameter | Value |
| Policy Network Layers | [128, 64, 32] |
| Hidden Layer Normalization | LayerNorm |
| Hidden Activation | ELU |
| Output Activation | Tanh |
| Optimizer | AdamW |
| Learning Rate | |
| Discount Factor () | 0.999 |
| Horizon | 10 |
| Reward Scale | 1.0 |
| Max. Gradient Norm | 0.5 |
| Observation Normalization | True |
| Detach Observations | True |
| Checkpoint Segment Size | 5 |
| Device | CUDA |
Table 10. BPTT hyperparameters used in all RBC-MHD experiments.
| Hyperparameter | Value |
| Actor network layers | [256, 256] |
| Critic network layers | [256, 256] |
| Hidden layer normalization | LayerNorm |
| Hidden activation | ELU |
| Initial Log-Std. () | −2.3 |
| Tanh action clamping | True |
| Observation normalization | True |
| Optimizer | Adam |
| Actor learning rate | |
| Critic learning rate | |
| Learning rate schedule | Constant |
| Discount factor () | 0.99 |
| Horizon | 10 |
| Critic method | TD() |
| TD parameter () | 0.95 |
| Critic iterations | 16 |
| Critic mini-batches | 1 |
| Target critic coefficient () | 0.2 |
| Max. gradient norm | 1.0 |
| Reward scale | 1.0 |
| Checkpoint segment size | 5 |
| Device | CUDA |
Table 11. SHAC hyperparameters used in all RBC-MHD experiments.
Inverse Design Optimizer Hyperparameters
| Hyperparameter | Value |
| Implementation | pycma |
| Parametrization | per patch |
| Initial step size () | 0.5 |
| Population size | (default) |
| Bounds on | |
| Stopping objective | |
| Wall-time limit | 1800 s |
| Gradients | None |
Table 12. CMA-ES hyperparameters for the inverse problem. Unlisted options keep the defaults of the pycma library.
| Hyperparameter | Value |
| Implementation | SCIPY.OPTIMIZE |
| Parametrization | per patch |
| Function tolerance (FTOL) | |
| Gradient tolerance (GTOL) | |
| Max. iterations | 15000 |
| Max. function evaluations | 15000 |
| Bounds on | |
| Stopping objective | |
| Wall-time limit | 1800 s |
| Gradients | Differentiable solver |
Table 13. L-BFGS-B hyperparameters for the inverse problem. Gradients are computed by the differentiable solver. Unlisted options keep the SciPy defaults.
Results
Learning Closed-loop Control: Liquid Metal Rayleigh-Bénard Convection
Figure 21. Qualitative visualizations of the final MHD RBC temperature fields controlled by the BPTT policy.
In addition to the overall test set reward comparison, we also consider the mean improvement in and the relative actuation power consumption. These are denoted in Table 14 and Table 15, respectively. Notably, while SAC achieves a greater heat transfer improvement, it also yields higher actuation power. BPTT, on the contrary, achieves a much lower power consumption at lower Nusselt improvement, while still achieving the highest overall reward, which balances improvement and actuation power.
| SAC | BPTT | SHAC | |
| 20Q | +33.56% | +28.59% | +31.60% |
| 50Q | +10.73% | +16.44% | +21.18% |
Table 14. Interquartile mean relative improvement in over the uncontrolled baseflow over 10 test episodes.
| SAC | BPTT | SHAC | |
| 20Q | 2015.72% | 476.94% | 1558.45% |
| 50Q | 1309.66% | 477.40% | 1884.74% |
Table 15. Interquartile mean relative actuation power increase over the uncontrolled baseflow over 10 test episodes. Lower is better.

Figure 22. Per-step test set rewards for all algorithms across both regimes.
Inverse Design: Detecting Defective Wall Patches in a Convection Box

Figure 23. Defect detection optimization using CMA-ES and L-BFGS-B. Left: best objective over wall-clock time. Right: RMSE between true and optimizer map for best objective . Lines and shading show median and min–max range across seeds, respectively.
References
- [1]G. Aiello, J. Aubert, N. Jonquères, A. Li Puma, A. Morin, and G. Rampal. Development of the Helium Cooled Lithium Lead blanket for DEMO. Fusion Engineering and Design, 89, 2014.DOI
- [2]Stefano V. Albrecht, Filippos Christians, and Lukas Schäfer. Multi-Agent Reinforcement Learning: Foundations and Modern Approaches. 2024.
- [3]Benedikt Alkin, Andreas Fürst, Simon Schmid, Lukas Gruber, Markus Holzleitner, and Johannes Brandstetter. Universal Physics Transformers: A Framework For Efficiently Scaling Neural Operators. In Advances in Neural Information Processing Systems 37, Vancouver, BC, Canada, 2024. Neural Information Processing Systems Foundation, Inc. (NeurIPS).arxiv.org/abs/2402.12365
- [4]Thomas Arlt. Analyse des Stabilitätsverhaltens magnetohydrodynamischer Kanalströmungen. PhD thesis, Karlsruher Institut für Technologie (KIT), 2018.DOI
- [5]Jannis Becktepe, Aleksandra Franz, Nils Thuerey, and Sebastian Peitz. Plug-and-play benchmarking of reinforcement learning algorithms for large-scale flow control. In Forty-third International Conference on Machine Learning, 2026.arxiv.org/abs/2601.15015
- [6]Gerben Beintema, Corbetta Alessandro, Biferale Luca, and Federico Toschi. Controlling Rayleigh–Bénard convection via reinforcement learning. Journal of Turbulence, 21:585–605, 2020. ISSN null. doi: 10.1080/14685248.2020.1797059.DOI
- [7]Nathan Bell, Luke N. Olson, Jacob Schroder, and Ben Southworth. PyAMG: Algebraic multigrid solvers in python. Journal of Open Source Software, 8, 2023.
- [8]Ivan Belyaev, Dmitry Krasnov, Yuri Kolesnikov, Dmitry Biryukov, Denis Chernysh, Oleg Zikanov, and Yaroslav Listratov. Effects of symmetry on magnetohydrodynamic mixed convection flow in a vertical duct. Physics of Fluids, 32, 2020.DOI
- [9]Deniz A. Bezgin, Aaron B. Buhendwa, and Nikolaus A. Adams. JAX-Fluids 2.0: Towards HPC for differentiable CFD of compressible two-phase flows. Computer Physics Communications, 2025. doi: 10.1016/j.cpc.2024.109433.DOI
- [10]Steven L. Brunton, Bernd R. Noack, and Petros Koumoutsakos. Machine Learning for Fluid Mechanics. Annual Review of Fluid Mechanics, 52, 2020.
- [11]Richard H. Byrd, Peihuang Lu, Jorge Nocedal, and Ciyou Zhu. A limited memory algorithm for bound constrained optimization. SIAM Journal on Scientific Computing, 16, 1995.
- [12]P. A. Davidson. An Introduction to Magnetohydrodynamics. Cambridge University Press, 2001.
- [13]Jonas Degrave, Federico Felici, Jonas Buchli, Michael Neunert, Brendan Tracey, Francesco Carpanese, Timo Ewalds, Roland Hafner, Abbas Abdolmaleki, Diego de las Casas, Craig Donner, Leslie Fritz, Cristian Galperti, Andrea Huber, James Keeling, Maria Tsimpoukelli, Jackie Kay, Antoine Merle, Jean-Marc Moret, Seb Noury, Federico Pesamosca, David Pfau, Olivier Sauter, Cristian Sommariva, Stefano Coda, Basil Duval, Ambrogio Fasoli, Pushmeet Kohli, Koray Kavukcuoglu, Demis Hassabis, and Martin Riedmiller. Magnetic control of Tokamak plasmas through deep reinforcement learning. Nature, 602, 2022.DOI
- [14]Rupert W. Eardley-Brunt, Aleksander Dubas, and Andrew Davis. On scalable liquid-metal MHD solvers for fusion breeder blanket multiphysics applications. Plasma Physics and Controlled Fusion, 66, 2024.
- [15]Aleksandra Franz, Hao Wei, Luca Guastoni, and Nils Thuerey. PICT–A differentiable, GPU-accelerated multi-block PISO solver for simulation-coupled learning tasks in fluid dynamics. Journal of Computational Physics, 544, 2026.DOI
- [16]C. Daniel Freeman, Erik Frey, Anton Raichuk, Sertan Girgin, Igor Mordatch, and Olivier Bachem. Brax - A Differentiable Physics Engine for Large Scale Rigid Body Simulation. In Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, December 2021, Virtual, 2021.arxiv.org/abs/2106.13281
- [17]Xavier Garcia, Arnau Miró, Pol Suárez, Francisco Alcántara-Ávila, Jean Rabault, Bernat Font, Oriol Lehmkuhl, and Ricardo Vinuesa. Deep-reinforcement-learning-based separation control in a two-dimensional airfoil. International Journal of Heat and Fluid Flow, 116, 2025.arxiv.org/abs/2502.16993
- [18]Luca Guastoni, Jean Rabault, Philipp Schlatter, Hossein Azizpour, and Ricardo Vinuesa. Deep reinforcement learning for turbulent drag reduction in channel flows. The European Physical Journal E, 46, 2023.arxiv.org/abs/2301.09889
- [19]Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, 2018.arxiv.org/abs/1801.01290
- [20]Nikolaus Hansen and Andreas Ostermeier. Completely Derandomized Self-Adaptation in Evolution Strategies. Evolutionary Computation, 9, 2001.pubmed.ncbi.nlm.nih.gov/11382355
- [21]Philipp Holl and Nils Thuerey. ΦFlow (PhiFlow): Differentiable simulations for PyTorch, Tensor-Flow and jax. In International Conference on Machine Learning. PMLR, 2024.
- [22]Philipp Holl, Nils Thuerey, and Vladlen Koltun. Learning to control pdes with differentiable physics. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020, 2020.arxiv.org/abs/2001.07457
- [23]Benjamin Holzschuh, Qiang Liu, Georg Kohl, and Nils Thuerey. PDE-transformer: Efficient and versatile transformers for physics simulations. In Proceedings of the 42nd International Conference on Machine Learning, Proceedings of Machine Learning Research. PMLR, 2025.arxiv.org/abs/2505.24717
- [24]Dmitry Krasnov, Ali Akhtari, Oleg Zikanov, and Jörg Schumacher. Tensor-product-Thomas elliptic solver for liquid-metal magnetohydrodynamics. Journal of Computational Physics, 474, 2023.DOI
- [25]Clovis R. Maliska. Fundamentals of Computational Fluid Dynamics: The Finite Volume Method, volume 135 of Fluid Mechanics and Its Applications. Springer International Publishing, 2023.
- [26]Thorben Markmann, Michiel Straat, Sebastian Peitz, and Barbara Hammer. Control of Rayleigh-Bénard Convection: Effectiveness of Reinforcement Learning in the Turbulent Regime. arXiv preprint arXiv:2504.12000, 2025.
- [27]Elisabet Mas de les Valls. Development of a Simulation Tool for MHD Flows under Nuclear Fusion Conditions. PhD thesis, Universitat Politècnica de Catalunya, 2011.
- [28]Ricard Montalà, Bernat Font, Pol Suárez, Jean Rabault, Oriol Lehmkuhl, Ricardo Vinuesa, and Ivette Rodriguez. Flow separation control of an infinite wing section via multi-agent reinforcement learning. Journal of Fluid Mechanics, 1040, 2026.
- [29]Antoine Mouchamps, Arthur Malherbe, Adrien Bolland, and Damien Ernst. Gym-TORAX: Open-source software for integrating reinforcement learning with plasma control simulators in tokamak research. Software Impacts, 27, 2026.
- [30]Ming-Jiu Ni, Ramakanth Munipalli, Peter Huang, Neil B. Morley, and Mohamed A. Abdou. A current density conservative scheme for incompressible MHD flows at a low magnetic Reynolds number. Part II: On an arbitrary collocated mesh. Journal of Computational Physics, 227, 2007.
- [31]Jean Rabault, Miroslav Kuchta, Atle Jensen, Ulysse Réglade, and Nicolas Cerardi. Artificial neural networks trained through deep reinforcement learning discover control strategies for active flow control. Journal of Fluid Mechanics, 865, 2019.
- [32]V. I. Rachkov, A. P. Sorokin, and A. V. Zhukov. Thermal Hydraulic Studies of Liquid-Metal Coolants in Nuclear-Power Facilities. High Temperature, 56, 2018.
- [33]Antonin Raffin, Ashley Hill, Adam Gleave, Anssi Kanervisto, Maximilian Ernestus, and Noah Dormann. Stable-Baselines3: Reliable reinforcement learning implementations. Journal of Machine Learning Research, 22, 2021.
- [34]J. W. Ruge and K. Stüben. 4. Algebraic Multigrid. In Multigrid Methods, pages 73–130. Society for Industrial and Applied Mathematics, 1987.DOI
- [35]Leonard Storcks, Nils Thuerey, and Tobias Buck. Per Astronomix ad Astra: High-Order Differentiable (Magneto)hydrodynamics with Energy-Conserving Self-Gravity. arXiv preprint arXiv:2607.18176, 2026.arxiv.org/abs/2607.18176
- [36]Michiel Straat, Thorben Markmann, Sebastian Peitz, and Barbara Hammer. Improving the robustness of control of chaotic convective flows with domain-informed reinforcement learning. In 2026 International Joint Conference on Neural Networks (IJCNN), pages 1–8, 2026.arxiv.org/abs/2511.00272
- [37]Toshio Tagawa, Guillaume Authié, and René Moreau. Buoyant flow in long vertical enclosures in the presence of a strong horizontal magnetic field. Part 1. Fully-established flow. European Journal of Mechanics - B/Fluids, 21, 2002.DOI
- [38]Alessandro Tassone. Magnetic induction and electric potential solvers for incompressible MHD flows. In Proceedings of CFD with OpenSource Software, 2016.DOI
- [39]Matteo Tomasetto, Nicolò Botteghi, Gabriele Bruni, and Andrea Manzoni. Physics-enhanced reinforcement learning for real-time optimal control of dynamical systems, 2026.arxiv.org/abs/2607.16177
- [40]Joel Vasanth, Jean Rabault, Francisco Alcántara-Ávila, Mikael Mortensen, and Ricardo Vinuesa. Multi-agent Reinforcement Learning for the Control of Three-Dimensional Rayleigh–Bénard Convection. Flow, Turbulence and Combustion, 2024.DOI
- [41]Colin Vignon, Jean Rabault, Joel Vasanth, Francisco Alcántara-Ávila, Mikael Mortensen, and Ricardo Vinuesa. Effective control of two-dimensional Rayleigh–Bénard convection: Invariant multi-agent reinforcement learning is all you need. Physics of Fluids, 35, 2023.
- [42]Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, Stéfan J. van der Walt, Matthew Brett, Joshua Wilson, K. Jarrod Millman, Nikolay Mayorov, Andrew R. J. Nelson, Eric Jones, Robert Kern, Eric Larson, C J Carey, Ilhan Polat, Yu Feng, Eric W. Moore, Jake VanderPlas, Denis Laxalde, Josef Perktold, Robert Cimmrman, Ian Henriksen, E. A. Quintero, Charles R. Harris, Anne M. Archibald, António H. Ribeiro, Fabian Pedregosa, Paul van Mulbregt, and SciPy 1.0 Contributors. SciPy 1.0: Fundamental algorithms for scientific computing in python. Nature Methods, 17, 2020.
- [43]John S. Walker. Magnetohydrodynamic flows in rectangular ducts with thin conducting walls. Part I: Constant area and variable area ducts with strong uniform magnetic fields. Journal de Mécanique, 20:79–112, 1981.
- [44]H. G. Weller, G. Tabor, H. Jasak, and C. Fureby. A tensorial approach to computational continuum mechanics using object-oriented techniques. Computers in Physics, 12, 1998.DOI
- [45]P.J. Werbos. Backpropagation through time: What it does and how to do it. Proceedings of the IEEE, 78, 1990.DOI
- [46]Haixu Wu, Huakun Luo, Haowen Wang, Jianmin Wang, and Mingsheng Long. Transolver: A fast transformer solver for PDEs on general geometries. In Proceedings of the 41st International Conference on Machine Learning, volume 235 of Proceedings of Machine Learning Research. PMLR, 2024.arxiv.org/abs/2402.02366
- [47]Eliot Xing, Vernon Luk, and Jean Oh. Stabilizing reinforcement learning in differentiable multi-physics simulation. In The Thirteenth International Conference on Learning Representations, ICLR 2025, Singapore, April 24-28, 2025, 2025.DOI
- [48]Jie Xu, Viktor Makoviychuk, Yashraj Narang, Fabio Ramos, Wojciech Matusik, Animesh Garg, and Miles Macklin. Accelerated Policy Learning with Parallel Differentiable Simulation. In International Conference on Learning Representations, 2021.arxiv.org/abs/2204.07137
- [49]Takatoshi Yanagisawa, Yozo Hamano, Takehiro Miyagoshi, Yasuko Yamagishi, Yuji Tasaka, and Yasushi Takeda. Convection patterns in a liquid metal under an imposed horizontal magnetic field. Physical Review E, 2013.pubmed.ncbi.nlm.nih.gov/24483570
- [50]Pietro Zanotta, Dibakar Roy Sarkar, Honghui Zheng, Somdatta Goswami, and Jan Drgona. CINOC: Cardinality-invariant neural operator policies for scalable PDE control. In Forty-Third International Conference on Machine Learning, 2026.arxiv.org/abs/2605.25867
- [51]Oleg Zikanov and Yaroslav Listratov. Numerical investigation of MHD heat transfer in a vertical round tube affected by transverse magnetic field. Fusion Engineering and Design, 113, 2016.DOI
- [52]Oleg Zikanov, Dmitry Krasnov, Thomas Boeck, and Semion Sukoriansky. Decay of turbulence in a liquid metal duct flow with transverse magnetic field. Journal of Fluid Mechanics, 867, 2019.
- [53]Milan Zmitko, Noël Thomas, Antonella LiPuma, Laurent Forest, Laurence Cogneau, Jörg Rey, Heiko Neuberger, and Yves Poitevin. The European ITER test blanket modules: Progress in development of fabrication technologies towards standardization. Fusion Engineering and Design, 109–111, 2016.DOI
















