|
Peano
|
Exact Riemann solver. More...
Public Member Functions | |
| __init__ (self, gamma) | |
| Constructor. | |
| get_soundspeed (self, rho, P) | |
| Get the soundspeed corresponding to the given density and pressure. | |
| fb (self, rho, P, a, Pstar) | |
| Riemann fL or fR function. | |
| f (self, rhoL, uL, PL, aL, rhoR, uR, PR, aR, Pstar) | |
| Riemann f function. | |
| fprimeb (self, rho, P, a, Pstar) | |
| Derivative of the Riemann fL or fR function. | |
| fprime (self, rhoL, PL, aL, rhoR, PR, aR, Pstar) | |
| Derivative of the Riemann f function. | |
| gb (self, rho, P, Pstar) | |
| Riemann gL or gR function. | |
| guess_P (self, rhoL, uL, PL, aL, rhoR, uR, PR, aR) | |
| Get an initial guess for the pressure in the middle state. | |
| solve_brent (self, rhoL, uL, PL, aL, rhoR, uR, PR, aR, Plow, Phigh) | |
| Find the pressure of the middle state by using Brent's method. | |
| sample_right_shock_wave (self, rhoR, uR, PR, aR, ustar, Pstar, dxdt=np.array([0.0])) | |
| Sample the Riemann problem solution for a position in the right shock wave regime. | |
| sample_right_rarefaction_wave (self, rhoR, uR, PR, aR, ustar, Pstar, dxdt=np.array([0.0])) | |
| Sample the Riemann problem solution for a position in the right rarefaction wave regime. | |
| sample_right_state (self, rhoR, uR, PR, aR, ustar, Pstar, dxdt=np.array([0.0])) | |
| Sample the Riemann problem solution in the right state regime. | |
| sample_left_shock_wave (self, rhoL, uL, PL, aL, ustar, Pstar, dxdt=np.array([0.0])) | |
| Sample the Riemann problem solution for a position in the left shock wave regime. | |
| sample_left_rarefaction_wave (self, rhoL, uL, PL, aL, ustar, Pstar, dxdt=np.array([0.0])) | |
| Sample the Riemann problem solution for a position in the left rarefaction wave regime. | |
| sample_left_state (self, rhoL, uL, PL, aL, ustar, Pstar, dxdt=np.array([0.0])) | |
| Sample the Riemann problem solution in the left state regime. | |
| sample_right_vacuum (self, rhoL, uL, PL, aL, dxdt=np.array([0.0])) | |
| Sample the vacuum Riemann problem if the right state is a vacuum. | |
| sample_left_vacuum (self, rhoR, uR, PR, aR, dxdt=np.array([0.0])) | |
| Sample the vacuum Riemann problem if the left state is a vacuum. | |
| sample_vacuum_generation (self, rhoL, uL, PL, aL, rhoR, uR, PR, aR, dxdt) | |
| Sample the vacuum Riemann problem in the case vacuum is generated in between the left and right state. | |
| solve_vacuum (self, rhoL, uL, PL, aL, rhoR, uR, PR, aR, dxdt=np.array([0.0])) | |
| Vacuum Riemann solver. | |
| solve (self, rhoL, uL, PL, rhoR, uR, PR, dxdt=np.array([0.0])) | |
| Solve the Riemann problem with the given left and right state. | |
| solve_middle_state (self, rhoL, uL, PL, rhoR, uR, PR) | |
| Solve the Riemann problem with the given left and right state for the velocity and pressure (but do not sample the solution). | |
Protected Attributes | |
| _gamma = gamma | |
| float | _gp1d2g = 0.5 * (gamma + 1.0) / gamma |
| related quantities: gamma plus 1 divided by 2 gamma | |
| float | _gm1d2g = 0.5 * (gamma - 1.0) / gamma |
| tuple | _gm1dgp1 = (gamma - 1.0) / (gamma + 1.0) |
| float | _tdgp1 = 2.0 / (gamma + 1.0) |
| float | _tdgm1 = 2.0 / (gamma - 1.0) |
| float | _gm1d2 = 0.5 * (gamma - 1.0) |
| float | _tgdgm1 = 2.0 * gamma / (gamma - 1.0) |
| float | _ginv = 1.0 / gamma |
Exact Riemann solver.
Definition at line 37 of file riemann.py.
| exaparty.api.sphtools.riemann.RiemannSolver.__init__ | ( | self, | |
| gamma ) |
Constructor.
| gamma | Adiabatic index \(\gamma{}\). |
Definition at line 42 of file riemann.py.
| exaparty.api.sphtools.riemann.RiemannSolver.f | ( | self, | |
| rhoL, | |||
| uL, | |||
| PL, | |||
| aL, | |||
| rhoR, | |||
| uR, | |||
| PR, | |||
| aR, | |||
| Pstar ) |
Riemann f function.
| rhoL | Density of the left state. |
| uL | Velocity of the left state. |
| PL | Pressure of the left state. |
| aL | Soundspeed of the left state. |
| rhoR | Density of the right state. |
| uR | Velocity of the right state. |
| PR | Pressure of the right state. |
| aR | Soundspeed of the right state. |
| Pstar | (Temporary) pressure of the middle state. |
Definition at line 105 of file riemann.py.
References fb().
Referenced by solve(), solve_brent(), and solve_middle_state().


