extract_primitives Subroutine

private pure subroutine extract_primitives(q, gam, rho, u, p)

Extract primitive variables (rho, u, p) from a conserved state vector.

Inverse of the conserved-to-primitive map for the 1-D Euler equations: rho = q(1), u = q(2)/rho, p = (q(3) - ½ρu²)(γ-1).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: q(:)
real(kind=wp), intent(in) :: gam

Ratio of specific heats γ

real(kind=wp), intent(out) :: rho

Density

real(kind=wp), intent(out) :: u

Density Velocity

real(kind=wp), intent(out) :: p

Density Velocity Pressure