Return temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(eos_compressible), | intent(in) | :: | self | Equation of state. |
||
| real(kind=R8P), | intent(in), | optional | :: | density | Density value. |
|
| real(kind=R8P), | intent(in), | optional | :: | energy | Specific internal energy value. |
|
| real(kind=R8P), | intent(in), | optional | :: | pressure | Pressure value. |
Temperature value.
elemental function temperature(self, density, energy, pressure) result(temperature_)
!< Return temperature.
class(eos_compressible), intent(in) :: self !< Equation of state.
real(R8P), intent(in), optional :: density !< Density value.
real(R8P), intent(in), optional :: energy !< Specific internal energy value.
real(R8P), intent(in), optional :: pressure !< Pressure value.
real(R8P) :: temperature_ !< Temperature value.
temperature_ = 0._R8P
if (present(density).and.present(pressure)) then
temperature_ = pressure / (self%R_ * density)
elseif (present(energy)) then
temperature_ = energy / self%cv()
endif
endfunction temperature