| exaparty.api.sphtools.riemann.RiemannSolver.fb | ( | self, | |
| rho, | |||
| P, | |||
| a, | |||
| Pstar ) |
Riemann fL or fR function.
| rho | Density of the left or right state. |
| P | Pressure of the left or right state. |
| a | Soundspeed of the left or right state. |
| Pstar | (Temporary) pressure of the middle state. |
Definition at line 86 of file riemann.py.
References _gm1d2g, _gm1dgp1, _tdgm1, and _tdgp1.
Referenced by f(), solve(), and solve_middle_state().

| exaparty.api.sphtools.riemann.RiemannSolver.fprime | ( | self, | |
| rhoL, | |||
| PL, | |||
| aL, | |||
| rhoR, | |||
| PR, | |||
| aR, | |||
| Pstar ) |
Derivative of the Riemann f function.
| rhoL | Density of the left state. |
| PL | Pressure of the left state. |
| aL | Soundspeed of the left state. |
| rhoR | Density of the right state. |
| PR | Pressure of the right state. |
| aR | Soundspeed of the right state. |
| Pstar | (Temporary) pressure of the middle state. |
Definition at line 141 of file riemann.py.
References fprimeb().
Referenced by solve(), and solve_middle_state().


| exaparty.api.sphtools.riemann.RiemannSolver.fprimeb | ( | self, | |
| rho, | |||
| P, | |||
| a, | |||
| Pstar ) |
Derivative of the Riemann fL or fR function.
| rho | Density of the left or right state. |
| P | Pressure of the left or right state. |
| a | Soundspeed of the left or right state. |
| Pstar | (Temporary) pressure of the middle state. |
Definition at line 122 of file riemann.py.
References _gm1dgp1, _gp1d2g, and _tdgp1.
Referenced by fprime().

| exaparty.api.sphtools.riemann.RiemannSolver.gb | ( | self, | |
| rho, | |||
| P, | |||
| Pstar ) |
Riemann gL or gR function.
| rho | Density of the left or right state. |
| P | Pressure of the left or right state. |
| Pstar | (Temporary) pressure in the middle state. |
Definition at line 156 of file riemann.py.
References _gm1dgp1, and _tdgp1.
Referenced by guess_P().

| exaparty.api.sphtools.riemann.RiemannSolver.get_soundspeed | ( | self, | |
| rho, | |||
| P ) |
Get the soundspeed corresponding to the given density and pressure.
| rho | Density value. |
| P | Pressure value. |
Definition at line 73 of file riemann.py.
References exagrype.api.euler.Euler.Euler._gamma, and _gamma.
Referenced by solve(), and solve_middle_state().

| exaparty.api.sphtools.riemann.RiemannSolver.guess_P | ( | self, | |
| rhoL, | |||
| uL, | |||
| PL, | |||
| aL, | |||
| rhoR, | |||
| uR, | |||
| PR, | |||
| aR ) |
Get an initial guess for the pressure in the middle state.
| rhoL | Left state density. |
| uL | Left state velocity. |
| PL | Left state pressure. |
| aL | Left state soundspeed. |
| rhoR | Right state density. |
| uR | Right state velocity. |
| PR | Right state pressure. |
| aR | Right state soundspeed. |
Definition at line 169 of file riemann.py.
References _gm1d2, _gm1d2g, _tgdgm1, and gb().
Referenced by solve(), and solve_middle_state().


