Code Monkey home page Code Monkey logo

cfd_euler_1d's Introduction

One-dimensional adaptive solver for the compressible Euler equations

Solver with adaptive mesh refinement written in Python. Multiple Riemann solvers (HLLC, Flux Vector Splitting) are implemented, based on [1]. The spatial scheme can be of order 1 (piecewise constant) or 2 (MUSCL-Hancock scheme with linear reconstruction). A minmod limiter is also avaible. The temporal integration is either first-order (Explicit Euler), third-order (SSP Runge-Kutta method), or any of Scip's 'solve_ivp' methods. Dynamic time step is available (either via error estimates with Scipy or via a CFL condition).

A tree-based dynamic refinement algorithm is implemented. Various refinement criteria are available: error estimate of the spatial discretisation, classical "gradient" of some variables...

The test script implements the classical Sod shock tube problem, with reflective or transmissive boundaries.

Here is a comparison of the density field at t=0.01s, for the analytical solution and for the simulation with 100 cells, order 2 reconstruction and Flux Vector Splitting:

comparison

Some fancy visualizations can be obtained with this code, for example the following wave diagrams, for a shock tube with reflective boundaries (1000 uniform cells):

schlieren T_field

Here is a similar test case, with adaptive mesh refinement:

density schlieren mesh levels mesh size

References: [1] "Riemann Solvers and Numerical Methods for Fluid Dynamics, A Practical Introduction" by Toro, Eleuterio F., Springer

TODO: quasi-1D version

cfd_euler_1d's People

Contributors

laurent90git avatar

Watchers

 avatar  avatar

Forkers

hlim88 xuyj001gh

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.