Giter Club home page Giter Club logo

advection-equation-1d's Introduction

1-D Advection Equation

C++ source code to solve one-dimensional scalar advection equation. Problems are taken from [1].

1-D scalar advection equation with constant velocity

$$ \frac{\partial u}{\partial t} + c \frac{\partial u}{\partial x} = 0 $$

is solved by using the finie difference method. Currently, the following spacial reconstruction schemes are implemented:

  • Lax-Wendroff scheme
  • 1st-order upwind scheme
  • Beam-Warming scheme
  • Fromm scheme
  • TVD scheme with minmod, Superbee, van Leer, and van Albada slope limiters.

In addition, periodic boundaries, the Roe-Riemann solver, and the explicit Euler scheme for time integration are used.

Please refer to [1] for the details of each scheme.

How to compile

Run the following commands under the root directory of the project:

$ cmake -S . -B build
$ cmake --build build

Please note that the project depends on the Eigen library, which is automatically downloaded and built by CMake using the FetchContent module.

Then, run all simulators and get results. For Linux,

$ ./run_all.sh

For Windows,

$ .\run_all.ps1

To visualize results, open plot.ipynb with Jupyter Lab, and run all cells.

References

  1. 肖鋒・長﨑孝夫 2020 数値流体解析の基礎 -Visual C++とgnuplotによる圧縮性・非圧縮性流体解析- コロナ社

advection-equation-1d's People

Contributors

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