Skip to main content

FARGO3D: a new GPU-oriented MHD code

Paper overview · Benítez-Llambay & Masset (2016, ApJS 223, 11)

paper-overview
numerical-methods
fargo3d
Author

Pablo Benítez-Llambay

Published

March 1, 2016

AI-assisted paper guide — This page is an accessible overview generated from the paper’s published content. See the published paper (ADS).

← Back to Publications · FARGO3D project page

At a glance

  • Problem: Three-dimensional magnetohydrodynamical (MHD) simulations of protoplanetary disks over thousands of orbits require high computational throughput, while maintaining separate CPU and GPU (CUDA) implementations increases development and maintenance complexity.
  • Method: FARGO3D combines a finite-difference upwind HD/MHD solver, orbital advection, and an N-body integrator with an automated C-to-CUDA source-to-source translator.
  • Result: Physics modules are written once in standard C and compiled to execute on either multi-CPU or multi-GPU MPI clusters with GPU acceleration relative to CPU runs.

Background

Protoplanetary disk simulations commonly span hundreds to thousands of planetary orbits on high-resolution 3D meshes in Cartesian, cylindrical, or spherical coordinates. While GPUs provide high floating-point throughput and memory bandwidth for explicit grid-based fluid solvers, hand-coding CUDA kernels for each physics module slows code development and maintenance.

FARGO3D was designed during my PhD with Frédéric Masset to separate physical algorithm development in C from hardware-specific CPU/GPU execution and MPI parallelization.

Architecture & numerical algorithms

  • Hydrodynamics: Staggered-mesh, dimensionally split finite-difference upwind solver (ZEUS-like operator-split transport and source steps) in 1D, 2D, and 3D across Cartesian, cylindrical, and spherical geometries.
  • Magnetohydrodynamics (MHD): Constrained transport (CT) scheme preserving \(\nabla \cdot \mathbf{B} = 0\) to machine precision, paired with the Method of Characteristics (MOC) for electromotive and Lorentz forces.
  • Fast orbital advection (FARGO): Removes the Keplerian azimuthal background velocity from the explicit CFL timestep condition for both HD and MHD setups.
  • Coupled N-body solver: Integrates planets or stellar companions interacting gravitationally with the disk.
  • Automatic C-to-CUDA parser: Mesh update routines written in standard C are translated at compile time into CUDA kernels alongside automated host/device memory management and MPI domain decomposition.

Validation & performance

The paper presents a verification suite—including hydrodynamic and MHD waves, shock tubes, magnetorotational instability (MRI) linear growth rates, and 3D planet–disk benchmarks—showing agreement with analytical solutions and previously published codes, together with performance comparisons between NVIDIA GPU and multi-core CPU executions.