Compute an unknown state x from a known state 0 when the two states are separated by a rarefaction, given the velocity
ux.
The sgn dummy argument indicates if the rarefaction propagates on u-a (sgn=-1) or u+a (sgn=1).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(eos_object), | intent(in) | :: | eos | Equation of state. |
||
| real(kind=R8P), | intent(in) | :: | sgn | Sign for distinguishing left (-1) from right (1) wave. |
||
| real(kind=R8P), | intent(in) | :: | u0 | Known state (speed, pressure and speed of sound). |
||
| real(kind=R8P), | intent(in) | :: | p0 | Known state (speed, pressure and speed of sound). |
||
| real(kind=R8P), | intent(in) | :: | a0 | Known state (speed, pressure and speed of sound). |
||
| real(kind=R8P), | intent(in) | :: | ux | Known speed of unknown state. |
||
| real(kind=R8P), | intent(out) | :: | rx | Unknown pressure and density. |
||
| real(kind=R8P), | intent(out) | :: | px | Unknown pressure and density. |
||
| real(kind=R8P), | intent(out) | :: | ax | Unknown pressure and density. |
||
| real(kind=R8P), | intent(out) | :: | s0 | Wave speeds (head and back fronts). |
||
| real(kind=R8P), | intent(out) | :: | sx | Wave speeds (head and back fronts). |
elemental subroutine compute_post_rarefaction(eos, sgn, u0, p0, a0, ux, rx, px, ax, s0, sx)
!< Compute an unknown state `x` from a known state `0` when the two states are separated by a rarefaction, given the velocity
!< `ux`.
!<
!< The `sgn` dummy argument indicates if the rarefaction propagates on `u-a (sgn=-1)` or `u+a (sgn=1)`.
class(eos_object), intent(in) :: eos !< Equation of state.
real(R8P), intent(in) :: sgn !< Sign for distinguishing *left* (-1) from *right* (1) wave.
real(R8P), intent(in) :: u0, p0, a0 !< Known state (speed, pressure and speed of sound).
real(R8P), intent(in) :: ux !< Known speed of unknown state.
real(R8P), intent(out) :: rx, px, ax !< Unknown pressure and density.
real(R8P), intent(out) :: s0, sx !< Wave speeds (head and back fronts).
ax = a0 + sgn * eos%delta() * (ux - u0) ! unknown speed of sound
px = p0 * ((ax / a0) ** (eos%eta())) ! unknown pressure
rx = eos%density(pressure=px, speed_of_sound=ax) ! unknown density
s0 = u0 + sgn * a0 ! left wave speed
sx = ux + sgn * ax ! right wave speed
endsubroutine compute_post_rarefaction