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 | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | UnitarySysNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
integer, | intent(in) | :: | AirLoopNum | |||
integer, | intent(inout) | :: | CompOn | |||
real(kind=r64), | intent(in), | optional | :: | OAUCoilOutTemp | ||
logical, | intent(inout), | optional | :: | HXUnitOn |
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 ControlUnitarySystemtoLoad(UnitarySysNum, FirstHVACIteration, AirLoopNum,CompOn,OAUCoilOutTemp,HXUnitOn)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN February 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine manages DXCoolingSystem component simulation.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataAirLoop, ONLY: AirLoopControlInfo
USE PlantUtilities, ONLY: SetComponentFlowRate
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: UnitarySysNum ! Index of AirloopHVAC:UnitarySystem object
LOGICAL, INTENT(IN) :: FirstHVACIteration ! True when first HVAC iteration
INTEGER, INTENT(IN) :: AirLoopNum ! Primary air loop number
INTEGER, INTENT(INOUT) :: CompOn ! Determines if compressor is on or off
REAL(r64), INTENT(IN), OPTIONAL :: OAUCoilOutTemp ! the coil inlet temperature of OutdoorAirUnit
LOGICAL, INTENT(INOUT), OPTIONAL :: HXUnitOn ! Flag to control HX for HXAssisted Cooling Coil
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(R64) :: CoolPLR ! cooling part-load ratio
REAL(R64) :: HeatPLR ! heating part-load ratio
REAL(R64) :: SuppPLR ! supplemental heating part-load ratio
REAL(R64) :: SensOutput ! Sensible output of Unitary System (W)
REAL(R64) :: LatOutput ! Latent output of Unitary System (W)
REAL(R64) :: ZoneLoad ! zone load (W)
REAL(R64) :: OnOffAirFlowRatio ! ratio of on to off air flow
REAL(R64) :: QZnReq ! zone load (W)
REAL(R64) :: FullSensibleOutput ! sensible output of Unitary System (W)
! REAL(R64) :: FullLatentOutput ! latent output of Unitary System (W)
REAL(R64) :: SupHeaterLoad ! additional heating required by supplemental heater (W)
REAL(r64) :: HeatCoilLoad ! load pass to heating coil (W)
OnOffAirFlowRatio = 1.0d0
QZnReq = 0.0d0
CALL UpdateUnitarySystemControl(UnitarySysNum,AirLoopNum, &
UnitarySystem(UnitarySysNum)%CoolCoilOutletNodeNum, &
UnitarySystem(UnitarySysNum)%SystemCoolControlNodeNum, OnOffAirFlowRatio, &
OAUCoilOutTemp, FirstHVACIteration, ZoneLoad)
! will not be running supplemental heater on this CALL (simulate with supplemental heater off)
FullSensibleOutput = 0.0d0
! using furnace module logic
! first check to see if cycling fan with economizer can meet the load
IF(AirLoopNum > 0)THEN
IF ( UnitarySystem(UnitarySysNum)%CoolCoilExists .AND. UnitarySystem(UnitarySysNum)%HeatCoilExists .AND. &
UnitarySystem(UnitarySysNum)%CoolingCoilType_Num /= Coil_CoolingAirToAirVariableSpeed .AND. &
UnitarySystem(UnitarySysNum)%HeatingCoilType_Num /= Coil_HeatingAirToAirVariableSpeed .AND. &
.NOT. FirstHVACIteration .AND. UnitarySystem(UnitarySysNum)%FanOpMode == CycFanCycCoil .AND. CoolingLoad &
.AND. AirLoopControlInfo(AirLoopNum)%EconoActive) THEN
CompOn=0
CALL ControlUnitarySystemOutput(UnitarySysNum, FirstHVACIteration, OnOffAirFlowRatio, &
HXUnitOn, ZoneLoad, FullSensibleOutput, CompOn)
IF (UnitarySystem(UnitarySysNum)%CoolingPartLoadFrac >= 1.0d0 .OR. UnitarySystem(UnitarySysNum)%HeatingPartLoadFrac >= 1.0d0 &
.OR. (UnitarySystem(UnitarySysNum)%CoolingPartLoadFrac <= 0.0d0 .AND. &
UnitarySystem(UnitarySysNum)%HeatingPartLoadFrac <= 0.0d0)) THEN
CompOn=1
CALL ControlUnitarySystemOutput(UnitarySysNum, FirstHVACIteration, OnOffAirFlowRatio, &
HXUnitOn, ZoneLoad, FullSensibleOutput, CompOn)
END IF
ELSE
CompOn = 1
CALL ControlUnitarySystemOutput(UnitarySysNum, FirstHVACIteration, OnOffAirFlowRatio, &
HXUnitOn, ZoneLoad, FullSensibleOutput, CompOn)
END IF
ELSE
CompOn = 1
CALL ControlUnitarySystemOutput(UnitarySysNum, FirstHVACIteration, OnOffAirFlowRatio, &
HXUnitOn, ZoneLoad, FullSensibleOutput, CompOn)
END IF
CoolPLR = UnitarySystem(UnitarySysNum)%CoolingPartLoadFrac
HeatPLR = UnitarySystem(UnitarySysNum)%HeatingPartLoadFrac
HeatCoilLoad = HeatPLR * UnitarySystem(UnitarySysNum)%DesignHeatingCapacity
SensOutput = 0.0d0
LatOutput = 0.0d0
IF(UnitarySystem(UnitarySysNum)%CoolCoilFluidInletNode .GT. 0)THEN
CALL SetComponentFlowRate( Node(UnitarySystem(UnitarySysNum)%CoolCoilFluidInletNode)%MassFlowRate, &
UnitarySystem(UnitarySysNum)%CoolCoilFluidInletNode, &
UnitarySystem(UnitarySysNum)%CoolCoilFluidOutletNodeNum,&
UnitarySystem(UnitarySysNum)%CoolCoilLoopNum, &
UnitarySystem(UnitarySysNum)%CoolCoilLoopSide, &
UnitarySystem(UnitarySysNum)%CoolCoilBranchNum, &
UnitarySystem(UnitarySysNum)%CoolCoilCompNum )
END IF
IF(UnitarySystem(UnitarySysNum)%HeatCoilFluidInletNode .GT. 0)THEN
CALL SetComponentFlowRate( Node(UnitarySystem(UnitarySysNum)%HeatCoilFluidInletNode)%MassFlowRate, &
UnitarySystem(UnitarySysNum)%HeatCoilFluidInletNode, &
UnitarySystem(UnitarySysNum)%HeatCoilFluidOutletNodeNum,&
UnitarySystem(UnitarySysNum)%HeatCoilLoopNum, &
UnitarySystem(UnitarySysNum)%HeatCoilLoopSide, &
UnitarySystem(UnitarySysNum)%HeatCoilBranchNum, &
UnitarySystem(UnitarySysNum)%HeatCoilCompNum )
END IF
IF (UnitarySystem(UnitarySysNum)%SuppCoilExists .AND. (HeatingLoad .OR. CoolingLoad .OR. MoistureLoad<0.0d0)) THEN
IF((FullSensibleOutput < (QToHeatSetPt - SmallLoad)) .AND. .NOT. FirstHVACIteration)THEN
SupHeaterLoad = MAX(0.0d0,QToHeatSetPt - FullSensibleOutput)
UnitarySystem(UnitarySysNum)%SupHeaterLoad = 0.0d0
! what does this line even do? I know we want the supplemental heater on only if there is a dehum load,
! but for HP's the supp heater should also run if the heating coil can't turn on
! (i.e., this line calc's a supp heater load, then next line also calc's it?)
IF (MoistureLoad < 0.0d0) &
UnitarySystem(UnitarySysNum)%SupHeaterLoad = SupHeaterLoad
! so it look's like this next line should only be valid for HP's.
IF(UnitarySystem(UnitarySysNum)%DesignSuppHeatingCapacity .GT. 0.0d0)THEN
UnitarySystem(UnitarySysNum)%SuppHeatPartLoadFrac = &
MIN(1.0d0,SupHeaterLoad/UnitarySystem(UnitarySysNum)%DesignSuppHeatingCapacity)
END IF
ELSE
SupHeaterLoad = 0.0d0
UnitarySystem(UnitarySysNum)%SuppHeatPartLoadFrac = 0.0d0
END IF
ELSE
SupHeaterLoad = 0.0d0
UnitarySystem(UnitarySysNum)%SuppHeatPartLoadFrac = 0.0d0
END IF
CALL CalcUnitarySystemToLoad(UnitarySysNum,FirstHVACIteration,CoolPLR,HeatPLR, &
OnOffAirFlowRatio,SensOutput,LatOutput,HXUnitOn,HeatCoilLoad=HeatCoilLoad, &
SuppCoilLoad=SupHeaterLoad,CompOn=CompOn)
! check supplemental heating coil outlet temp based on maximum allowed
IF(UnitarySystem(UnitarySysNum)%SuppCoilExists)THEN
SuppPLR = UnitarySystem(UnitarySysNum)%SuppHeatPartLoadFrac
! only need to test for high supply air temp if supplemental coil is operating
IF(SuppPLR > 0.0d0)THEN
CALL CalcUnitarySystemToLoad(UnitarySysNum,FirstHVACIteration,CoolPLR,HeatPLR,OnOffAirFlowRatio, &
SensOutput,LatOutput,HXUnitOn,HeatCoilLoad=HeatCoilLoad,SuppCoilLoad=SupHeaterLoad, CompOn=CompOn)
IF(UnitarySystem(UnitarySysNum)%DesignSuppHeatingCapacity .GT. 0.0d0)THEN
UnitarySystem(UnitarySysNum)%SuppHeatPartLoadFrac = SupHeaterLoad/UnitarySystem(UnitarySysNum)%DesignSuppHeatingCapacity
ELSE
UnitarySystem(UnitarySysNum)%SuppHeatPartLoadFrac = 0.0d0
END IF
END IF
END IF
IF(UnitarySystem(UnitarySysNum)%SuppCoilFluidInletNode .GT. 0)THEN
CALL SetComponentFlowRate( Node(UnitarySystem(UnitarySysNum)%SuppCoilFluidInletNode)%MassFlowRate, &
UnitarySystem(UnitarySysNum)%SuppCoilFluidInletNode, &
UnitarySystem(UnitarySysNum)%SuppCoilFluidOutletNodeNum,&
UnitarySystem(UnitarySysNum)%SuppCoilLoopNum, &
UnitarySystem(UnitarySysNum)%SuppCoilLoopSide, &
UnitarySystem(UnitarySysNum)%SuppCoilBranchNum, &
UnitarySystem(UnitarySysNum)%SuppCoilCompNum )
END IF
IF (UnitarySystem(UnitarySysNum)%HeatRecActive) THEN
CALL SetComponentFlowRate(Node(UnitarySystem(UnitarySysNum)%HeatRecoveryInletNodeNum)%MassFlowRate, &
UnitarySystem(UnitarySysNum)%HeatRecoveryInletNodeNum, &
UnitarySystem(UnitarySysNum)%HeatRecoveryOutletNodeNum, &
UnitarySystem(UnitarySysNum)%HRLoopNum, &
UnitarySystem(UnitarySysNum)%HRLoopSideNum, &
UnitarySystem(UnitarySysNum)%HRBranchNum, &
UnitarySystem(UnitarySysNum)%HRCompNum )
END IF
RETURN
END SUBROUTINE ControlUnitarySystemtoLoad