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) | :: | 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.
FUNCTION HotWaterHeatingCoilResidual(PartLoadFrac, Par) RESULT (Residuum)
! FUNCTION INFORMATION:
! AUTHOR Chandan Sharma, FSEC
! DATE WRITTEN February 2013
! MODIFIED
! RE-ENGINEERED
! PURPOSE OF THIS FUNCTION:
! Calculates residual function (desired outlet temp - actual outlet temp)
! hot water Coil output depends on the part load ratio which is being varied to zero the residual.
! METHODOLOGY EMPLOYED:
! Calls SimulateWaterCoilComponents to get outlet temperature at the given part load ratio
! and calculates the residual as defined above
! REFERENCES:
! USE STATEMENTS:
USE WaterCoils, ONLY: SimulateWaterCoilComponents
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) = DX coil number
! Par(2) = desired air outlet temperature [C]
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:
REAL(r64) :: OutletAirTemp ! Outlet air temperature [C]
REAL(r64) :: mdot ! water-side flow rate of HW coil [kg/s]
REAL(r64) :: QActual ! heating capacity of HW coil [W]
INTEGER :: UnitarySysNum ! index to unitary system
LOGICAL :: FirstHVACIteration ! iteration flag
LOGICAL :: SuppHeatingCoilFlag ! TRUE if supplemental heating coil
LOGICAL :: LoadBased ! TRUE if controlling to load, else control to temperature
UnitarySysNum = INT(Par(1))
IF (Par(2) > 0.0d0) THEN
FirstHVACIteration = .TRUE.
ELSE
FirstHVACIteration = .FALSE.
END IF
IF (Par(4) > 0.0d0) THEN
SuppHeatingCoilFlag = .TRUE.
ELSE
SuppHeatingCoilFlag = .FALSE.
END IF
IF(Par(5) > 0.0d0)THEN
LoadBased = .TRUE.
ELSE
LoadBased = .FALSE.
END IF
QActual = 0.0d0
IF (.NOT. SuppHeatingCoilFlag) THEN
mdot = MIN(Node(UnitarySystem(UnitarySysNum)%HeatCoilFluidOutletNodeNum)%MassFlowRateMaxAvail, &
UnitarySystem(UnitarySysNum)%MaxHeatCoilFluidFlow * PartLoadFrac)
Node(UnitarySystem(UnitarySysNum)%HeatCoilFluidInletNode)%MassFlowRate = mdot
CALL SimulateWaterCoilComponents(UnitarySystem(UnitarySysNum)%HeatingCoilName,FirstHVACIteration, &
UnitarySystem(UnitarySysNum)%HeatingCoilIndex,QActual=QActual, &
FanOpMode=UnitarySystem(UnitarySysNum)%FanOpMode,PartLoadRatio = PartLoadFrac)
OutletAirTemp = Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%Temp
ELSE
mdot = MIN(Node(UnitarySystem(UnitarySysNum)%SuppCoilFluidOutletNodeNum)%MassFlowRateMaxAvail, &
UnitarySystem(UnitarySysNum)%MaxSuppCoilFluidFlow * PartLoadFrac)
Node(UnitarySystem(UnitarySysNum)%SuppCoilFluidInletNode)%MassFlowRate = mdot
CALL SimulateWaterCoilComponents(UnitarySystem(UnitarySysNum)%SuppHeatCoilName,FirstHVACIteration, &
UnitarySystem(UnitarySysNum)%SuppHeatCoilIndex,QActual=QActual, &
FanOpMode=UnitarySystem(UnitarySysNum)%FanOpMode,PartLoadRatio = PartLoadFrac)
OutletAirTemp = Node(UnitarySystem(UnitarySysNum)%SuppCoilAirOutletNode)%Temp
END IF
IF(LoadBased)THEN
Residuum = Par(3) - QActual
ELSE
Residuum = Par(3) - OutletAirTemp
END IF
RETURN
END FUNCTION HotWaterHeatingCoilResidual