Mathematical entropy: total energy density (kinetic + internal).
e = 0.5*(rhou^2 + rhov^2 + rhow^2)/rho + p/(gamma - 1)
where p = p0 * (rho * Rd * theta / p0)^gamma and gamma = cp/cv.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ESAtmo3D_t), | intent(in) | :: | this | |||
| real(kind=prec), | intent(in) | :: | s(1:this%nvar) |
pure function entropy_func_ESAtmo3D_t(this,s) result(e)
!! Mathematical entropy: total energy density (kinetic + internal).
!!
!! e = 0.5*(rhou^2 + rhov^2 + rhow^2)/rho + p/(gamma - 1)
!!
!! where p = p0 * (rho * Rd * theta / p0)^gamma and gamma = cp/cv.
class(ESAtmo3D_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(5)/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)+s(4)*s(4))/rho+ &
p/(gamma-1.0_prec)
endfunction entropy_func_ESAtmo3D_t