Return and instance of eos_compressible.
This procedure is used for overloading eos_compressible name.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=R8P), | intent(in), | optional | :: | cp | Specific heat at constant pressure |
|
| real(kind=R8P), | intent(in), | optional | :: | cv | Specific heat at constant volume |
|
| real(kind=R8P), | intent(in), | optional | :: | gam | Specific heats ratio |
|
| real(kind=R8P), | intent(in), | optional | :: | R | Fluid constant |
Instance of eos_compressible.
elemental function eos_compressible_instance(cp, cv, gam, R) result(instance)
!< Return and instance of [[eos_compressible]].
!<
!< @note This procedure is used for overloading [[eos_compressible]] name.
real(R8P), intent(in), optional :: cp !< Specific heat at constant pressure `cp` value.
real(R8P), intent(in), optional :: cv !< Specific heat at constant volume `cv` value.
real(R8P), intent(in), optional :: gam !< Specific heats ratio `gamma=cp/cv` value.
real(R8P), intent(in), optional :: R !< Fluid constant `R=cp-cv` value.
type(eos_compressible) :: instance !< Instance of [[eos_compressible]].
if (present(cp).and.present(cv)) then
instance%cp_ = cp
instance%cv_ = cv
elseif (present(gam).and.present(R)) then
instance%cv_ = R/(gam - 1._R8P)
instance%cp_ = gam * instance%cv_
elseif (present(gam).and.present(cp)) then
instance%cp_ = cp
instance%cv_ = cp / gam
elseif (present(gam).and.present(cv)) then
instance%cp_ = gam * cv
instance%cv_ = cv
elseif (present(R).and.present(cp)) then
instance%cp_ = cp
instance%cv_ = cp - R
elseif (present(R).and.present(cv)) then
instance%cp_ = cv + R
instance%cv_ = cv
endif
call instance%compute_derivate
endfunction eos_compressible_instance