GithubHelp home page GithubHelp logo

trendingtechnology / lid-driven-cavity-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ceyron/lid-driven-cavity-python

1.0 1.0 0.0 6 KB

Solving the Navier-Stokes Equations in Python ๐Ÿ simply using NumPy.

License: MIT License

Python 100.00%

lid-driven-cavity-python's Introduction

Computational Fluid Dynamics in Python

lid-driven-cavity

Using NumPy to solve the equations of fluid mechanics ๐ŸŒŠ๐ŸŒŠ๐ŸŒŠ together with Finite Differences, explicit time stepping and Chorin's Projection methods.

You can find more details in the corresponding video which you can also use to code along ๐Ÿ‘ฉโ€๐Ÿ’ป. More scripts like this can be found in this GitHub Repo.

How to use

Make sure you have the relevant packages installed. These pip commands should be sufficient

pip install numpy matplotlib tqdm

Then you can either execute

python lid_driven_cavity_python_simple.py

for a simulation which runs all the way through and in the end plots a contour plot of the (pseudo) pressure with a vector field layed on top. Or you can execute

python lid_driven_cavity_python_simple_interactive_plotting.py

to get a simulation that plots throughout time. By this you can see how the Lid Driven cavity is reaching its steady-state.

Parameters

In the beginning of both files, directly after the explaining docstring, you find Python constants to adapt the scenario and the numerics.

Details on the methods

The method is based on the operator splitting due to Chorin. Also see this Wikipedia page for some details.

Big parts of the of the code, including the approach to solve the pressure-poisson equation using Jacobi Smoothing, are inspired by the 11th lesson of Lorena Barba's 12 steps to Navier Stokes.

Also check out the docstring in the beginning of the file for some more details.

lid-driven-cavity-python's People

Contributors

ceyron avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.