ppmpy.riemann_exact module#
An exact Riemann solver for the Euler equations with a gamma-law gas. The left and right states are stored as State objects. We then create a RiemannProblem object with the left and right state:
rp = RiemannProblem(left_state, right_state)
Next we solve for the star state:
rp.find_star_state()
Finally, we sample the solution to find the interface state, which is returned as a State object:
q_int = rp.sample_solution()
- class RiemannProblem(left_state, right_state, *, gamma=1.4)[source]#
Bases:
object
- a class to define a Riemann problem. It takes a left
and right state. Note: we assume a constant gamma.
- Parameters:
- find_star_state(p_min=0.001, p_max=1000.0)[source]#
root find the Hugoniot curve to find ustar, pstar.
- Parameters:
p_min (float, optional) – minimum possible pressure.
p_max (float, optional) – maximum possible pressure.
- rarefaction_solution(sgn, state)[source]#
return the interface solution considering a rarefaction wave.
- class State(*, p=1.0, u=0.0, rho=1.0)[source]#
Bases:
object
a simple object to hold a primitive variable state
- Parameters:
p (float) – pressure
u (float) – velocity
rho (float) – density
- plot_hugoniot(riemann_problem, p_min=0.0, p_max=1.5, N=500)[source]#
plot the Hugoniot curves.
- Parameters:
riemann_problem (RiemannProblem) – the Riemann problem object.
p_min (float) – the minimum pressure to plot.
p_max (float) – the maximum pressure to plot.
N (int) – number of points to use in the plot.
- Return type:
matplotlib.pyplot.Figure