# Torch-DPhys: A Torch-Native, MOOSE-Compatible Framework for Differentiable Physics Simulation and Hybrid Machine Learning Integration

DevFeed: [Torch-DPhys: A Torch-Native, MOOSE-Compatible Framework for Differentiable Physics Simulation and Hybrid Machine Learning Integration](<https://devfeed.tech/articles/torch-dphys-a-torch-native-moose-compatible-framework-for-differentiable-physics-simulation-and-hybrid-machine-learning-integration-93276.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.24301>)

Author: Akzhol Almukhametov, Yang Liu

Published: 2026-10-21T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [PyTorch](<https://devfeed.tech/topics/pytorch.md>), [Machine learning](<https://devfeed.tech/topics/machine-learning.md>), [Finite Element Method (FEM)](<https://devfeed.tech/topics/finite-element-method.md>), [Predictive AI](<https://devfeed.tech/topics/predictive-ai.md>)

Tags: [adaptive](<https://devfeed.tech/tags/adaptive.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [control](<https://devfeed.tech/tags/control.md>), [controller](<https://devfeed.tech/tags/controller.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [framework](<https://devfeed.tech/tags/framework.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [hybrid](<https://devfeed.tech/tags/hybrid.md>), [inference](<https://devfeed.tech/tags/inference.md>), [kernels](<https://devfeed.tech/tags/kernels.md>), [learning](<https://devfeed.tech/tags/learning.md>), [linear](<https://devfeed.tech/tags/linear.md>), [machine](<https://devfeed.tech/tags/machine.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [nuclear](<https://devfeed.tech/tags/nuclear.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [physics](<https://devfeed.tech/tags/physics.md>), [pytorch](<https://devfeed.tech/tags/pytorch.md>), [simulation](<https://devfeed.tech/tags/simulation.md>), [time](<https://devfeed.tech/tags/time.md>), [torch](<https://devfeed.tech/tags/torch.md>)

## AI overview

Torch-DPhys is a PyTorch framework for differentiable physics simulation, implementing selected thermal-hydraulic concepts and discretizations from MOOSE's Thermal Hydraulics Module and SAM, with a preliminary continuum-mechanics extension. Tensor residuals support CPU and GPU execution, selected compiled kernels, and sparse direct solves; sensitivities come from differentiating executed operations or discrete adjoints of converged residual equations. Demonstrations include elasticity, thermal-hydraulic transients, and a molten-salt reactor. In the tested reactor case, the maximum normalized field discrepancy from SAM-Lite was 1.13 x 10⁻⁵ across 200 adaptive steps. A residual-adjoint fit recovered pump head and heating power to below 0.06% relative error from noiseless synthetic MOOSE observations. A separate three-loop demonstration trained a predictive controller by differentiating trajectory objectives through the simulation. These results illustrate potential for gradient-based inference and control; the abstract describes selected implementations and demonstrations, not comprehensive coverage.

## Source excerpt

arXiv:2610.24301v1 Announce Type: new Abstract: We present Torch-DPhys, a Torch-native framework implemented in PyTorch for differentiable physics simulation and hybrid physics-machine learning. It implements selected thermal-hydraulic modeling concepts and discretizations from MOOSE's Thermal Hydraulics Module and the System Analysis Module (SAM), with a preliminary extension to continuum mechanics. Native tensor residuals support CPU and GPU execution, compilation of selected numerical kernels, and sparse direct linear solves. Sensitivities are obtained by differentiating executed numerical operations or through discrete adjoints of converged residual equations. Verification combines analytical solutions, reference-code comparisons, and derivative checks. Demonstrations cover plane-strain elasticity, one- and two-loop thermal-hydraulic transients, and an axisymmetric molten-salt fast reactor. For the reactor, comparison with SAM-Lite gives a maximum normalized field discrepancy of 1.13 x 10^-5 over 200 adaptive time steps, demonstrating agreement between the tested discrete implementations. Selected transient sensitivities are assessed using tangent-linear calculations and finite differences on fixed time schedules. Two applications illustrate the framework's connection between simulation and optimization. A residual-adjoint parameter-identification calculation recovers nominal pump head and heating power with relative errors below 0.06% from noiseless synthetic MOOSE observations. A separate three-loop plant demonstration uses solver-in-the-loop training of a predictive controller by differentiating trajectory-level objectives through the thermal-hydraulic simulation. These examples illustrate a foundation for gradient-based inference, control, and coupled physics-machine learning models in nuclear engineering.