r/computerscience

Real-time Navier-Stokes fire and smoke for games — Arakawa Jacobian + DST-I spectral Poisson solve, open source C# DLL
▲ 5 r/computerscience+1 crossposts

Real-time Navier-Stokes fire and smoke for games — Arakawa Jacobian + DST-I spectral Poisson solve, open source C# DLL

Most real-time "fluid" effects in games are not fluid simulations. They are particle systems with a noise texture. I wanted to see how close to real CFD you could get while staying at interactive frame rates on a CPU.

The result is Loucetius GCE — a 2D incompressible Navier-Stokes solver in vorticity-stream function form:

Numerical approach:

- Arakawa Jacobian for the nonlinear advection term (conserves both energy and enstrophy — this is why the simulation stays physically correct at long run times instead of accumulating numerical garbage)

- DST-I (Discrete Sine Transform type I) spectral Poisson solve to recover stream function from vorticity — exact machine precision solution every frame, not an iterative approximation

- Thom boundary conditions on solid walls

- Baroclinic torque source term driving thermally-generated vortices

- CFL-adaptive vorticity clipping for stability at high Reynolds numbers

What this gets you visually:

- Kelvin-Helmholtz roll-up instabilities appear naturally, no noise textures needed

- Correct vortex ring structure at the base of a flame

- Two flames merging into one plume with the right geometry

- Plume deflection and reattachment around obstacles

- Realistic pressure-driven expansion in explosions

The temperature, density, soot, and stream function fields are exposed as flat float arrays each frame — bind them directly to compute shaders or render textures.

Performance: Game preset (65x65) runs real-time, single core. Quality (129x129) around 100ms/step.

GitHub: https://github.com/ceh303-tech/loucetius-GCE

u/Able-Wave3034 — 4 hours ago

Just published my first research dataset on IEEE DataPort!

DOI: https://dx.doi.org/10.21227/cbef-k354

I developed a machine learning–guided virtual screening pipeline (TWCS) to identify novel NUDT5 inhibitor candidates for ER+ breast cancer.

The dataset includes:
• Top 10 prioritized compounds with consensus scores
• Full screening library and molecular descriptors
• Multi-model ML predictions (RF, GBT, SVM)

Would love feedback from anyone in ML, drug discovery, or computational biology.

reddit.com
u/Informal-Work-7124 — 15 hours ago
Week