A Python-based fluid simulator demonstrating incompressible, isothermal, inviscid flow using an Eulerian grid-based formulation.
The solver operates on a fixed spatial grid and evolves velocity fields over time, with real-time visualisation.
- Pygame -- Visualisation interface
- NumPy -- Numerical array operations
- Numba -- JIT acceleration for performance
Install Python from the official website:
https://www.python.org/downloads/
Recommended: Python 3.11 or later
Open Command Prompt (Windows) or Terminal (Mac/Linux):
git clone https://github.com/adencorey/Eulerian_CFD.git
cd Eulerian_CFDIf Git is not installed, download the repository as a .zip from GitHub
and extract it. Then navigate to the folder:
cd absolute/path/to/Eulerian_CFDUsing a virtual environment isolates dependencies and simplifies removal later.
python -m venv venv
venv\Scripts\activatepython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtEnsure you are inside the project directory:
python -m cfdOn first run, Numba will compile optimised kernels. This may take a
short time.
After compilation, the simulation window will launch.
- Initial startup may take longer due to JIT compilation.
- Performance scales with grid resolution; higher resolutions require more CPU time.