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 |
| click >= 7.0 | Windows |
| joblib >= 0.13.2 | OSX |
| matplotlib >= 3.3.1 | |
| numba >= 0.51.2 | |
| numpy >= 1.18.5 | |
| ffmpeg (optional) |
Install
$ conda create --name mattflow -y
$ conda activate mattflow
$ conda install -c mattasa mattflow
$ pip install mattflow
Usage
$ mattflow [OPTIONS]
Options:
-m, --mode [drop|drops|rain] [default: drops]
-d, --drops INTEGER number of drops to generate [default: 5]
-s, --style [water|contour|wireframe]
[default: wireframe]
--rotation / --no-rotation rotate the domain [default: True]
-b, --basin render the fluid basin
--show / --no-show [default: True]
--save
--format [mp4|gif] [default: mp4]
--fps INTEGER [default: 18]
--dpi INTEGER [default: 75]
--fig-height INTEGER figure height (width is 1.618 * height)
[default: 18]
--help Show this message and exit.
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
- 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
TODO
- CI
- 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
Release files for mattflow 1.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mattflow-1.4.3.tar.gz | 25.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mattflow-1.4.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 68.9 kB
Release files / mattflow-1.4.3.tar.gz
| Download URL | mattflow-1.4.3.tar.gz |
|---|---|
| Size | 25.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24ff335f61778a42227877e0249accc0eb0b83ebed1681c39ceeacc8e35379b5
|
|
BLAKE2b-256 checksum How to use checksums |
d3b61b9fba00347b2844803717163b0bef3836a2c10700f5d880cab79a4cda2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/0.0.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.9
|
Release files / mattflow-1.4.3-py3-none-any.whl
| Download URL | mattflow-1.4.3-py3-none-any.whl |
|---|---|
| Size | 43.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2d1f3b7b9635cbe9e792afd496bd2cf1359ba6b66234f25ee0eb172c3f62373
|
|
BLAKE2b-256 checksum How to use checksums |
adc41b3570711cbd322e5f71bc71c84877c9b312d4b6251b8b4fd53ef2c6cac0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/0.0.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.9
|