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 | ||
---|---|---|---|---|---|---|
logical, | intent(in) | :: | FirstHVACIteration | |||
integer, | intent(in) | :: | RadSysNum | |||
integer, | intent(in) | :: | SystemType |
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.
SUBROUTINE UpdateLowTempRadiantSystem(FirstHVACIteration,RadSysNum,SystemType)
! SUBROUTINE INFORMATION:
! AUTHOR Rick Strand
! DATE WRITTEN November 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine does any updating that needs to be done for low
! temperature radiant heating and cooling systems. One of the most
! important functions of this routine is to update the average heat
! source/sink for a particular system over the various system time
! steps that make up the zone time step. For hydronic systems,
! this routine must also set the outlet water conditions.
! METHODOLOGY EMPLOYED:
! For the source/sink average update, if the system time step elapsed
! is still what it used to be, then either we are still iterating or
! we had to go back and shorten the time step. As a result, we have
! to subtract out the previous value that we added. If the system
! time step elapsed is different, then we just need to add the new
! values to the running average.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataGlobals, ONLY : TimeStepZone
USE DataHeatBalance, ONLY : Zone
USE DataHVACGlobals, ONLY : TimeStepSys, SysTimeElapsed
USE DataLoopNode, ONLY : Node
USE FluidProperties, ONLY : GetSpecificHeatGlycol
USE DataPlant, ONLY : PlantLoop
USE PlantUtilities, ONLY : SafeCopyPlantNode, SetComponentFlowRate
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(IN) :: FirstHVACIteration ! TRUE if 1st HVAC simulation of system timestep
INTEGER, INTENT(IN) :: RadSysNum ! Index for the low temperature radiant system under consideration within the derived types
INTEGER, INTENT(IN) :: SystemType ! Type of radiant system: hydronic, constant flow, or electric
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: BypassMassFlow ! Local bypass for a constant flow radiant system (could have recirculation and/or bypass)
REAL(r64) :: CpWater ! Specific heat of water
INTEGER :: RadSurfNum ! DO loop counter for radiant surfaces in the system
INTEGER :: SurfNum ! Surface index number for the current radiant system
INTEGER :: WaterInletNode ! Node number for the water side inlet of the radiant system
REAL(r64) :: TotalHeatSource ! Total heat source or sink for a particular radiant system (sum of all surface source/sinks)
INTEGER :: TotRadSurfaces ! Total number of radiant surfaces in this system
REAL(r64) :: WaterMassFlow ! Flow rate of water in the radiant system
INTEGER :: WaterOutletNode ! Node number for the water side outlet of the radiant system
REAL(r64) :: ZoneMult ! Zone multiplier
INTEGER :: ZoneNum ! Zone for this radiant system
! FLOW:
SELECT CASE (SystemType)
CASE (HydronicSystem)
TotRadSurfaces = HydrRadSys(RadSysNum)%NumOfSurfaces
CASE (ConstantFlowSystem)
TotRadSurfaces = CFloRadSys(RadSysNum)%NumOfSurfaces
CASE (ElectricSystem)
TotRadSurfaces = ElecRadSys(RadSysNum)%NumOfSurfaces
END SELECT
DO RadSurfNum = 1, TotRadSurfaces
SELECT CASE (SystemType)
CASE (HydronicSystem)
SurfNum = HydrRadSys(RadSysNum)%SurfacePtr(RadSurfNum)
CASE (ConstantFlowSystem)
SurfNum = CFloRadSys(RadSysNum)%SurfacePtr(RadSurfNum)
CASE (ElectricSystem)
SurfNum = ElecRadSys(RadSysNum)%SurfacePtr(RadSurfNum)
END SELECT
IF (LastSysTimeElapsed(SurfNum) == SysTimeElapsed) THEN
! Still iterating or reducing system time step, so subtract old values which were
! not valid
QRadSysSrcAvg(SurfNum) = QRadSysSrcAvg(SurfNum) &
-LastQRadSysSrc(SurfNum)*LastTimeStepSys(SurfNum)/TimeStepZone
END IF
! Update the running average and the "last" values with the current values of the appropriate variables
QRadSysSrcAvg(SurfNum) = QRadSysSrcAvg(SurfNum) &
+QRadSysSource(SurfNum)*TimeStepSys/TimeStepZone
LastQRadSysSrc(SurfNum) = QRadSysSource(SurfNum)
LastSysTimeElapsed(SurfNum) = SysTimeElapsed
LastTimeStepSys(SurfNum) = TimeStepSys
END DO
! For a hydronic system, calculate the water side outlet conditions and set the
! appropriate conditions on the correct HVAC node.
IF (SystemType==HydronicSystem) THEN
! First sum up all of the heat sources/sinks associated with this system
TotalHeatSource = 0.0d0
DO RadSurfNum = 1, HydrRadSys(RadSysNum)%NumOfSurfaces
SurfNum = HydrRadSys(RadSysNum)%SurfacePtr(RadSurfNum)
TotalHeatSource = TotalHeatSource + QRadSysSource(SurfNum)
END DO
ZoneNum = HydrRadSys(RadSysNum)%ZonePtr
ZoneMult = REAL(Zone(ZoneNum)%Multiplier * Zone(ZoneNum)%ListMultiplier,r64)
TotalHeatSource = ZoneMult * TotalHeatSource
! Update the heating side of things
IF (HydrRadSys(RadSysNum)%HeatingSystem) THEN
WaterInletNode = HydrRadSys(RadSysNum)%HotWaterInNode
WaterOutletNode = HydrRadSys(RadSysNum)%HotWaterOutNode
WaterMassFlow = Node(WaterInletNode)%MassFlowRate
CpWater = GetSpecificHeatGlycol(PlantLoop(HydrRadSys(RadSysNum)%HWLoopNum)%FluidName, &
Node(WaterInletNode)%Temp, &
PlantLoop(HydrRadSys(RadSysNum)%HWLoopNum)%FluidIndex, &
'UpdateLowTempRadiantSystem')
SELECT CASE (OperatingMode)
CASE (HeatingMode)
IF ( (CpWater > 0.0d0) .AND. (WaterMassFlow > 0.0d0) ) THEN
CALL SafeCopyPlantNode(WaterInletNode, WaterOutletNode)
! Node(WaterOutletNode) = Node(WaterInletNode) ! bad practice, e.g. wipes out setpoints on outlet
Node(WaterOutletNode)%Temp = Node(WaterInletNode)%Temp &
-TotalHeatSource/WaterMassFlow/CpWater
ELSE
CALL SafeCopyPlantNode(WaterInletNode, WaterOutletNode)
END IF
CASE DEFAULT ! CoolingMode or not on
CALL SafeCopyPlantNode(WaterInletNode, WaterOutletNode)
END SELECT
CALL CheckForOutOfRangeTempResult(SystemType, RadSysNum, Node(WaterOutletNode)%Temp, &
Node(WaterInletNode)%Temp, WaterMassFlow)
END IF
IF (HydrRadSys(RadSysNum)%CoolingSystem) THEN
WaterInletNode = HydrRadSys(RadSysNum)%ColdWaterInNode
WaterOutletNode = HydrRadSys(RadSysNum)%ColdWaterOutNode
WaterMassFlow = Node(WaterInletNode)%MassFlowRate
CpWater = GetSpecificHeatGlycol(PlantLoop(HydrRadSys(RadSysNum)%CWLoopNum)%FluidName, &
Node(WaterInletNode)%Temp, &
PlantLoop(HydrRadSys(RadSysNum)%CWLoopNum)%FluidIndex, &
'UpdateLowTempRadiantSystem')
SELECT CASE (OperatingMode)
CASE (CoolingMode)
IF ( (CpWater > 0.0d0) .AND. (WaterMassFlow > 0.0d0) ) THEN
CALL SafeCopyPlantNode(WaterInletNode,WaterOutletNode)
Node(WaterOutletNode)%Temp = Node(WaterInletNode)%Temp &
-TotalHeatSource/WaterMassFlow/CpWater
ELSE
CALL SafeCopyPlantNode(WaterInletNode,WaterOutletNode)
END IF
CASE DEFAULT ! HeatingMode or not on
CALL SafeCopyPlantNode(WaterInletNode,WaterOutletNode)
END SELECT
CALL CheckForOutOfRangeTempResult(SystemType, RadSysNum, Node(WaterOutletNode)%Temp, &
Node(WaterInletNode)%Temp, WaterMassFlow)
END IF
END IF ! ...end of Hydronic System block
! For a constant flow system, calculate the water side outlet conditions
! and set the appropriate conditions on the correct HVAC node. This may
! require mixing if the main system does not provide all of the flow that
! the local radiant system circulates.
IF (SystemType==ConstantFlowSystem) THEN
! Update the heating side of things
IF (CFloRadSys(RadSysNum)%HeatingSystem) THEN
WaterInletNode = CFloRadSys(RadSysNum)%HotWaterInNode
WaterOutletNode = CFloRadSys(RadSysNum)%HotWaterOutNode
CpWater = GetSpecificHeatGlycol(PlantLoop(CFloRadSys(RadSysNum)%HWLoopNum)%FluidName, &
Node(WaterInletNode)%Temp, &
PlantLoop(CFloRadSys(RadSysNum)%HWLoopNum)%FluidIndex, &
'UpdateLowTempRadiantSystem')
Call SafeCopyPlantNode(WaterInletNode, WaterOutletNode)
IF (OperatingMode == HeatingMode) THEN
! Leave the inlet and outlet flow alone (if high enough) and perform a bypass if more flow than needed
IF (Node(WaterInletNode)%MassFlowRate <= CFloRadSys(RadSysNum)%WaterInjectionRate) THEN
! Note that the water injection rate has already been restricted to the maximum available flow
Node(WaterOutletNode)%Temp = CFloRadSys(RadSysNum)%WaterOutletTemp
ELSE
! Loop is providing more flow than needed so perform a local bypass and
! mix the flows to obtain the proper outlet temperature. In this case,
! the mass flow rates on the loop are left alone and the outlet temperature
! is calculated from a simple steady-steady, steady-flow energy balance.
BypassMassFlow = Node(WaterInletNode)%MassFlowRate - CFloRadSys(RadSysNum)%WaterInjectionRate
Node(WaterOutletNode)%Temp = ( (BypassMassFlow*Node(WaterInletNode)%Temp) &
+(CFloRadSys(RadSysNum)%WaterInjectionRate*CFloRadSys(RadSysNum)%WaterOutletTemp) ) &
/(Node(WaterOutletNode)%MassFlowRate)
END IF
END IF
CALL CheckForOutOfRangeTempResult(SystemType, RadSysNum, Node(WaterOutletNode)%Temp, &
Node(WaterInletNode)%Temp, Node(WaterOutletNode)%MassFlowRate)
END IF
IF (CFloRadSys(RadSysNum)%CoolingSystem) THEN
WaterInletNode = CFloRadSys(RadSysNum)%ColdWaterInNode
WaterOutletNode = CFloRadSys(RadSysNum)%ColdWaterOutNode
CpWater = GetSpecificHeatGlycol('WATER',Node(WaterInletNode)%Temp,CFloRadSys(RadSysNum)%GlycolIndex, &
'UpdateLowTempRadiantSystem')
CALL SafeCopyPlantNode(WaterInletNode, WaterOutletNode)
IF (OperatingMode == CoolingMode) THEN
IF (Node(WaterInletNode)%MassFlowRate <= CFloRadSys(RadSysNum)%WaterInjectionRate) THEN
! Note that the water injection rate has already been restricted to the maximum available flow
Node(WaterOutletNode)%Temp = CFloRadSys(RadSysNum)%WaterOutletTemp
ELSE
! Loop is providing more flow than needed so perform a local bypass and
! mix the flows to obtain the proper outlet temperature. In this case,
! the mass flow rates on the loop are left alone and the outlet temperature
! is calculated from a simple steady-steady, steady-flow energy balance.
BypassMassFlow = Node(WaterInletNode)%MassFlowRate - CFloRadSys(RadSysNum)%WaterInjectionRate
Node(WaterOutletNode)%Temp = ( (BypassMassFlow*Node(WaterInletNode)%Temp) &
+(CFloRadSys(RadSysNum)%WaterInjectionRate*CFloRadSys(RadSysNum)%WaterOutletTemp) ) &
/(Node(WaterOutletNode)%MassFlowRate)
END IF
CALL CheckForOutOfRangeTempResult(SystemType, RadSysNum, Node(WaterOutletNode)%Temp, Node(WaterInletNode)%Temp, &
Node(WaterOutletNode)%MassFlowRate)
END IF
END IF
END IF ! ...end of Constant Flow System block
! Electric systems just burn electrical current and do not need to update nodes.
RETURN
END SUBROUTINE UpdateLowTempRadiantSystem