Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | PartLoadFrac | |||
real(kind=r64), | intent(in), | optional | DIMENSION(:) | :: | Par |
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.
REAL(r64) FUNCTION PLRResidual(PartLoadFrac,Par)
! FUNCTION INFORMATION:
! AUTHOR Richard Raustad
! DATE WRITTEN July 2005
! MODIFIED
! RE-ENGINEERED
! PURPOSE OF THIS FUNCTION:
! Calculates residual function ((ActualOutput - QZnReq)/QZnReq)
! PTHP output depends on the part load ratio which is being varied to zero the residual.
! METHODOLOGY EMPLOYED:
! Calls CalcPTHP to get ActualOutput at the given part load ratio
! and calculates the residual as defined above
! REFERENCES:
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
REAL(r64), INTENT(IN) :: PartLoadFrac ! compressor cycling ratio (1.0 is continuous, 0.0 is off)
REAL(r64), INTENT(IN), DIMENSION(:), OPTIONAL :: Par ! par(1) = PTUnitNum
! par(2) = Zone Num
! par(3) = FirstHVACIteration
! par(4) = OpMode
! par(5) = QZnReq
! par(6) = OnOffAirFlowRatio
! par(7) = SupHeaterLoad
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
INTEGER :: PTUnitNum ! PTHP index
INTEGER :: ZoneNum ! Zone index
LOGICAL :: FirstHVACIteration ! FirstHVACIteration flag
INTEGER :: OpMode ! Compressor operating mode
REAL(r64) :: QZnReq ! zone load (W)
REAL(r64) :: QZnReqTemp ! denominator representing zone load (W)
REAL(r64) :: OnOffAirFlowRatio ! ratio of compressor ON airflow to average airflow over timestep
REAL(r64) :: ActualOutput ! delivered capacity of PTHP
REAL(r64) :: SupHeaterLoad ! load passed to supplemental heater (W)
LOGICAL :: HXUnitOn ! flag to enable heat exchanger
PTUnitNum = INT(Par(1))
ZoneNum = INT(Par(2))
! FirstHVACIteration is a logical, Par is real, so make 1.0=TRUE and 0.0=FALSE
IF(Par(3) .EQ. 1.0d0)THEN
FirstHVACIteration = .TRUE.
ELSE
FirstHVACIteration = .FALSE.
END IF
OpMode = INT(Par(4))
QZnReq = Par(5)
QZnReqTemp = QZnReq
IF(ABS(QZnReq) .LT. 100.d0)QZnReqTemp=SIGN(100.d0,QZnReq)
OnOffAirFlowRatio = Par(6)
SupHeaterLoad = Par(7) * PartLoadFrac
IF(Par(8) .EQ. 1.0d0)THEN
HXUnitOn = .TRUE.
ELSE
HXUnitOn = .FALSE.
END IF
CALL CalcPTUnit(PTUnitNum,FirstHVACIteration,PartLoadFrac,ActualOutput,QZnReq,OnOffAirFlowRatio,SupHeaterLoad, HXUnitOn)
PLRResidual = (ActualOutput - QZnReq)/QZnReqTemp
RETURN
END FUNCTION PLRResidual