| exaparty.api.sphtools.riemann.RiemannSolver.sample_left_rarefaction_wave | ( | self, | |
| rhoL, | |||
| uL, | |||
| PL, | |||
| aL, | |||
| ustar, | |||
| Pstar, | |||
| dxdt = np.array([0.0]) ) |
Sample the Riemann problem solution for a position in the left rarefaction wave regime.
| rhoL | Density of the left state. |
| uL | Velocity of the left state. |
| PL | Pressure of the left state. |
| aL | Soundspeed of the left state. |
| ustar | Velocity of the middle state. |
| Pstar | Pressure of the middle state. |
| dxdt | Point in velocity space where we want to sample the solution. |
Definition at line 460 of file riemann.py.
References _ginv, _gm1d2, _gm1d2g, _gm1dgp1, _tdgm1, _tdgp1, and _tgdgm1.
Referenced by sample_left_state().

| exaparty.api.sphtools.riemann.RiemannSolver.sample_left_shock_wave | ( | self, | |
| rhoL, | |||
| uL, | |||
| PL, | |||
| aL, | |||
| ustar, | |||
| Pstar, | |||
| dxdt = np.array([0.0]) ) |
Sample the Riemann problem solution for a position in the left shock wave regime.
| rhoL | Density of the left state. |
| uL | Velocity of the left state. |
| PL | Pressure of the left state. |
| aL | Soundspeed of the left state. |
| ustar | Velocity of the middle state. |
| Pstar | Pressure of the middle state. |
| dxdt | Point in velocity space where we want to sample the solution. |
Definition at line 419 of file riemann.py.
References _gm1d2g, _gm1dgp1, and _gp1d2g.
Referenced by sample_left_state().

| exaparty.api.sphtools.riemann.RiemannSolver.sample_left_state | ( | self, | |
| rhoL, | |||
| uL, | |||
| PL, | |||
| aL, | |||
| ustar, | |||
| Pstar, | |||
| dxdt = np.array([0.0]) ) |
Sample the Riemann problem solution in the left state regime.
| rhoL | Density of the left state. |
| uL | Velocity of the left state. |
| PL | Pressure of the left state. |
| aL | Soundspeed of the left state. |
| ustar | Velocity of the middle state. |
| Pstar | Pressure of the middle state. |
| dxdt | Point in velocity space where we want to sample the solution. |
Definition at line 514 of file riemann.py.
References sample_left_rarefaction_wave(), and sample_left_shock_wave().
Referenced by solve().


| exaparty.api.sphtools.riemann.RiemannSolver.sample_left_vacuum | ( | self, | |
| rhoR, | |||
| uR, | |||
| PR, | |||
| aR, | |||
| dxdt = np.array([0.0]) ) |
Sample the vacuum Riemann problem if the left state is a vacuum.
| rhoR | Density of the right state. |
| uR | Velocity of the right state. |
| PR | Pressure of the right state. |
| aR | Soundspeed of the right state. |
| dxdt | Point in velocity space where we want to sample the solution. |
Definition at line 586 of file riemann.py.
References _gm1dgp1, _tdgm1, _tdgp1, and _tgdgm1.
Referenced by solve_vacuum().

| exaparty.api.sphtools.riemann.RiemannSolver.sample_right_rarefaction_wave | ( | self, | |
| rhoR, | |||
| uR, | |||
| PR, | |||
| aR, | |||
| ustar, | |||
| Pstar, | |||
| dxdt = np.array([0.0]) ) |
Sample the Riemann problem solution for a position in the right rarefaction wave regime.
| rhoR | Density of the right state. |
| uR | Velocity of the right state. |
| PR | Pressure of the right state. |
| aR | Soundspeed of the right state. |
| ustar | Velocity of the middle state. |
| Pstar | Pressure of the middle state. |
| dxdt | Point in velocity space where we want to sample the solution. |
Definition at line 343 of file riemann.py.
References _ginv, _gm1d2, _gm1d2g, _gm1dgp1, _tdgm1, _tdgp1, and _tgdgm1.
Referenced by sample_right_state().

