A CFD python package for the shallow water equations
Project description
MattFlow
A CFD python package for the shallow water equations.
MattFlow simulates the surface of the water after any initial conditions, such as drops or stones falling on.
requirements | os |
---|---|
python3 | GNU/Linux |
numpy >= 1.18.5 | Windows |
matplotlib >= 3.3.1 | OSX |
numba >= 0.51.2 | |
joblib >= 0.13.2 | |
ffmpeg (optional) |
Install & Run
$ conda create --name mattflow -y
$ conda activate mattflow
$ conda install -c mattasa mattflow
$ mattflow
Swallow Water Equations
SWE is a simpified CFD problem which models the surface of the water, with the assumption
that the horizontal length scale is much greater than the vertical length scale.
SWE is a coupled system of 3 hyperbolic partial differential equations, that derive from the
conservation of mass and the conservation of linear momentum (Navier-Stokes) equations, in
case of a horizontal stream bed, with no Coriolis, frictional or viscours forces (wiki).
where:
η : height
u : velocity along the x axis
υ : velocity along the y axis
ρ : density
g : gravity acceleration
Structure
- configuration of the simulation via a config file
- pre-process
structured/cartesian mesh - solution
supported solvers:- Lax-Friedrichs Riemann | O(Δt, Δx2, Δy2)
- 2-stage Runge-Kutta | O(Δt2, Δx2, Δy2) | default
- MacCormack | O(Δt2, Δx2, Δy2) | experimental
- post-processing
matplotlib animation
Configuration options
- mesh sizing
- domain sizing
- initial conditions (single drop, multiple drops, rain)
- boundary conditions (currently: reflective)
- solver
- multiprocessing
- plotting style
- animation options
Currently, the simulation can be configured at the config.py
module.
TODO
- CI
- API (TUI-GUI)
- Consider Cythonizing or moving to C++
- Higher order schemes
- Include source terms
- Include viscous models
- Algorithm that converts every computational second to a real-time second,
modifying the fps at
the post-processing animation, because each iteration uses different time-step (CFL condition). - Moving objects inside the domain
- Unstructured mesh
- 3D CFD
License
GNU General Public License v3.0
Special thanks to Marios Mitalidis for the valuable feedback.
Start the flow!
(C) 2019, Athanasios Mattas
thanasismatt@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.