Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | HWFlow | |||
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.
FUNCTION HotWaterCoilResidual(HWFlow, Par) RESULT (Residuum)
! FUNCTION INFORMATION:
! AUTHOR Bereket Nigusse, FSEC/UCF
! DATE WRITTEN January 2011
! MODIFIED
! RE-ENGINEERED
! PURPOSE OF THIS FUNCTION:
! Calculates residual function (QCoilActual - QCoilRequested) / QCoilRequested
! the coil actual output depends on the hot water flow rate which is being varied
! to minimize the residual.
! METHODOLOGY EMPLOYED:
! Calls HotWaterCoilResidual, and calculates the residual as defined above.
!
! REFERENCES:
! USE STATEMENTS:
USE WaterCoils, ONLY: SimulateWaterCoilComponents
USE PlantUtilities, ONLY: SetComponentFlowRate
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
REAL(r64), INTENT(IN) :: HWFlow ! hot water flow rate in kg/s
REAL(r64), INTENT(IN), DIMENSION(:), OPTIONAL :: Par ! Par(5) is the requested coil load
REAL(r64) :: Residuum ! residual to be minimized to zero
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
INTEGER :: FurnaceNum
LOGICAL :: FirstHVACIteration
REAL(r64) :: QCoilActual ! delivered coild load, W
REAL(r64) :: QCoilRequested ! requested coild load, W
REAL(r64) :: mdot
LOGICAL :: SuppHeatingCoilFlag ! .true. if supplemental heating coil
FurnaceNum = INT(Par(1))
IF (Par(2) > 0.0d0) THEN
FirstHVACIteration = .TRUE.
ELSE
FirstHVACIteration = .FALSE.
END IF
QCoilRequested = Par(3)
IF (Par(4) > 0.0d0) THEN
SuppHeatingCoilFlag = .TRUE.
ELSE
SuppHeatingCoilFlag = .FALSE.
END IF
QCoilActual = QCoilRequested
mdot = HWFlow
IF (.NOT. SuppHeatingCoilFlag ) Then
Call SetComponentFlowRate( mdot , &
Furnace(FurnaceNum)%CoilControlNode, &
Furnace(FurnaceNum)%CoilOutletNode, &
Furnace(FurnaceNum)%LoopNum, &
Furnace(FurnaceNum)%LoopSide, &
Furnace(FurnaceNum)%BranchNum, &
Furnace(FurnaceNum)%CompNum)
CALL SimulateWaterCoilComponents(Furnace(FurnaceNum)%HeatingCoilName,FirstHVACIteration, &
Furnace(FurnaceNum)%HeatingCoilIndex, QCoilActual, &
Furnace(FurnaceNum)%OpMode)
ELSE
! supplemental coil
Call SetComponentFlowRate( mdot , &
Furnace(FurnaceNum)%SuppCoilControlNode, &
Furnace(FurnaceNum)%SuppCoilOutletNode, &
Furnace(FurnaceNum)%LoopNumSupp, &
Furnace(FurnaceNum)%LoopSideSupp, &
Furnace(FurnaceNum)%BranchNumSupp, &
Furnace(FurnaceNum)%CompNumSupp)
! simulate the hot water supplemental heating coil
CALL SimulateWaterCoilComponents(Furnace(FurnaceNum)%SuppHeatCoilName,FirstHVACIteration, &
Furnace(FurnaceNum)%SuppHeatCoilIndex, QCoilActual, &
Furnace(FurnaceNum)%OpMode)
ENDIF
IF (QCoilRequested /= 0.0d0) THEN
Residuum = (QCoilActual - QCoilRequested)/ QCoilRequested
ELSE !Objexx:Return ELSE added to assure return value is set
Residuum = 0.0d0
ENDIF
RETURN
END FUNCTION HotWaterCoilResidual