Giter Club home page Giter Club logo

fluid2d's Introduction

2D Implementation of the Lax-Friedrichs Scheme

Python program for 2D implementation of Lax-Friedrichs scheme for simulation of inviscid flow of a perfect gas.

Structure

  • main/
    • main.py: Main module for performing the simulation.
    • utils.py: Utility functions for postprocessing simulation output and generating initial conditions.
    • plot_utils.py: Utility functions for plotting and creating animations.
  • example/
    • gresho_vortex_example.py: Example simulation of the Gresho Vortex.
    • waves_example.py: Example simulation of propagating waves.
    • analysis_vortex.ipynb: Notebook that outputs figures related to the Gresho vortex.
    • analysis_wave.ipynb: Notebook that outputs figures related to the propagating waves.
  • example_videos/: Two example videos for the Gresho vortex and propagating wave simulations

Usage

The core functionality relies in the Fluid2D() class inside main/main.py, which implements the Lax-Friedrichs scheme in 2D for the fluid flow equations. The simulation output is saved in a .hdf5 file format. There is also the possibility to add lagrangian tracers to the simulation. Check example/gresho_vortex_example.py for example usage.

Dependencies

  • numpy: For math operations.
  • matplotlib: For plotting.
  • h5py: For saving simulation output data.
  • PIL: For saving frames.
  • ffmpeg: For rendering animations.

License

This project is licensed under the MIT License.

fluid2d's People

Contributors

pererossello 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.