| exaparty.api.sphtools.riemann.RiemannSolver.sample_right_shock_wave | ( | self, | |
| rhoR, | |||
| uR, | |||
| PR, | |||
| aR, | |||
| ustar, | |||
| Pstar, | |||
| dxdt = np.array([0.0]) ) |
Sample the Riemann problem solution for a position in the right shock wave regime.
| rhoR | Density of the right state. |
| uR | Velocity of the right state. |
| PR | Pressure of the right state. |
| aR | Soundspeed of the right state. |
| ustar | Velocity of the middle state. |
| Pstar | Pressure of the middle state. |
| rhosol | Density solution. |
| usol | Velocity solution. |
| Psol | Pressure solution. |
| dxdt | Point in velocity space where we want to sample the solution. |
Definition at line 301 of file riemann.py.
References _gm1d2g, _gm1dgp1, and _gp1d2g.
Referenced by sample_right_state().

| exaparty.api.sphtools.riemann.RiemannSolver.sample_right_state | ( | self, | |
| rhoR, | |||
| uR, | |||
| PR, | |||
| aR, | |||
| ustar, | |||
| Pstar, | |||
| dxdt = np.array([0.0]) ) |
Sample the Riemann problem solution in the right state regime.
| rhoR | Density of the right state. |
| uR | Velocity of the right state. |
| PR | Pressure of the right state. |
| aR | Soundspeed of the right state. |
| ustar | Velocity of the middle state. |
| Pstar | Pressure of the middle state. |
| dxdt | Point in velocity space where we want to sample the solution. |
Definition at line 393 of file riemann.py.
References sample_right_rarefaction_wave(), and sample_right_shock_wave().
Referenced by solve().


| exaparty.api.sphtools.riemann.RiemannSolver.sample_right_vacuum | ( | self, | |
| rhoL, | |||
| uL, | |||
| PL, | |||
| aL, | |||
| dxdt = np.array([0.0]) ) |
Sample the vacuum Riemann problem if the right state is a vacuum.
| rhoL | Density of the left state. |
| uL | Velocity of the left state. |
| PL | Pressure of the left state. |
| aL | Soundspeed of the left state. |
| dxdt | Point in velocity space where we want to sample the solution. |
Definition at line 540 of file riemann.py.
References _gm1d2, _gm1dgp1, _tdgm1, _tdgp1, and _tgdgm1.
Referenced by solve_vacuum().

| exaparty.api.sphtools.riemann.RiemannSolver.sample_vacuum_generation | ( | self, | |
| rhoL, | |||
| uL, | |||
| PL, | |||
| aL, | |||
| rhoR, | |||
| uR, | |||
| PR, | |||
| aR, | |||
| dxdt ) |
Sample the vacuum Riemann problem in the case vacuum is generated in between the left and right state.
| rhoL | Density of the left state. |
| uL | Velocity of the left state. |
| PL | Pressure of the left state. |
| aL | Soundspeed of the left state. |
| rhoR | Density of the right state. |
| uR | Velocity of the right state. |
| PR | Pressure of the right state. |
| aR | Soundspeed of the right state. |
| dxdt | Point in velocity space where we want to sample the solution. |
Definition at line 632 of file riemann.py.
References _gm1dgp1, _tdgm1, _tdgp1, and _tgdgm1.
Referenced by solve_vacuum().

| exaparty.api.sphtools.riemann.RiemannSolver.solve | ( | self, | |
| rhoL, | |||
| uL, | |||
| PL, | |||
| rhoR, | |||
| uR, | |||
| PR, | |||
| dxdt = np.array([0.0]) ) |
Solve the Riemann problem with the given left and right state.
| rhoL | Left state density. |
| uL | Left state velocity. |
| PL | Left state pressure. |
| rhoR | Right state density. |
| uR | Right state velocity. |
| PR | Right state pressure. |
| dxdt | Point in velocity space where we want to sample the solution. |
Definition at line 755 of file riemann.py.
References _tdgm1, exaparty.api.particle.SPHParticle.SPHParticle.f, f(), fb(), fprime(), get_soundspeed(), guess_P(), sample_left_state(), sample_right_state(), solve_brent(), and solve_vacuum().

