Skip to content

Instantly share code, notes, and snippets.

@ketch
Last active December 18, 2023 09:07
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ketch/08ce0845da0c8f3fa9ff to your computer and use it in GitHub Desktop.
Save ketch/08ce0845da0c8f3fa9ff to your computer and use it in GitHub Desktop.
An exact Riemann solver for the Euler equations, with interactive widgets. #riemann-problem #euler-equations
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@imsejae
Copy link

imsejae commented May 3, 2017

There is a bug in this exact Riemann solver. When computing rho_l_star and rho_r_star you need to use

Find middle state densities

if (p<=p_l):
    rho_l_star = (p/p_l)**(1.0/gamma) * rho_l
else:
    rho_l_star = ((1.0+beta*p/p_l)/((p/p_l)+beta))*rho_l;

if (p<=p_r):
    rho_r_star = (p/p_r)**(1.0/gamma) * rho_r
else:
    rho_r_star = ((1.0+beta*p/p_r)/((p/p_r)+beta))*rho_r;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment