Compute interstates 2 and 3 given (an approximation of) veloctiy S=u23.
the pressure of interstates, that should be equal, are returned into separate arguments for allowing a convergence
checking, namely if the approximation of u23 is exact the output is p_2=p_3=p23.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(riemann_pattern_compressible_object), | intent(inout) | :: | self | Riemann (states) pattern solution. |
||
| real(kind=R8P), | intent(out) | :: | p_2 | Pressure of state 2. |
||
| real(kind=R8P), | intent(out) | :: | p_3 | Pressure of state 3. |
elemental subroutine compute_states23_from_u23(self, p_2, p_3)
!< Compute interstates 2 and 3 given (an approximation of) veloctiy `S=u23`.
!<
!< @Note the pressure of interstates, that should be equal, are returned into separate arguments for allowing a *convergence
!< checking*, namely if the approximation of `u23` is exact the output is `p_2=p_3=p23`.
class(riemann_pattern_compressible_object), intent(inout) :: self !< Riemann (states) pattern solution.
real(R8P), intent(out) :: p_2 !< Pressure of state 2.
real(R8P), intent(out) :: p_3 !< Pressure of state 3.
associate(s_1=>self%s_1, s_2=>self%s_2, u23=>self%u23, s_3=>self%s_3, s_4=>self%s_4, &
eos_1=>self%eos_1, eos_4=>self%eos_4, &
p_1=>self%p_1, r_1=>self%r_1, u_1=>self%u_1, a_1=>self%a_1, &
p_4=>self%p_4, r_4=>self%r_4, u_4=>self%u_4, a_4=>self%a_4, &
p23=>self%p23, r_2=>self%r_2, a_2=>self%a_2, r_3=>self%r_3, a_3=>self%a_3)
! left wave
if (abs(u23 - u_1) <= ZeroR8) then
call compute_post_rarefaction(eos=eos_1, sgn=-1._R8P, &
u0=u_1, p0=p_1, a0=a_1, ux=u23, &
rx=r_2, px=p_2, ax=a_2, s0=s_1, sx=s_2)
else
if (u23 < u_1) then
call compute_post_shock(eos=eos_1, sgn=-1._R8P, &
u0=u_1, p0=p_1, a0=a_1, ux=u23, &
rx=r_2, px=p_2, ax=a_2, ss=S_1)
S_2 = S_1
else
call compute_post_rarefaction(eos=eos_1, sgn=-1._R8P, &
u0=u_1, p0=p_1, a0=a_1, ux=u23, &
rx=r_2, px=p_2, ax=a_2, s0=S_1, sx=S_2)
endif
endif
! right wave
if (abs(u23 - u_4) <= ZeroR8) then
call compute_post_rarefaction(eos=eos_4, sgn=1._R8P, &
u0=u_4, p0=p_4, a0=a_4, ux=u23, &
rx=r_3, px=p_3, ax=a_3, s0=S_4, sx=S_3)
else
if (u23 > u_4) then
call compute_post_shock(eos=eos_4, sgn=1._R8P, &
u0=u_4, p0=p_4, a0=a_4, ux=u23, &
rx=r_3, px=p_3, ax=a_3, ss=S_4)
S_3 = S_4
else
call compute_post_rarefaction(eos=eos_4, sgn=1._R8P, &
u0=u_4, p0=p_4, a0=a_4, ux=u23, &
rx=r_3, px=p_3, ax=a_3, s0=S_4, sx=S_3)
endif
endif
endassociate
endsubroutine compute_states23_from_u23