Compute the pressure for an ideal calorically perfect gas.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R_P), | intent(in) | :: | r | Density. |
||
real(kind=R_P), | intent(in) | :: | a | Speed of sound. |
||
real(kind=R_P), | intent(in) | :: | g | Specific heats ratio \(\frac{{c_p}}{{c_v}}\). |
Pressure.
elemental function p(r, a, g) result(pressure)
!---------------------------------------------------------------------------------------------------------------------------------
!< Compute the pressure for an ideal calorically perfect gas.
!---------------------------------------------------------------------------------------------------------------------------------
real(R_P), intent(IN) :: r !< Density.
real(R_P), intent(IN) :: a !< Speed of sound.
real(R_P), intent(IN) :: g !< Specific heats ratio \(\frac{{c_p}}{{c_v}}\).
real(R_P) :: pressure !< Pressure.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
pressure = r*a*a/g
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction p