Skip to content

Exact Riemann solver

Jonathan Thurgood edited this page Nov 28, 2018 · 2 revisions

ers_euler_1d.f90

Overview

This is an exact Riemann solver for the 1D Euler equations.

It solves for user-set initial conditions, and at a user-set time ouputs spatially sampled data as dat files for easy postprocessing. It also automatically produces plots of u(x), p(x), rho(x) and en(x) (internal energy) at the requested sampling by calling a python script.

Usage

User should edit the following subroutines near the top of the script:

  • subroutine initial_conditions
    • Give the solver your left and right states
    • i.e. pressure (pl and pr), density (rhol and rhor), and velocity (ul and ur)
    • Also set gamma.
  • subroutine control
    • This controls the sampling of your output
    • set t to the time at which you want the solution
    • set nx - number of sampling points. 1000 doesnt take long at all.
    • set x0 - this is the location of the interface at t=0 (the "diagphram")
    • set x_min and x_max - guess...

You can also if you like

  • Comment out calls to overwrite user initial conditions with the setup tests 1 through 5 (after "call control" near botom), to see the output for e.g. Sod's shock tube, 1,2,3 problem (double rarefaction), and Woodward and Colella blast waves.
  • Change the precision from double to single by changing the parameter "num" near the start of the script.

Verification and testing

Uses the algorithm described in Toro's textbook.

Automatically does quantitative tests against solutions for five test problems and reports if OK.

Automatically checks user initial conditions for pressure positivity / evolution of vacuum.

Sod's Test

Test 1: Rho Test 1: U Test 1: p Test 1: en

1-2-3 (Double Rarefaction) Test

Test 2: Rho Test 2: U Test 2: p Test 2: en

Left-half Woodward + Colella blast problem Test 3: Rho Test 3: U Test 3: p Test 3: en

Right-half Woodward + Colella blast problem Test 4: Rho Test 4: U Test 4: p Test 4: en

Full Woodward + Colella blast problem (colliding shocks) Test 5: Rho Test 5: U Test 5: p Test 5: en

Clone this wiki locally