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 | |||
real(kind=R64), | intent(in) | :: | CoolPLR | |||
real(kind=R64), | intent(in) | :: | HeatPLR | |||
real(kind=R64), | intent(inout) | :: | OnOffAirFlowRatio | |||
real(kind=R64), | intent(inout) | :: | SensOutput | |||
real(kind=R64), | intent(inout) | :: | LatOutput | |||
logical, | intent(inout), | optional | :: | HXUnitOn | ||
real(kind=r64), | intent(inout), | optional | :: | HeatCoilLoad | ||
real(kind=r64), | intent(inout), | optional | :: | SuppCoilLoad | ||
integer, | intent(in), | optional | :: | CompOn |
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 CalcUnitarySystemToLoad(UnitarySysNum,FirstHVACIteration,CoolPLR,HeatPLR, &
OnOffAirFlowRatio,SensOutput,LatOutput,HXUnitOn,HeatCoilLoad,SuppCoilLoad,CompOn)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN February 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine calculates the resulting performance of the unitary system given
! the operating PLR. System output is calculated with respect to zone condition.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE Fans, ONLY: SimulateFanComponents
USE Psychrometrics, ONLY: PsyHFnTdbW, PsyCpAirFnWTdb
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
REAL(R64), INTENT(IN) :: CoolPLR ! operating cooling part-load ratio []
REAL(R64), INTENT(IN) :: HeatPLR ! operating cooling part-load ratio []
REAL(R64), INTENT(INOUT) :: OnOffAirFlowRatio ! ratio of heating PLR to cooling PLR (is this correct?)
REAL(R64), INTENT(INOUT) :: SensOutput ! sensible capacity (W)
REAL(R64), INTENT(INOUT) :: LatOutput ! latent capacity (W)
LOGICAL, INTENT(INOUT), OPTIONAL :: HXUnitOn ! Flag to control HX for HXAssisted Cooling Coil
REAL(r64), INTENT(INOUT), OPTIONAL :: HeatCoilLoad ! Adjusted load to heating coil when SAT exceeds max limit (W)
REAL(r64), INTENT(INOUT), OPTIONAL :: SuppCoilLoad ! Adjusted load to supp heating coil when SAT exceeds max limit (W)
INTEGER, OPTIONAL, INTENT(IN) :: CompOn ! Determines if compressor is on or off
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: OutletNode ! DX System outlet node number
REAL(R64) :: SuppPLR ! supplemental heating coil operating part-load ratio
REAL(R64) :: MinHumRatio ! used to calculate delivered capacity
REAL(R64) :: AirMassFlow ! operating mass flow rate through unitary system (kg/s)
REAL(R64) :: ZoneTemp ! zone node temperature (C)
REAL(R64) :: ZoneHumRat ! zone node humidity ratio (kg-water/kg-dryair)
REAL(R64) :: CoilCoolHeatRat ! ratio of cooling to heating PLR for cycling fan RH control
INTEGER :: CoolingCompOn ! Compressor control (0=off, 1=on1)
INTEGER :: HeatingCompOn ! Compressor control (0=off, 1=on1)
REAL(r64) :: MDotAir ! inlet air mass flow rate [kg/s]
REAL(r64) :: CpAir ! average specific heat [J/kg-C]
REAL(r64) :: CpAirIn ! inlet air Cp [J/kg-C]
REAL(r64) :: CpAirOut ! outlet air Cp [J/kg-C]
REAL(r64) :: HCDeltaT ! heating coil delta temperture [deltaC]
REAL(r64) :: MaxHeatCoilLoad ! maximum allowed coil load so max temp is not exceeded [W]
CoolingCompOn=0
IF(CoolPLR>0)THEN
CoolingCompOn=1
! let logical override compressor status if present (tests if economizer can meet load without compressor)
IF(PRESENT(CompOn))CoolingCompOn=CompOn
! for multispeed coils, comp is on IF speed > 1
ELSEIF(UnitarySystem(UnitarySysNum)%CoolingSpeedNum .GT. 1)THEN
CoolingCompOn=1
END IF
HeatingCompOn=0
IF(HeatPLR>0)THEN
HeatingCompOn=1
! let logical override compressor status if present (tests if economizer can meet load without compressor)
! probably don't need this for heating mode
IF(PRESENT(CompOn))HeatingCompOn=CompOn
CoilCoolHeatRat = MIN(1.0d0,CoolPLR/HeatPLR)
ELSE
CoilCoolHeatRat = 1.0d0
END IF
! for multispeed coils, comp is on at PLR=0 IF speed > 1
IF(UnitarySystem(UnitarySysNum)%HeatingSpeedNum .GT. 1)HeatingCompOn=1
! set the operating flow rate
IF(UnitarySystem(UnitarySysNum)%NumOfSpeedCooling > 0 .OR. &
UnitarySystem(UnitarySysNum)%NumOfSpeedHeating > 0)THEN
CALL SetOnOffMassFlowRate(UnitarySysNum, OnOffAirFlowRatio, MAX(CoolPLR,HeatPLR))
ELSE
CALL SetAverageAirFlow(UnitarySysNum, MAX(CoolPLR,HeatPLR), OnOffAirFlowRatio)
END IF
! Call the series of components that simulate a Unitary System
IF (UnitarySystem(UnitarySysNum)%FanExists .AND. UnitarySystem(UnitarySysNum)%FanPlace .EQ. BlowThru) THEN
CALL SimulateFanComponents(Blank,FirstHVACIteration,UnitarySystem(UnitarySysNum)%FanIndex,FanSpeedRatio)
END IF
IF(UnitarySystem(UnitarySysNum)%CoolingCoilUpstream)THEN
IF (UnitarySystem(UnitarySysNum)%CoolCoilExists)THEN
CALL CalcUnitaryCoolingSystem(UnitarySysNum, FirstHVACIteration, CoolPLR, CoolingCompOn, OnOffAirFlowRatio, &
CoilCoolHeatRat, HXUnitOn)
END IF
IF (UnitarySystem(UnitarySysNum)%HeatCoilExists)THEN
! operate the heating coil without regard to coil outlet temperature
CALL CalcUnitaryHeatingSystem(UnitarySysNum, FirstHVACIteration, HeatPLR, HeatingCompOn, &
OnOffAirFlowRatio, HeatCoilLoad)
IF(Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%Temp .GT. &
UnitarySystem(UnitarySysNum)%DesignMaxOutletTemp)THEN
MDotAir = Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%MassFlowRate
CpAirIn = PsyCpAirFnWTdb(Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%HumRat, &
Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%Temp)
CpAirOut = PsyCpAirFnWTdb(Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%HumRat, &
Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%Temp)
CpAir = (CpAirIn + CpAirout)/2
HCDeltaT = UnitarySystem(UnitarySysNum)%DesignMaxOutletTemp - &
Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%Temp
MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT
CALL CalcUnitaryHeatingSystem(UnitarySysNum, FirstHVACIteration, HeatPLR, HeatingCompOn, &
OnOffAirFlowRatio, MaxHeatCoilLoad)
IF(PRESENT(HeatCoilLoad))HeatCoilLoad = MaxHeatCoilLoad
END IF
END IF
! If blow thru fan is used, the fan must be simulated after coil sets OnOffFanPartLoadFraction
IF (UnitarySystem(UnitarySysNum)%FanExists .AND. UnitarySystem(UnitarySysNum)%FanPlace .EQ. BlowThru .AND. &
OnOffFanPartLoadFraction < 1.0d0) THEN
CALL SimulateFanComponents(Blank,FirstHVACIteration,UnitarySystem(UnitarySysNum)%FanIndex,FanSpeedRatio)
IF (UnitarySystem(UnitarySysNum)%CoolCoilExists)THEN
CALL CalcUnitaryCoolingSystem(UnitarySysNum, FirstHVACIteration, CoolPLR, CoolingCompOn, OnOffAirFlowRatio, &
CoilCoolHeatRat, HXUnitOn)
END IF
IF (UnitarySystem(UnitarySysNum)%HeatCoilExists)THEN
CALL CalcUnitaryHeatingSystem(UnitarySysNum, FirstHVACIteration, HeatPLR, HeatingCompOn, OnOffAirFlowRatio, HeatCoilLoad)
IF(Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%Temp .GT. &
UnitarySystem(UnitarySysNum)%DesignMaxOutletTemp)THEN
MDotAir = Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%MassFlowRate
CpAirIn = PsyCpAirFnWTdb(Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%HumRat, &
Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%Temp)
CpAirOut = PsyCpAirFnWTdb(Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%HumRat, &
Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%Temp)
CpAir = (CpAirIn + CpAirout)/2
HCDeltaT = UnitarySystem(UnitarySysNum)%DesignMaxOutletTemp - &
Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%Temp
MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT
CALL CalcUnitaryHeatingSystem(UnitarySysNum, FirstHVACIteration, HeatPLR, HeatingCompOn, &
OnOffAirFlowRatio, MaxHeatCoilLoad)
END IF
END IF
END IF
ELSE
IF (UnitarySystem(UnitarySysNum)%HeatCoilExists)THEN
CALL CalcUnitaryHeatingSystem(UnitarySysNum, FirstHVACIteration, HeatPLR, HeatingCompOn, OnOffAirFlowRatio, HeatCoilLoad)
IF(Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%Temp .GT. &
UnitarySystem(UnitarySysNum)%DesignMaxOutletTemp)THEN
MDotAir = Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%MassFlowRate
CpAirIn = PsyCpAirFnWTdb(Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%HumRat, &
Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%Temp)
CpAirOut = PsyCpAirFnWTdb(Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%HumRat, &
Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%Temp)
CpAir = (CpAirIn + CpAirout)/2
HCDeltaT = UnitarySystem(UnitarySysNum)%DesignMaxOutletTemp - &
Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%Temp
MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT
CALL CalcUnitaryHeatingSystem(UnitarySysNum, FirstHVACIteration, HeatPLR, HeatingCompOn, &
OnOffAirFlowRatio, MaxHeatCoilLoad)
END IF
END IF
IF (UnitarySystem(UnitarySysNum)%CoolCoilExists)THEN
CALL CalcUnitaryCoolingSystem(UnitarySysNum, FirstHVACIteration, CoolPLR, CoolingCompOn, OnOffAirFlowRatio, &
CoilCoolHeatRat, HXUnitOn)
END IF
! If blow thru fan is used, the fan must be simulated after coil sets OnOffFanPartLoadFraction
IF (UnitarySystem(UnitarySysNum)%FanExists .AND. UnitarySystem(UnitarySysNum)%FanPlace .EQ. BlowThru .AND. &
OnOffFanPartLoadFraction < 1.0d0) THEN
CALL SimulateFanComponents(Blank,FirstHVACIteration,UnitarySystem(UnitarySysNum)%FanIndex,FanSpeedRatio)
IF (UnitarySystem(UnitarySysNum)%HeatCoilExists)THEN
CALL CalcUnitaryHeatingSystem(UnitarySysNum, FirstHVACIteration, HeatPLR, HeatingCompOn, OnOffAirFlowRatio, HeatCoilLoad)
IF(Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%Temp .GT. &
UnitarySystem(UnitarySysNum)%DesignMaxOutletTemp)THEN
MDotAir = Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%MassFlowRate
CpAirIn = PsyCpAirFnWTdb(Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%HumRat, &
Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%Temp)
CpAirOut = PsyCpAirFnWTdb(Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%HumRat, &
Node(UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum)%Temp)
CpAir = (CpAirIn + CpAirout)/2
HCDeltaT = UnitarySystem(UnitarySysNum)%DesignMaxOutletTemp - &
Node(UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum)%Temp
MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT
CALL CalcUnitaryHeatingSystem(UnitarySysNum, FirstHVACIteration, HeatPLR, HeatingCompOn, &
OnOffAirFlowRatio, MaxHeatCoilLoad)
END IF
END IF
IF (UnitarySystem(UnitarySysNum)%CoolCoilExists)THEN
CALL CalcUnitaryCoolingSystem(UnitarySysNum, FirstHVACIteration, CoolPLR, CoolingCompOn, OnOffAirFlowRatio, &
CoilCoolHeatRat, HXUnitOn)
END IF
END IF
END IF
IF (UnitarySystem(UnitarySysNum)%FanExists .AND. UnitarySystem(UnitarySysNum)%FanPlace .EQ. DrawThru) THEN
CALL SimulateFanComponents(Blank,FirstHVACIteration,UnitarySystem(UnitarySysNum)%FanIndex,FanSpeedRatio)
END IF
SuppPLR = UnitarySystem(UnitarySysNum)%SuppHeatPartLoadFrac
IF (UnitarySystem(UnitarySysNum)%SuppCoilExists)THEN
CALL CalcUnitarySuppHeatingSystem(UnitarySysNum, FirstHVACIteration, SuppPLR, SuppCoilLoad)
IF((Node(UnitarySystem(UnitarySysNum)%SuppCoilAirOutletNode)%Temp .GT. &
UnitarySystem(UnitarySysNum)%DesignMaxOutletTemp) .AND. SuppPLR .GT. 0.0d0)THEN
MDotAir = Node(UnitarySystem(UnitarySysNum)%SuppCoilAirInletNode)%MassFlowRate
CpAirIn = PsyCpAirFnWTdb(Node(UnitarySystem(UnitarySysNum)%SuppCoilAirInletNode)%HumRat, &
Node(UnitarySystem(UnitarySysNum)%SuppCoilAirInletNode)%Temp)
CpAirOut = PsyCpAirFnWTdb(Node(UnitarySystem(UnitarySysNum)%SuppCoilAirOutletNode)%HumRat, &
Node(UnitarySystem(UnitarySysNum)%SuppCoilAirOutletNode)%Temp)
CpAir = (CpAirIn + CpAirout)/2
HCDeltaT = MAX(0.0d0,UnitarySystem(UnitarySysNum)%DesignMaxOutletTemp - &
Node(UnitarySystem(UnitarySysNum)%SuppCoilAirInletNode)%Temp)
MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT
CALL CalcUnitarySuppHeatingSystem(UnitarySysNum, FirstHVACIteration, SuppPLR, MaxHeatCoilLoad)
IF(PRESENT(SuppCoilLoad))SuppCoilLoad = MaxHeatCoilLoad
END IF
END IF
! Check delta T (outlet to space), IF positive
! use space HumRat (next line), ELSE outlet humrat (IF) so psyc routine gives good result
MinHumRatio = Node(UnitarySystem(UnitarySysNum)%NodeNumofControlledZone)%HumRat
OutletNode = UnitarySystem(UnitarySysNum)%UnitarySystemOutletNodeNum
AirMassFlow = Node(OutletNode)%MassFlowRate
ZoneTemp = Node(UnitarySystem(UnitarySysNum)%NodeNumofControlledZone)%Temp
ZoneHumRat = Node(UnitarySystem(UnitarySysNum)%NodeNumofControlledZone)%HumRat
IF(Node(OutletNode)%Temp .LT. ZoneTemp ) MinHumRatio = Node(OutletNode)%HumRat
! Calculate sensible load met (at constant humidity ratio)
SensOutput = AirMassFlow * (PsyHFnTdbW(Node(OutletNode)%Temp,MinHumRatio) &
- PsyHFnTdbW(ZoneTemp,MinHumRatio)) &
- UnitarySystem(UnitarySysNum)%SenLoadLoss
UnitarySystem(UnitarySysNum)%SensibleLoadMet = SensOutput
IF(UnitarySystem(UnitarySysNum)%Humidistat)THEN
! Calculate latent load met (at constant temperature)
LatOutput = AirMassFlow * (PsyHFnTdbW(ZoneTemp,Node(OutletNode)%HumRat) &
- PsyHFnTdbW(ZoneTemp,ZoneHumRat)) - UnitarySystem(UnitarySysNum)%LatLoadLoss
ELSE
LatOutput = 0.0d0
END IF
UnitarySystem(UnitarySysNum)%LatentLoadMet = LatOutput
RETURN
END SUBROUTINE CalcUnitarySystemToLoad