D3Q19 lattice solver
Collision and streaming operations update independent lattice sites, making the method well suited to GPU parallelism.
Profiled and reworked a lattice Boltzmann GPU solver to remove hidden compute and memory bottlenecks—then validated every speedup against the simulation's accuracy limits.
Mechanical Engineering Intern · Petrobras / Geoenergia Lab, UDESC · Jun–Aug 2025 · Santa Catarina, Brazil
The lab's higher-order physics kernels were running roughly 10× slower than expected. The task was not simply to make code faster—it was to find the actual limiting hardware behavior and preserve valid CFD results.
Collision and streaming operations update independent lattice sites, making the method well suited to GPU parallelism.
Precision and grid changes were checked against established simulation tolerances at every step.
I owned kernel profiling, targeted optimization, grid-generation tooling, and technical handoff to the lab.



Manual timers and refactoring did not explain the slowdown. Hardware-level profiling did: Nsight Compute exposed lingering double-precision FMA instructions in the hottest loops and Nsight Systems showed where runtime accumulated.
Locate expensive kernels and distinguish compute time from memory stalls.
Use source-correlated metrics to identify FP64 instructions and access patterns.
Re-run benchmark cases and confirm the solution remains inside tolerance.


Removed unnecessary double-precision work from hot loops while checking error against simulation tolerances.
Restructured thread-to-data mapping to reduce long scoreboard stalls and improve warp efficiency by 60%.
Cut peak shared-memory use from 56 KB to 36 KB, allowing more active work on the same hardware.
The precision and kernel changes produced the largest throughput improvement, with higher-order kernels improving by roughly 500% while remaining inside the lab's validation limits.
Boundary instability required a geometry change, not another low-level optimization. I generated multiresolution interfaces with a fine lattice near boundaries and a coarser interior.

The grid tool increased peak simulated Reynolds number by 33% without reducing throughput. I also delivered ParaView scripts, an Nsight manual, and a training video so the lab could repeat the workflow.