| exaparty.api.sphtools.riemann.RiemannSolver.solve_brent | ( | self, | |
| rhoL, | |||
| uL, | |||
| PL, | |||
| aL, | |||
| rhoR, | |||
| uR, | |||
| PR, | |||
| aR, | |||
| Plow, | |||
| Phigh ) |
Find the pressure of the middle state by using Brent's method.
| rhoL | Density of the left state. |
| uL | Velocity of the left state. |
| PL | Pressure of the left state. |
| aL | Soundspeed of the left state. |
| rhoR | Density of the right state. |
| uR | Velocity of the right state. |
| PR | Pressure of the right state. |
| aR | Soundspeed of the right state. |
| Plow | Lower bound guess for the pressure of the middle state. |
| Phigh | Higher bound guess for the pressure of the middle state. |
Definition at line 210 of file riemann.py.
References exaparty.api.particle.SPHParticle.SPHParticle.f, and f().
Referenced by solve(), and solve_middle_state().


| exaparty.api.sphtools.riemann.RiemannSolver.solve_middle_state | ( | self, | |
| rhoL, | |||
| uL, | |||
| PL, | |||
| rhoR, | |||
| uR, | |||
| PR ) |
Solve the Riemann problem with the given left and right state for the velocity and pressure (but do not sample the solution).
| rhoL | Left state density. |
| uL | Left state velocity. |
| PL | Left state pressure. |
| rhoR | Right state density. |
| uR | Right state velocity. |
| PR | Right state pressure. |
Definition at line 854 of file riemann.py.
References _tdgm1, exaparty.api.particle.SPHParticle.SPHParticle.f, f(), fb(), fprime(), get_soundspeed(), guess_P(), and solve_brent().

| exaparty.api.sphtools.riemann.RiemannSolver.solve_vacuum | ( | self, | |
| rhoL, | |||
| uL, | |||
| PL, | |||
| aL, | |||
| rhoR, | |||
| uR, | |||
| PR, | |||
| aR, | |||
| dxdt = np.array([0.0]) ) |
Vacuum Riemann solver.
This solver is called when one or both states have a zero density, or when the vacuum generation condition is satisfied (meaning vacuum is generated in the middle state, although strictly speaking there is no "middle" state if vacuum is involved).
| rhoL | Density of the left state. |
| uL | Velocity of the left state. |
| PL | Pressure of the left state. |
| aL | Soundspeed of the left state. |
| rhoR | Density of the right state. |
| uR | Velocity of the right state. |
| PR | Pressure of the right state. |
| aR | Soundspeed of the right state. |
| dxdt | Point in velocity space where we want to sample the solution. |
Definition at line 712 of file riemann.py.
References sample_left_vacuum(), sample_right_vacuum(), and sample_vacuum_generation().
Referenced by solve().


|
protected |
Definition at line 53 of file riemann.py.
Referenced by get_soundspeed().
|
protected |
Definition at line 71 of file riemann.py.
Referenced by sample_left_rarefaction_wave(), and sample_right_rarefaction_wave().
|
protected |
Definition at line 67 of file riemann.py.
Referenced by guess_P(), sample_left_rarefaction_wave(), sample_right_rarefaction_wave(), and sample_right_vacuum().
|
protected |
Definition at line 59 of file riemann.py.
Referenced by fb(), guess_P(), sample_left_rarefaction_wave(), sample_left_shock_wave(), sample_right_rarefaction_wave(), and sample_right_shock_wave().
|
protected |
Definition at line 61 of file riemann.py.
Referenced by fb(), fprimeb(), gb(), sample_left_rarefaction_wave(), sample_left_shock_wave(), sample_left_vacuum(), sample_right_rarefaction_wave(), sample_right_shock_wave(), sample_right_vacuum(), and sample_vacuum_generation().
|
protected |
related quantities: gamma plus 1 divided by 2 gamma
Definition at line 57 of file riemann.py.
Referenced by fprimeb(), sample_left_shock_wave(), and sample_right_shock_wave().
|
protected |
Definition at line 65 of file riemann.py.
Referenced by fb(), sample_left_rarefaction_wave(), sample_left_vacuum(), sample_right_rarefaction_wave(), sample_right_vacuum(), sample_vacuum_generation(), solve(), and solve_middle_state().
|
protected |
Definition at line 63 of file riemann.py.
Referenced by fb(), fprimeb(), gb(), sample_left_rarefaction_wave(), sample_left_vacuum(), sample_right_rarefaction_wave(), sample_right_vacuum(), and sample_vacuum_generation().
|
protected |
Definition at line 69 of file riemann.py.
Referenced by guess_P(), sample_left_rarefaction_wave(), sample_left_vacuum(), sample_right_rarefaction_wave(), sample_right_vacuum(), and sample_vacuum_generation().