Computational Fluid Mechanics Work
15/01/2026: Update
I have been working on other incompressible fluid flow solvers. I have started a code which uses the pressure-Poisson approach (primitive variable approach of Harlow and Welch), tested on a channel flow. I am just working on the pressure boundary conditions.
My goal is to have a pressure-Poisson and Artifical Compressibility solver written in Python, alongside the vorticity-based codes I have already written. Then my goal is to write these in Fortran and C for practice, and to look at speed gains. Then maybe I will consider writing in C++.
I will then try to develop the vector potential-vorticity formulation further and work towards a publication.
21/10/2025: Cranfield Thesis
I worked on incompressible flow modelling for my thesis at Cranfield. That means you can neglect density variation of the fluid medium, which usually means low speed. It means the divergence of velocity is zero. This is kind of an ideal, pure mathematical system which can sometimes be used to map reality accurately.
I wrote the streamfunction-vorticity formulation first, which is only applicable to two dimensions. This is because the streamfunction only exists in two dimensions. I validated the results produced by my code using the lid-driven square cavity benchmark (2D), comparing centreline velocities. The code was written in Python and is currently public. Link.
The figure above shows divergence of velocity for the vector potential-vorticity formulation. It is a slice of the centreplane of a cube, where the cube is full of continuous fluid, and the lid is moving from left to right. This is a standard benchmark against which to test the results of your code. The results are well-known. In both the streamfunction-vorticity formulation (2D) and the vector-potential vorticity formulation (3D), the divergence of velocity is satisfied explicitly. Hence why divergence above is small. This is the advantage of vorticity formulations over, say, the primitive variable approach. The main focus of my thesis was the vector-potential vorticity formulation, which is harder to implement. This method requires more work to be workable. The open source code is available: Link.
In layman's terms:
Imagine a solid cube full of any fluid - air, water, Coca-Cola. Now imagine moving the upper surface in some direction. How would the fluid in the container move? What pattern would it make? Solving a complex equation approximately, with the aid of a computer, allows you predict what the patterns would be. You can say, at any point in the cube (for the most part), and even at any particular instance in time, precisely what the temperature, pressure, speed, and direction of motion of the fluid will be. The resulting pattern that your code produces, can be compared against experiments, so you can check it's true. Here's one such pattern:
What does this show? The speed of motion of the fluid in the up and down direction, on a cross-section of the cube along the centreplane. Lid motion is from left to right.