Home C++ Lua GitHub Games Math Myself Contact
Hydrodynamics in Javascript
I'm teaching myself CFD in my free time. I'm focusing on hyperbolic solvers because they seem particularly of interest in the field of numerical relativity, which I am aiming to apply these lessons towards.

Here's what I've got so far:

1D CFD Simulation in WebGL - GitHub
• Supports Euler, Runge-Kutta-2, Runge-Kutta-4, and Iterative Crank-Nicolson-3 explicit integration.
• Supports a number of flux limiters.
• Supports mirror, periodic, and free-flow boundary conditions.
• Compressible Euler fluid equation simulation with the following:
Initial Conditions:
• Sod shock tube test initial conditions
• Sedov blast test initial conditions (works under the Burger's solver, breaks under the Roe solver unless the limiter is set to "donor cell")
• simple bell curve perturbation
Solvers:
• Burgers / Explicit Integration
• Burgers / Implicit Integration of Backward Euler via Gauss-Seidel
• Roe / Explicit Integration
• ADM formalism (from Alcubierre's Numerical Relativity) is half working, works best with "donor cell" limiter, but barely pulls along at that.
• SRHD with Roe Solver and Sod shock tube initial conditions is in the works.

2D CFD Simulation in WebGL - GitHub
• Supports Euler, Runge-Kutta-2, Runga-Kutta-4, and Iterative Crank-Nicolson-3 explicit integration.
• Supports a number of flux limiters.
• Supports mirror, periodic, and free-flow boundary conditions per-side of the grid.
• Supports arbitrary boundaries on the rectangular grid (see "Sod w/Cylinder" initial conditions).
• Supports gravity / external forces.
• Compressible Euler fluid equation simulation with the following:
Initial Conditions:
• Sod shock tube test extended to two dimensions
• Sod shock tube test with a cylinder obstacle
• simple bell curve perturbation
• Kelvin-Hemholtz instability demo (left and right boundaries must be set to "periodic" to best observe the phenomenon)
• Rayleigh-Taylor instability demo (left and right boundaries must be set to "periodic" and external force Y direction must be set to "1" to best observe the phenomenon)
Solvers:
• Burgers / Explicit Integration
• Burgers / Implicit Integration of Backward Euler via Gauss-Seidel
• Roe / Explicit Integration
2D GPGPU-driven CFD Simulation in WebGL - GitHub
• Supports a number of flux limiters.
• Compressible Euler fluid equation simulation with the following:
Initial Conditions:
• Sod shock tube test extended to two dimensions
• Sod shock tube test with a cylinder obstacle (currently only works with the Burgers solver)
• simple bell curve perturbation
• Kelvin-Hemholtz instability demo (currently only works with Burgers solver)
Solvers:
• Burgers / Explicit Integration
• Roe / Explicit Integration
Sources:
Hydrodynamics II: Numerical methods and applications
I do like CFD's Free CFD Codes
"Riemann Solvers and Numerical Methods for Fluid Dynamics," Toro
http://people.nas.nasa.gov/~pulliam/Classes/New_notes/euler_notes.pdf