Semi-Implicit Method for Pressure Linked Equations (SIMPLE) is an iterative solver for the Navier-Stokes equations. This implementation uses finite volume discretization, is steady-state and only supports laminar incompressible flow. I got started on implementing transient behavior and a K-epsilon turbulence model, together with other scalar transport functions almost two years ago, but had no time due to work, so I decided to upload the parts that worked to GitHub. I have been working mostly with OpenFOAM recently, rather than implementing solvers from scratch.
I haven't looked at the code carefully: I am sure there are errors, and it's badly formatted. I definitely realized I've learnt a lot over the past few years about coding and modelling. Use it at your own risk!
The code creates a domain based on a set of boundaries specified in boundaries.cpp
. It then iterates until convergence with iterations.cpp
, alternating between estimation of velocities and pressures.
Geometries are expressed in simple, structured Cartesian grids. To make reasonable details, quite a few cells are needed, but the results can be pretty.
The code requires Eigen for its matrices. All other requirements are standard.
For implementation details, I recommend Versteeg's An Introduction to Computational Fluid Dynamics, Patankar's Numerical Heat Transfer and Fluid Flow, and Ferziger's Computational Method for Fluid Dynamics.