to_primitive Subroutine

public pure subroutine to_primitive(u)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: u(nw_phys)

Called by

proc~~to_primitive~8~~CalledByGraph proc~to_primitive~8 to_primitive proc~phys_to_primitive~4 phys_to_primitive proc~phys_to_primitive~4->proc~to_primitive~8

Source Code

pure subroutine to_primitive(u)
  
  real(dp), intent(inout) :: u(nw_phys)

  ! Compute velocity from momentum
      u(iw_mom(1)) = u(iw_mom(1))/u(iw_rho)
      u(iw_mom(2)) = u(iw_mom(2))/u(iw_rho)
      u(iw_mom(3)) = u(iw_mom(3))/u(iw_rho)

  ! Compute pressure from energy
  u(iw_e) = gamma_1 * (u(iw_e) - 0.5_dp * u(iw_rho) * &
     sum(u(iw_mom(1:ndim))**2) )

end subroutine to_primitive