entropy_func_ESAtmo2D_t Function

public pure function entropy_func_ESAtmo2D_t(this, s) result(e)

Mathematical entropy: total energy density (kinetic + internal).

e = 0.5*(rhou^2 + rhov^2)/rho + p/(gamma - 1)

where p = p0 * (rho * Rd * theta / p0)^gamma and gamma = cp/cv.

Arguments

TypeIntentOptionalAttributesName
class(ESAtmo2D_t), intent(in) :: this
real(kind=prec), intent(in) :: s(1:this%nvar)

Return Value real(kind=prec)


Contents


Source Code

  pure function entropy_func_ESAtmo2D_t(this,s) result(e)
    !! Mathematical entropy: total energy density (kinetic + internal).
    !!
    !!   e = 0.5*(rhou^2 + rhov^2)/rho + p/(gamma - 1)
    !!
    !! where p = p0 * (rho * Rd * theta / p0)^gamma and gamma = cp/cv.
    class(ESAtmo2D_t),intent(in) :: this
    real(prec),intent(in) :: s(1:this%nvar)
    real(prec) :: e
    ! Local
    real(prec) :: rho,theta,p,gamma

    rho = s(1)
    theta = s(4)/rho
    gamma = this%cp/this%cv
    p = this%p0*(rho*this%Rd*theta/this%p0)**gamma

    e = 0.5_prec*(s(2)*s(2)+s(3)*s(3))/rho+ &
        p/(gamma-1.0_prec)

  endfunction entropy_func_ESAtmo2D_t