A new gradient descent divergence cleaning method with optimized high-order low-dissipation TENO schemes for ideal magnetohydrodynamic simulations

IF 3.4 2区 物理与天体物理 Q1 COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS
Zeyu Chen , Kuangxu Chen
{"title":"A new gradient descent divergence cleaning method with optimized high-order low-dissipation TENO schemes for ideal magnetohydrodynamic simulations","authors":"Zeyu Chen ,&nbsp;Kuangxu Chen","doi":"10.1016/j.cpc.2025.109744","DOIUrl":null,"url":null,"abstract":"<div><div>In this study, we present a new Gradient Descent Divergence Cleaning (GDDC) method, integrated with optimized high-order low-dissipation Target Essentially Non-Oscillatory (TENO) schemes, for the simulation of ideal magnetohydrodynamic (MHD) flows while ensuring a robust divergence-free constraint. The GDDC method constructs a loss function that quantifies the total divergence error. By computing the gradient of this loss function with respect to the magnetic field, the method integrates seamlessly into the Runge-Kutta time-stepping scheme to enable divergence cleaning consistent with the spatial discretization in a discrete sense. Unlike traditional divergence cleaning methods that depend on a non-physical variable <em>ψ</em> and associated parameters controlling its transport velocity and decay rate, the GDDC method introduces only a single parameter, <em>η</em>, and preserves the original hyperbolic eigensystem of the ideal MHD equations. Numerical experiments demonstrate that the method is highly insensitive to variations of <em>η</em> across three orders of magnitude. Additionally, we build the GDDC method upon the optimized TENO (TENO-OPT) schemes. Leveraging the TENO schemes' inherent ability to detect discontinuities, dynamic linear weights are used to combine sub-stencils into an optimal large stencil that avoids crossing discontinuities. Extensive numerical tests demonstrate that the GDDC method coupled with the 5th- and 6th-order TENO-OPT schemes effectively captures discontinuities in ideal MHD flows with low dissipation and without spurious oscillations. We developed our code using NVIDIA's CUDA Fortran and evaluated its performance on a single NVIDIA A800 GPU. For an ideal MHD simulation that employs a 5th-order TENO-OPT scheme, each Runge-Kutta time-stepping stage took approximately 1.118 seconds at a grid resolution of 0.268 billion points. Both computational time and GPU memory usage increase linearly with grid size, with roughly 4 million grid points requiring 1 GB of memory. Based on these scaling trends, the enhanced memory capacity of the NVIDIA H200 GPU could theoretically support up to approximately 0.560 billion grid points. The code is available on <span><span>https://github.com/FallenCastle/MHD_GDDC_GPU</span><svg><path></path></svg></span>.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"315 ","pages":"Article 109744"},"PeriodicalIF":3.4000,"publicationDate":"2025-07-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computer Physics Communications","FirstCategoryId":"101","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0010465525002462","RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS","Score":null,"Total":0}
引用次数: 0

Abstract

In this study, we present a new Gradient Descent Divergence Cleaning (GDDC) method, integrated with optimized high-order low-dissipation Target Essentially Non-Oscillatory (TENO) schemes, for the simulation of ideal magnetohydrodynamic (MHD) flows while ensuring a robust divergence-free constraint. The GDDC method constructs a loss function that quantifies the total divergence error. By computing the gradient of this loss function with respect to the magnetic field, the method integrates seamlessly into the Runge-Kutta time-stepping scheme to enable divergence cleaning consistent with the spatial discretization in a discrete sense. Unlike traditional divergence cleaning methods that depend on a non-physical variable ψ and associated parameters controlling its transport velocity and decay rate, the GDDC method introduces only a single parameter, η, and preserves the original hyperbolic eigensystem of the ideal MHD equations. Numerical experiments demonstrate that the method is highly insensitive to variations of η across three orders of magnitude. Additionally, we build the GDDC method upon the optimized TENO (TENO-OPT) schemes. Leveraging the TENO schemes' inherent ability to detect discontinuities, dynamic linear weights are used to combine sub-stencils into an optimal large stencil that avoids crossing discontinuities. Extensive numerical tests demonstrate that the GDDC method coupled with the 5th- and 6th-order TENO-OPT schemes effectively captures discontinuities in ideal MHD flows with low dissipation and without spurious oscillations. We developed our code using NVIDIA's CUDA Fortran and evaluated its performance on a single NVIDIA A800 GPU. For an ideal MHD simulation that employs a 5th-order TENO-OPT scheme, each Runge-Kutta time-stepping stage took approximately 1.118 seconds at a grid resolution of 0.268 billion points. Both computational time and GPU memory usage increase linearly with grid size, with roughly 4 million grid points requiring 1 GB of memory. Based on these scaling trends, the enhanced memory capacity of the NVIDIA H200 GPU could theoretically support up to approximately 0.560 billion grid points. The code is available on https://github.com/FallenCastle/MHD_GDDC_GPU.
基于高阶低耗散TENO优化方案的梯度下降散度清洗新方法
在这项研究中,我们提出了一种新的梯度下降散度清洗(GDDC)方法,结合优化的高阶低耗散目标本质非振荡(TENO)方案,用于模拟理想磁流体(MHD)流动,同时确保鲁棒无散度约束。GDDC方法构造了一个量化总散度误差的损失函数。通过计算该损失函数相对于磁场的梯度,该方法与龙格-库塔时间步进方案无缝集成,使散度清理在离散意义上与空间离散一致。传统的散度清理方法依赖于非物理变量ψ和相关参数来控制其输运速度和衰减率,而GDDC方法只引入单个参数η,并保留了理想MHD方程的原始双曲特征系统。数值实验表明,该方法对η在三个数量级上的变化高度不敏感。此外,我们在优化的TENO (TENO- opt)方案上建立了GDDC方法。利用TENO方案固有的检测不连续点的能力,动态线性权重被用来将子模板组合成一个最优的大型模板,以避免交叉不连续点。大量的数值试验表明,GDDC方法与5阶和6阶TENO-OPT格式相结合,可以有效地捕获低耗散和无伪振荡的理想MHD流动中的不连续面。我们使用NVIDIA的CUDA Fortran开发代码,并在单个NVIDIA A800 GPU上评估其性能。对于采用5阶TENO-OPT方案的理想MHD模拟,每个龙格-库塔时间步进阶段大约需要1.118秒,网格分辨率为0.2.68亿点。计算时间和GPU内存使用量都随着网格大小线性增加,大约400万个网格点需要1gb内存。基于这些扩展趋势,NVIDIA H200 GPU的增强内存容量理论上可以支持大约5.6亿个网格点。代码可在https://github.com/FallenCastle/MHD_GDDC_GPU上获得。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Computer Physics Communications
Computer Physics Communications 物理-计算机:跨学科应用
CiteScore
12.10
自引率
3.20%
发文量
287
审稿时长
5.3 months
期刊介绍: The focus of CPC is on contemporary computational methods and techniques and their implementation, the effectiveness of which will normally be evidenced by the author(s) within the context of a substantive problem in physics. Within this setting CPC publishes two types of paper. Computer Programs in Physics (CPiP) These papers describe significant computer programs to be archived in the CPC Program Library which is held in the Mendeley Data repository. The submitted software must be covered by an approved open source licence. Papers and associated computer programs that address a problem of contemporary interest in physics that cannot be solved by current software are particularly encouraged. Computational Physics Papers (CP) These are research papers in, but are not limited to, the following themes across computational physics and related disciplines. mathematical and numerical methods and algorithms; computational models including those associated with the design, control and analysis of experiments; and algebraic computation. Each will normally include software implementation and performance details. The software implementation should, ideally, be available via GitHub, Zenodo or an institutional repository.In addition, research papers on the impact of advanced computer architecture and special purpose computers on computing in the physical sciences and software topics related to, and of importance in, the physical sciences may be considered.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信