to_conservative Subroutine

public pure subroutine to_conservative(u)

Arguments

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

Called by

proc~~to_conservative~3~~CalledByGraph proc~to_conservative~3 to_conservative proc~phys_to_conserved~3 phys_to_conserved proc~phys_to_conserved~3->proc~to_conservative~3

Source Code

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

  ! Compute energy from pressure and kinetic energy
  u(iw_e) = u(iw_e) * inv_gamma_1 + 0.5_dp * u(iw_rho) * &
     u(iw_mom(1))**2

  ! Compute momentum from density and velocity components
  u(iw_mom(1)) = u(iw_rho) * u(iw_mom(1))
  
end subroutine to_conservative