Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | Refrigerant | |||
real(kind=r64), | intent(in) | :: | Temperature | |||
real(kind=r64), | intent(in) | :: | Quality | |||
integer, | intent(inout) | :: | RefrigIndex | |||
character(len=*), | intent(in) | :: | calledfrom |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
FUNCTION GetSatEnthalpyRefrig(Refrigerant,Temperature,Quality,RefrigIndex,calledfrom) RESULT(ReturnValue)
! SUBROUTINE INFORMATION:
! AUTHOR Mike Turner
! DATE WRITTEN 10 December 99
! MODIFIED Rick Strand (April 2000, May 2000)
! Simon Rees (May 2002)
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This finds enthalpy for given temperature and a quality under the vapor dome.
! This fucntion is only called with a valid refrigerant and quality between 0 and 1.
! METHODOLOGY EMPLOYED:
! Calls GetInterpolatedSatProp to linearly interpolate between the saturated
! liquid and vapour enthalpies according to the given quality.
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: Refrigerant ! carries in substance name
REAL(r64), INTENT(IN) :: Temperature ! actual temperature given as input
REAL(r64), INTENT(IN) :: Quality ! actual quality given as input
INTEGER, INTENT(INOUT) :: RefrigIndex ! Index to Refrigerant Properties
character(len=*), intent(in) :: calledfrom ! routine this function was called from (error messages)
REAL(r64) :: ReturnValue
! FUNCTION PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: RoutineName='GetSatEnthalpyRefrig: '
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
INTEGER :: RefrigNum ! index for refrigerant under consideration
! FLOW:
IF (GetInput) THEN
CALL GetFluidPropertiesData
GetInput = .FALSE.
END IF
RefrigNum=0
IF (NumOfRefrigerants == 0) THEN
CALL ReportFatalRefrigerantErrors(NumOfRefrigerants,RefrigNum,.true.,Refrigerant, &
'GetSatEnthalpyRefrig','properties',calledfrom)
ENDIF
IF ((Quality < 0.0d0) .OR. (Quality > 1.0d0)) THEN
CALL ShowSevereError(RoutineName//'Refrigerant "'//TRIM(Refrigerant)// &
'", invalid quality, called from '//calledfrom)
CALL ShowContinueError('Saturated refrigerant quality must be between 0 and 1, entered value=['// &
trim(RoundSigDigits(Quality,4))//'].')
CALL ShowFatalError('Program terminates due to preceding condition.')
ENDIF
IF (RefrigIndex > 0) THEN
RefrigNum=RefrigIndex
ELSE
! Find which refrigerant (index) is being requested
RefrigNum = FindRefrigerant(Refrigerant)
IF (RefrigNum == 0) THEN
CALL ReportFatalRefrigerantErrors(NumOfRefrigerants,RefrigNum,.true.,Refrigerant, &
'GetSatEnthalpyRefrig','properties',calledfrom)
ENDIF
RefrigIndex=RefrigNum
ENDIF
! Apply linear interpolation function
ReturnValue = GetInterpolatedSatProp(Temperature, RefrigData(RefrigNum)%HTemps, RefrigData(RefrigNum)%HfValues, &
RefrigData(RefrigNum)%HfgValues, Quality, calledfrom, &
RefrigData(RefrigNum)%HfLowTempIndex,RefrigData(RefrigNum)%HfHighTempIndex)
RETURN
END FUNCTION GetSatEnthalpyRefrig