Skip to content

DOI CUDA Fortran Modern Fortran Python Docs

OUxSBLI

OUxSBLI is a GPU-accelerated CFD code with Python-API written in CUDA Fortran. It employs explicit high-order finite-difference schemes on a rectilinear grid (3D and 2D solvers) and a curvilinear grid.

Documentation

Guide Description
Quick Start Run your first simulation in minutes
Installation Full setup guide for a fresh machine
Configuration config.fypp reference and rebuild workflow
Theory Numerical methods and governing equations
Python API ouxsbli package reference

Dependency

CUDA Fortran

  • NVIDIA HPC SDK 24.x or 25.x — provides mpif90 and bundled MPI
  • CMake 3.18 or newer
  • fypp (pip install fypp) — Fortran preprocessor
  • ParaView — for visualizing VTK output

Python API

  • Python 3.10 or newer
  • numpy
  • scipy
  • vtk

Usage

CUDA Fortran

  1. Go to a case directory (e.g. NS Taylor-Green vortex):
cd 3D_solver/NSTGV
  1. Edit config.fypp to choose the physics model, convective scheme, spatial order, boundary conditions, and other compile-time options:
#:set VISC   = 'NS'      # 'Euler', 'NS', or 'LES'
#:set SCHEME = 'SLAU'    # 'KEEP', 'SLAU', or 'Hybrid'
#:set ORDER  = 6         # spatial order: 2, 4, or 6
#:set BC_X   = False     # False → periodic; True → wall/inflow BCs
#:set BC_Y   = False
#:set BC_Z   = False

See docs/configuration.md for the full reference.

  1. Edit mod_globals.f90 to set grid size, domain lengths, physical parameters, and GPU thread-block sizes:
integer, parameter :: nx = 513
integer, parameter :: ny = 513
integer, parameter :: nz = 513
real(8), parameter :: Re = 1600.d0
  1. Edit set.f90 if you need to change the grid geometry, initial conditions, or boundary condition routines.

  2. Build with CMake:

cmake -B build && cmake --build build -j
  1. Run the simulation:
cd build && mpirun -n 2 ./a.out

VTK output files (Q00000.vtr, Q00001.vtr, …) appear in the data/ directory.

Profiling: In some case directories, profile.sh runs nsys/ncu profiling:

cd build && bash ../profile.sh

Python API

  1. Install the ouxsbli package:
pip install -e ".[dev]"
  1. Create a Case, build, and run:
import pathlib
from ouxsbli import Case

case = Case(
    source  = "3D_solver/NSTGV",
    workdir = "/tmp/my_run",
    # physics (maps to config.fypp)
    visc    = "NS",
    scheme  = "SLAU",
    accuracy = 6,
    # grid (maps to mod_globals.f90)
    nx = 128,
    ny = 128,
    nz = 128,
)

case.build()
case.run(nranks=2)  # mpirun -n 2 ./a.out

See docs/api.md for the full API reference.

Discretization

Spatial (Convection terms)

  • Kinetic energy and entropy preserving (KEEP) scheme
  • Simple low-dissipation AUSM (SLAU) scheme
  • KEEP / SLAU hybrid scheme

Spatial (Viscous terms)

  • ME4-Base
  • Gaitonde and Visbal's 2nd-order scheme

Spatial SGS

  • Selective mixed scale model

Temporal

  • 3-stage TVD Runge-Kutta
  • 4-stage classical Runge-Kutta

Validations and visualizations

Supersonic Taylor-Green vortex

The results are consistent with Lusher's results.

  • Numerical setup
$Re$ $1600$
$Ma$ $1.25$
$N_x \times N_y \times N_z$ $512\times512\times512$
@article{lusher2021assessment,
  title={Assessment of low-dissipative shock-capturing schemes for the compressible Taylor--Green vortex},
  author={Lusher, David J and Sandham, Neil D},
  journal={AIAA Journal},
  volume={59},
  number={2},
  pages={533--545},
  year={2021},
  publisher={American Institute of Aeronautics and Astronautics}
}
TGV_kinetic_energy
TGV_total_enstrophy

Shock Boundary Layer Interaction (SBLI)

SBLI

Wall Cp and the separation-bubble location match digitized reference data (Moro et al., 2D_solver/SBLI/ref/), verified by ouxsbli/tests/test_sbli.py.

2D Laminar Boundary Layer

Cf and the velocity profile match the Blasius similarity solution, verified by ouxsbli/tests/test_bl.py.

2D Oblique Shock

M=2 freestream with θ=8° flow deflection. Pre- and post-shock states agree with the Rankine-Hugoniot relations within 2% and 5% respectively, verified by ouxsbli/tests/test_os.py.

NACA0012

NACA

Related Publication

This repository contains the implementation used in the following publication:

Jun Hatayama, Kento Tanaka, and Toshinori Kouchi. "Nonlinear causal relationship between separation bubbles and reflected shock wave in shock wave/turbulent boundary layer interaction based on information theory." Computers & Fluids (2026): 107016.

@article{hatayama2026nonlinear,
  title={Nonlinear causal relationship between separation bubbles and reflected shock wave in shock wave/turbulent boundary layer interaction based on information theory},
  author={Hatayama, Jun and Tanaka, Kento and Kouchi, Toshinori},
  journal={Computers \& Fluids},
  pages={107016},
  year={2026},
  publisher={Elsevier}
}

The repository was made publicly available after publication to improve reproducibility. However, this version may differ slightly from the version used in the paper.

AI-Assisted Development

Development during 2024 and 2025 was primarily conducted by the project owner.
Starting in 2026, the project expanded its contributor base and introduced AI-assisted "vibe coding" workflows using Claude Code.

To maintain transparency, we aim to clearly distinguish which parts of the codebase and development workflow involve AI-generated content or AI-assisted modifications. In addition, as part of our effort to share practical knowledge on AI-assisted development in the HPC community, we provide Claude Code plan files under ./docs/plans.

License

This project is under BSD 3-Clause License

About

GPU-accelerated CFD code with Python API written in CUDA Fortran.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages