SUBROUTINE UpdateZoneSizing(CallIndicator)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN December 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Update the result variables of the zone sizing calculation
! METHODOLOGY EMPLOYED:
! CallIndicator = 1 (BeginDay) zero the result arrays
! CallIndicator = 2 (DuringDay) fill arrays, averaging over 1 zone time step
! CallIndicator = 3 (EndDay) calculate daily maxima
! CallIndicator = 4 (EndZoneSizingCalc) write out results
! REFERENCES:
! na
! USE STATEMENTS:
USE DataGlobals, ONLY: HourOfDay, TimeStep, TimeStepZone, NumOfTimeStepInHour, &
BeginDay, DuringDay, EndDay, EndZoneSizingCalc, MinutesPerTimeStep, &
OutputFileZoneSizing, OutputFileDebug, emsCallFromZoneSizing, AnyEnergyManagementSystemInModel, &
isPulseZoneSizing, OutputFileZonePulse
USE DataInterfaces, ONLY: SetupEMSActuator
USE DataHVACGlobals, ONLY: FracTimeStepZone, SmallMassFlow, SmallTempDiff
USE DataEnvironment, ONLY : StdBaroPress, StdRhoAir
USE General, ONLY: MovingAvg, RoundSigDigits
USE DataHeatBalFanSys, ONLY: ZoneThermostatSetPointHi, ZoneThermostatSetPointLo,TempZoneThermostatSetPoint
USE EMSManager, ONLY: ManageEMS
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER :: CallIndicator
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: fmta="(A)"
CHARACTER(len=*), PARAMETER :: ZSizeFmt10="('Time')"
CHARACTER(len=*), PARAMETER :: ZSizeFmt11="(A1,A,':',A,A,A1,A,':',A,A,A1,A,':',A,A,A1,A,':',A,A )"
CHARACTER(len=*), PARAMETER :: ZSizeFmt20="(I2.2,':',I2.2,':00')"
CHARACTER(len=*), PARAMETER :: ZSizeFmt21="(A1,ES12.6,A1,ES12.6,A1,ES12.6,A1,ES12.6 )"
CHARACTER(len=*), PARAMETER :: ZSizeFmt30="('Peak')"
CHARACTER(len=*), PARAMETER :: ZSizeFmt31="(A1,ES12.6,A1,ES12.6,A1,ES12.6,A1,ES12.6)"
CHARACTER(len=*), PARAMETER :: ZSizeFmt40="(/'Peak Vol Flow (m3/s)')"
CHARACTER(len=*), PARAMETER :: ZSizeFmt41="(A1,A1,A1,ES12.6,A1,ES12.6)"
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: DesDayNum ! design day index
INTEGER :: TimeStepIndex ! zone time step index
INTEGER :: CtrlZoneNum ! controlled zone index
INTEGER :: TimeStepInDay ! zone time step in day
INTEGER :: I ! write statement index
! REAL(r64) :: HourFrac ! fractional hour
INTEGER :: HourCounter ! Hour Counter
INTEGER :: TimeStepCounter ! Time Step Counter
INTEGER :: Minutes ! Current Minutes Counter
INTEGER :: HourPrint ! Hour to print (timestamp)
REAL(r64) :: OAFrac ! outside air fraction
INTEGER :: TimeStepAtPeak ! time step number at heat or cool peak
INTEGER :: TimeStepAtPeakF ! time step number at heat or cool peak (final)
INTEGER :: DDNum ! Design Day index
INTEGER :: DDNumF ! Design Day index (final)
REAL(r64) :: TotCoolSizMult ! combines user cooling design flow input with zone sizing multiplier
REAL(r64) :: TotHeatSizMult ! combines user heating design flow input with zone sizing multiplier
REAL(r64) :: MinOAMass ! zone minimum outside air mass flow rate kg/s
REAL(r64) :: MaxOfMinCoolVolFlow ! max of the user specified design cooling minimum flows and min OA flow [m3/s]
REAL(r64) :: MaxOfMinCoolMassFlow ! max of the user specified design cooling minimum flows and min OA flow [kg/s]
REAL(r64) :: MaxHeatVolFlow ! max of user specified design heating max flow [m3/s]
CHARACTER(len=8) :: HrMinString ! store hour/minute string before assigning to peak string array
REAL(r64) :: SupplyTemp ! supply air temperature [C]
REAL(r64) :: DeltaTemp ! supply air delta temperature [deltaC]
SELECT CASE (CallIndicator)
CASE (BeginDay)
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolDesDay = EnvironmentName
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatDesDay = EnvironmentName
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatDens = StdRhoAir
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolDens = StdRhoAir
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatDDNum = CurOverallSimDay
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolDDNum = CurOverallSimDay
END DO
CASE (DuringDay)
TimeStepInDay = (HourOfDay-1)*NumOfTimeStepInHour + TimeStep
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
IF (ZoneThermostatSetPointHi(CtrlZoneNum) > 0.0d0 .AND. &
ZoneThermostatSetPointHi(CtrlZoneNum) > ZoneSizThermSetPtHi(CtrlZoneNum)) THEN
ZoneSizThermSetPtHi(CtrlZoneNum) = ZoneThermostatSetPointHi(CtrlZoneNum)
END IF
IF (ZoneThermostatSetPointLo(CtrlZoneNum) > 0.0d0 .AND. &
ZoneThermostatSetPointLo(CtrlZoneNum) < ZoneSizThermSetPtLo(CtrlZoneNum)) THEN
ZoneSizThermSetPtLo(CtrlZoneNum) = ZoneThermostatSetPointLo(CtrlZoneNum)
END IF
ZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatSetPtSeq(TimeStepInDay) = ZoneThermostatSetPointLo(CtrlZoneNum)
ZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatTstatTempSeq(TimeStepInDay) = TempZoneThermostatSetPoint(CtrlZoneNum)
ZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolSetPtSeq(TimeStepInDay) = ZoneThermostatSetPointHi(CtrlZoneNum)
ZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolTstatTempSeq(TimeStepInDay) = TempZoneThermostatSetPoint(CtrlZoneNum)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatFlowSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatFlowSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatMassFlow * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatLoadSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatLoadSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatLoad * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneTempSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneTempSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneTemp * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatOutTempSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatOutTempSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatOutTemp * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneRetTempSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneRetTempSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneRetTemp * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatTstatTempSeq(TimeStepInDay) = &
TempZoneThermostatSetPoint(CtrlZoneNum)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneHumRatSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneHumRatSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneHumRat * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatOutHumRatSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatOutHumRatSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatOutHumRat * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolFlowSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolFlowSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolMassFlow * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolLoadSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolLoadSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolLoad * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneTempSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneTempSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneTemp * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolOutTempSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolOutTempSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolOutTemp * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneRetTempSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneRetTempSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneRetTemp * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolTstatTempSeq(TimeStepInDay) = &
TempZoneThermostatSetPoint(CtrlZoneNum)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneHumRatSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneHumRatSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneHumRat * FracTimeStepZone
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolOutHumRatSeq(TimeStepInDay) = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolOutHumRatSeq(TimeStepInDay) + &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolOutHumRat * FracTimeStepZone
END DO
CASE (EndDay)
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
AvgData = 0.0d0
CALL MovingAvg(CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolFlowSeq,NumOfTimeStepInDay,NumTimeStepsInAvg,AvgData)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolFlowSeq = AvgData
END DO
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
AvgData = 0.0d0
CALL MovingAvg(CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolLoadSeq,NumOfTimeStepInDay,NumTimeStepsInAvg,AvgData)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolLoadSeq = AvgData
END DO
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
AvgData = 0.0d0
CALL MovingAvg(CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatFlowSeq,NumOfTimeStepInDay,NumTimeStepsInAvg,AvgData)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatFlowSeq = AvgData
END DO
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
AvgData = 0.0d0
CALL MovingAvg(CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatLoadSeq,NumOfTimeStepInDay,NumTimeStepsInAvg,AvgData)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatLoadSeq = AvgData
END DO
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
AvgData = 0.0d0
CALL MovingAvg(CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneRetTempSeq,NumOfTimeStepInDay,NumTimeStepsInAvg,AvgData)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneRetTempSeq = AvgData
END DO
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
AvgData = 0.0d0
CALL MovingAvg(CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneRetTempSeq,NumOfTimeStepInDay,NumTimeStepsInAvg,AvgData)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneRetTempSeq = AvgData
END DO
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
DO TimeStepIndex = 1,NumOfTimeStepInDay
IF ( CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatLoadSeq(TimeStepIndex) > &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatLoad ) THEN
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatLoad = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatLoadSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatMassFlow = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatFlowSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneTempAtHeatPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneTempSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%OutTempAtHeatPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatOutTempSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneRetTempAtHeatPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneRetTempSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatTstatTemp = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatTstatTempSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneHumRatAtHeatPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneHumRatSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%OutHumRatAtHeatPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatOutHumRatSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%TimeStepNumAtHeatMax = TimeStepIndex
END IF
END DO
IF (CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatMassFlow > 0.0d0) THEN
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatVolFlow = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatMassFlow &
/ CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatDens
OAFrac = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%MinOA &
/ MAX(CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatVolFlow,SmallMassFlow)
OAFrac = MIN(1.0d0,MAX(0.0d0,OAFrac))
TimeStepAtPeak = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%TimeStepNumAtHeatMax
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatCoilInTemp = &
OAFrac*DesDayWeath(CurOverallSimDay)%Temp(TimeStepAtPeak) + &
(1.d0-OAFrac)*CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneTempAtHeatPeak
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatCoilInHumRat = &
OAFrac*DesDayWeath(CurOverallSimDay)%HumRat(TimeStepAtPeak) + &
(1.d0-OAFrac)*CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneHumRatAtHeatPeak
END IF
DO TimeStepIndex = 1,NumOfTimeStepInDay
IF ( CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolLoadSeq(TimeStepIndex) > &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolLoad ) THEN
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolLoad = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolLoadSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolMassFlow = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolFlowSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneTempAtCoolPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneTempSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%OutTempAtCoolPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolOutTempSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneRetTempAtCoolPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneRetTempSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolTstatTemp = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolTstatTempSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneHumRatAtCoolPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneHumRatSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%OutHumRatAtCoolPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolOutHumRatSeq(TimeStepIndex)
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%TimeStepNumAtCoolMax = TimeStepIndex
END IF
END DO
IF (CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolMassFlow > 0.0d0) THEN
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolVolFlow = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolMassFlow &
/ CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolDens
OAFrac = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%MinOA &
/ MAX(CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolVolFlow,SmallMassFlow)
OAFrac = MIN(1.0d0,MAX(0.0d0,OAFrac))
TimeStepAtPeak = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%TimeStepNumAtCoolMax
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolCoilInTemp = &
OAFrac*DesDayWeath(CurOverallSimDay)%Temp(TimeStepAtPeak) + &
(1.d0-OAFrac)*CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneTempAtCoolPeak
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolCoilInHumRat = &
OAFrac*DesDayWeath(CurOverallSimDay)%HumRat(TimeStepAtPeak) + &
(1.d0-OAFrac)*CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneHumRatAtCoolPeak
END IF
IF (CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatVolFlow > CalcFinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow) THEN
CalcFinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatVolFlow
CalcFinalZoneSizing(CtrlZoneNum)%DesHeatLoad = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatLoad
CalcFinalZoneSizing(CtrlZoneNum)%DesHeatMassFlow = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatMassFlow
CalcFinalZoneSizing(CtrlZoneNum)%HeatDesDay = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatDesDay
CalcFinalZoneSizing(CtrlZoneNum)%DesHeatDens = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatDens
CalcFinalZoneSizing(CtrlZoneNum)%HeatFlowSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatFlowSeq
CalcFinalZoneSizing(CtrlZoneNum)%HeatLoadSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatLoadSeq
CalcFinalZoneSizing(CtrlZoneNum)%HeatZoneTempSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneTempSeq
CalcFinalZoneSizing(CtrlZoneNum)%HeatOutTempSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatOutTempSeq
CalcFinalZoneSizing(CtrlZoneNum)%HeatZoneRetTempSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneRetTempSeq
CalcFinalZoneSizing(CtrlZoneNum)%HeatTstatTempSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatTstatTempSeq
CalcFinalZoneSizing(CtrlZoneNum)%HeatTstatTemp = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatTstatTemp
CalcFinalZoneSizing(CtrlZoneNum)%HeatZoneHumRatSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatZoneHumRatSeq
CalcFinalZoneSizing(CtrlZoneNum)%HeatOutHumRatSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatOutHumRatSeq
CalcFinalZoneSizing(CtrlZoneNum)%ZoneTempAtHeatPeak = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneTempAtHeatPeak
CalcFinalZoneSizing(CtrlZoneNum)%OutTempAtHeatPeak = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%OutTempAtHeatPeak
CalcFinalZoneSizing(CtrlZoneNum)%ZoneRetTempAtHeatPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneRetTempAtHeatPeak
CalcFinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtHeatPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneHumRatAtHeatPeak
CalcFinalZoneSizing(CtrlZoneNum)%OutHumRatAtHeatPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%OutHumRatAtHeatPeak
CalcFinalZoneSizing(CtrlZoneNum)%HeatDDNum = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%HeatDDNum
CalcFinalZoneSizing(CtrlZoneNum)%cHeatDDDate = DesDayWeath(CurOverallSimDay)%DateString
CalcFinalZoneSizing(CtrlZoneNum)%TimeStepNumAtHeatMax = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%TimeStepNumAtHeatMax
CalcFinalZoneSizing(CtrlZoneNum)%DesHeatCoilInTemp = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatCoilInTemp
CalcFinalZoneSizing(CtrlZoneNum)%DesHeatCoilInHumRat = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesHeatCoilInHumRat
ELSE
CalcFinalZoneSizing(CtrlZoneNum)%DesHeatDens = StdRhoAir
END IF
IF (CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolVolFlow > CalcFinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow) THEN
CalcFinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolVolFlow
CalcFinalZoneSizing(CtrlZoneNum)%DesCoolLoad = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolLoad
CalcFinalZoneSizing(CtrlZoneNum)%DesCoolMassFlow = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolMassFlow
CalcFinalZoneSizing(CtrlZoneNum)%CoolDesDay = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolDesDay
CalcFinalZoneSizing(CtrlZoneNum)%DesCoolDens = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolDens
CalcFinalZoneSizing(CtrlZoneNum)%CoolFlowSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolFlowSeq
CalcFinalZoneSizing(CtrlZoneNum)%CoolLoadSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolLoadSeq
CalcFinalZoneSizing(CtrlZoneNum)%CoolZoneTempSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneTempSeq
CalcFinalZoneSizing(CtrlZoneNum)%CoolOutTempSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolOutTempSeq
CalcFinalZoneSizing(CtrlZoneNum)%CoolZoneRetTempSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneRetTempSeq
CalcFinalZoneSizing(CtrlZoneNum)%CoolTstatTempSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolTstatTempSeq
CalcFinalZoneSizing(CtrlZoneNum)%CoolTstatTemp = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolTstatTemp
CalcFinalZoneSizing(CtrlZoneNum)%CoolZoneHumRatSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolZoneHumRatSeq
CalcFinalZoneSizing(CtrlZoneNum)%CoolOutHumRatSeq = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolOutHumRatSeq
CalcFinalZoneSizing(CtrlZoneNum)%ZoneTempAtCoolPeak = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneTempAtCoolPeak
CalcFinalZoneSizing(CtrlZoneNum)%OutTempAtCoolPeak = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%OutTempAtCoolPeak
CalcFinalZoneSizing(CtrlZoneNum)%ZoneRetTempAtCoolPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneRetTempAtCoolPeak
CalcFinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtCoolPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%ZoneHumRatAtCoolPeak
CalcFinalZoneSizing(CtrlZoneNum)%OutHumRatAtCoolPeak = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%OutHumRatAtCoolPeak
CalcFinalZoneSizing(CtrlZoneNum)%CoolDDNum = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%CoolDDNum
CalcFinalZoneSizing(CtrlZoneNum)%cCoolDDDate = DesDayWeath(CurOverallSimDay)%DateString
CalcFinalZoneSizing(CtrlZoneNum)%TimeStepNumAtCoolMax = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%TimeStepNumAtCoolMax
CalcFinalZoneSizing(CtrlZoneNum)%DesCoolCoilInTemp = CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolCoilInTemp
CalcFinalZoneSizing(CtrlZoneNum)%DesCoolCoilInHumRat = &
CalcZoneSizing(CtrlZoneNum,CurOverallSimDay)%DesCoolCoilInHumRat
ELSE
CalcFinalZoneSizing(CtrlZoneNum)%DesCoolDens = StdRhoAir
END IF
END DO
CASE (EndZoneSizingCalc)
! candidate EMS calling point to customize CalcFinalZoneSizing
Call ManageEMS(emsCallFromZoneSizing)
! now apply EMS overrides (if any)
IF (AnyEnergyManagementSystemInModel) THEN
DO CtrlZoneNum = 1,NumOfZones
IF (CalcFinalZoneSizing(CtrlZoneNum)%EMSOverrideDesHeatMassOn ) THEN
IF (CalcFinalZoneSizing(CtrlZoneNum)%DesHeatMassFlow > 0.0D0) &
CalcFinalZoneSizing(CtrlZoneNum)%DesHeatMassFlow = CalcFinalZoneSizing(CtrlZoneNum)%EMSValueDesHeatMassFlow
ENDIF
IF (CalcFinalZoneSizing(CtrlZoneNum)%EMSOverrideDesCoolMassOn) THEN
IF (CalcFinalZoneSizing(CtrlZoneNum)%DesCoolMassFlow > 0.0D0) &
CalcFinalZoneSizing(CtrlZoneNum)%DesCoolMassFlow = CalcFinalZoneSizing(CtrlZoneNum)%EMSValueDesCoolMassFlow
ENDIF
IF (CalcFinalZoneSizing(CtrlZoneNum)%EMSOverrideDesHeatLoadOn) THEN
IF (CalcFinalZoneSizing(CtrlZoneNum)%DesHeatLoad > 0.0D0) &
CalcFinalZoneSizing(CtrlZoneNum)%DesHeatLoad = CalcFinalZoneSizing(CtrlZoneNum)%EMSValueDesHeatLoad
ENDIF
IF (CalcFinalZoneSizing(CtrlZoneNum)%EMSOverrideDesCoolLoadOn) THEN
IF (CalcFinalZoneSizing(CtrlZoneNum)%DesCoolLoad > 0.0D0) &
CalcFinalZoneSizing(CtrlZoneNum)%DesCoolLoad = CalcFinalZoneSizing(CtrlZoneNum)%EMSValueDesCoolLoad
ENDIF
IF (CalcFinalZoneSizing(CtrlZoneNum)%EMSOverrideDesHeatVolOn) THEN
IF (CalcFinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow > 0.0D0) &
CalcFinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow = CalcFinalZoneSizing(CtrlZoneNum)%EMSValueDesHeatVolFlow
ENDIF
IF (CalcFinalZoneSizing(CtrlZoneNum)%EMSOverrideDesCoolVolOn) THEN
IF (CalcFinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow > 0.0D0) &
CalcFinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow = CalcFinalZoneSizing(CtrlZoneNum)%EMSValueDesCoolVolFlow
ENDIF
ENDDO
ENDIF
IF (.NOT. isPulseZoneSizing) THEN
DO CtrlZoneNum=1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
IF (ABS(CalcFinalZoneSizing(CtrlZoneNum)%DesCoolLoad) <= 1.d-8) THEN
CALL ShowWarningError('Calculated design cooling load for zone='// &
TRIM(CalcFinalZoneSizing(CtrlZoneNum)%ZoneName)//' is zero.')
CALL ShowContinueError('Check Sizing:Zone and ZoneControl:Thermostat inputs.')
ENDIF
IF (ABS(CalcFinalZoneSizing(CtrlZoneNum)%DesHeatLoad) <= 1.d-8) THEN
CALL ShowWarningError('Calculated design heating load for zone='// &
TRIM(CalcFinalZoneSizing(CtrlZoneNum)%ZoneName)//' is zero.')
CALL ShowContinueError('Check Sizing:Zone and ZoneControl:Thermostat inputs.')
ENDIF
ENDDO
WRITE(OutputFileZoneSizing,ZSizeFmt10,ADVANCE='No')
DO I=1,NumOfZones
IF (.not. ZoneEquipConfig(I)%IsControlled) CYCLE
WRITE(OutputFileZoneSizing,ZSizeFmt11,ADVANCE='No') &
SizingFileColSep,TRIM(CalcFinalZoneSizing(I)%ZoneName), &
TRIM(CalcFinalZoneSizing(I)%HeatDesDay),':Des Heat Load [W]', &
SizingFileColSep,TRIM(CalcFinalZoneSizing(I)%ZoneName), &
TRIM(CalcFinalZoneSizing(I)%CoolDesDay),':Des Sens Cool Load [W]', &
SizingFileColSep,TRIM(CalcFinalZoneSizing(I)%ZoneName), &
TRIM(CalcFinalZoneSizing(I)%HeatDesDay),':Des Heat Mass Flow [kg/s]', &
SizingFileColSep,TRIM(CalcFinalZoneSizing(I)%ZoneName), &
TRIM(CalcFinalZoneSizing(I)%CoolDesDay),':Des Cool Mass Flow [kg/s]'
! Should this be done only if there is a cooling load? Or would this message help dermine why there was no load?
IF (ABS(CalcFinalZoneSizing(I)%DesCoolLoad) > 1.d-8) THEN
! check for low cooling delta T from supply to zone to see if air volume flow rate might be excessively high
IF (CalcFinalZoneSizing(I)%ZnCoolDgnSAMethod == SupplyAirTemperature) THEN
SupplyTemp = CalcFinalZoneSizing(I)%CoolDesTemp
DeltaTemp = SupplyTemp - CalcFinalZoneSizing(I)%ZoneTempatCoolPeak
ELSE
DeltaTemp = -ABS(CalcFinalZoneSizing(I)%CoolDesTempDiff)
SupplyTemp = DeltaTemp + CalcFinalZoneSizing(I)%ZoneTempatCoolPeak
END IF
! check for low delta T to avoid very high flow rates
IF(ABS(DeltaTemp) .LT. 5.0d0 .AND. ABS(DeltaTemp) > SmallTempDiff)THEN ! Vdot exceeds 1200 cfm/ton @ DT=5
IF(ABS(DeltaTemp) .GE. 2.0d0)THEN ! Vdot exceeds 3000 cfm/ton @ DT=2
CALL ShowWarningError('UpdateZoneSizing: Cooling supply air temperature (calculated) within 5C of'// &
' zone temperature')
ELSE
CALL ShowSevereError('UpdateZoneSizing: Cooling supply air temperature (calculated) within 2C of'// &
' zone temperature')
END IF
CALL ShowContinueError('...check zone thermostat set point and design supply air temperatures')
CALL ShowContinueError('...zone name = '//TRIM(CalcFinalZoneSizing(I)%ZoneName))
CALL ShowContinueError('...design sensible cooling load = '// &
TRIM(RoundSigDigits(CalcFinalZoneSizing(I)%DesCoolLoad,2))//' W')
CALL ShowContinueError('...thermostat set point temp = '// &
TRIM(RoundSigDigits(CalcFinalZoneSizing(I)%CoolTstatTemp,3))//' C')
CALL ShowContinueError('...zone temperature = '// &
TRIM(RoundSigDigits(CalcFinalZoneSizing(I)%ZoneTempatCoolPeak,3))//' C')
CALL ShowContinueError('...supply air temperature = '//TRIM(RoundSigDigits(SupplyTemp,3))//' C')
CALL ShowContinueError('...temperature difference = '//TRIM(RoundSigDigits(DeltaTemp,5))//' C')
CALL ShowContinueError('...calculated volume flow rate = '// &
TRIM(RoundSigDigits((CalcFinalZoneSizing(I)%DesCoolVolFlow),5))//' m3/s')
CALL ShowContinueError('...calculated mass flow rate = '// &
TRIM(RoundSigDigits((CalcFinalZoneSizing(I)%DesCoolMassFlow),5))//' kg/s')
IF(SupplyTemp .GT. CalcFinalZoneSizing(I)%ZoneTempatCoolPeak) &
CALL ShowContinueError('...Note: supply air temperature should be less than zone'// &
' temperature during cooling air flow calculations')
ELSE IF(ABS(DeltaTemp) > SmallTempDiff .AND. SupplyTemp .GT. CalcFinalZoneSizing(I)%ZoneTempatCoolPeak)THEN
CALL ShowSevereError('UpdateZoneSizing: Supply air temperature is greater than zone'// &
' temperature during cooling air flow calculations')
CALL ShowContinueError('...zone temperature = '// &
TRIM(RoundSigDigits(CalcFinalZoneSizing(I)%ZoneTempatCoolPeak,3))//' C')
CALL ShowContinueError('...supply air temperature = '//TRIM(RoundSigDigits(SupplyTemp,3))//' C')
CALL ShowContinueError('...occurs in zone = '//TRIM(CalcFinalZoneSizing(I)%ZoneName))
END IF
END IF
! Should this be done only if there is a heating load? Or would this message help dermine why there was no load?
IF (ABS(CalcFinalZoneSizing(I)%DesHeatLoad) > 1.d-8) THEN ! ABS() ?
! check for low cooling delta T from supply to zone to see if air volume flow rate might be excessively high
IF (CalcFinalZoneSizing(I)%ZnHeatDgnSAMethod == SupplyAirTemperature) THEN
SupplyTemp = CalcFinalZoneSizing(I)%HeatDesTemp
DeltaTemp = SupplyTemp - CalcFinalZoneSizing(I)%ZoneTempatHeatPeak
ELSE
DeltaTemp = CalcFinalZoneSizing(I)%HeatDesTempDiff
SupplyTemp = DeltaTemp + CalcFinalZoneSizing(I)%ZoneTempatHeatPeak
END IF
IF(ABS(DeltaTemp) .LT. 5.0d0 .AND. ABS(DeltaTemp) > SmallTempDiff)THEN ! Vdot exceeds 1200 cfm/ton @ DT=5
IF(ABS(DeltaTemp) .GE. 2.0d0)THEN ! Vdot exceeds 3000 cfm/ton @ DT=2
CALL ShowWarningError('UpdateZoneSizing: Heating supply air temperature (calculated) within 5C of'// &
' zone temperature')
ELSE
CALL ShowSevereError('UpdateZoneSizing: Heating supply air temperature (calculated) within 2C of'// &
' zone temperature')
END IF
CALL ShowContinueError('...check zone thermostat set point and design supply air temperatures')
CALL ShowContinueError('...zone name = '//TRIM(CalcFinalZoneSizing(I)%ZoneName))
CALL ShowContinueError('...design heating load = '// &
TRIM(RoundSigDigits(CalcFinalZoneSizing(I)%DesCoolLoad,2))//' W')
CALL ShowContinueError('...thermostat set piont temp = '// &
TRIM(RoundSigDigits(CalcFinalZoneSizing(I)%HeatTstatTemp,3))//' C')
CALL ShowContinueError('...zone temperature = '// &
TRIM(RoundSigDigits(CalcFinalZoneSizing(I)%ZoneTempatHeatPeak,3))//' C')
CALL ShowContinueError('...supply air temperature = '//TRIM(RoundSigDigits(SupplyTemp,3))//' C')
CALL ShowContinueError('...temperature difference = '//TRIM(RoundSigDigits(DeltaTemp,5))//' C')
CALL ShowContinueError('...calculated volume flow rate = '// &
TRIM(RoundSigDigits((CalcFinalZoneSizing(I)%DesHeatVolFlow),5))//' m3/s')
CALL ShowContinueError('...calculated mass flow rate = '// &
TRIM(RoundSigDigits((CalcFinalZoneSizing(I)%DesHeatMassFlow),5))//' kg/s')
IF(SupplyTemp .LT. CalcFinalZoneSizing(I)%ZoneTempatHeatPeak) &
CALL ShowContinueError('...Note: supply air temperature should be greater than zone'// &
' temperature during heating air flow calculations')
ELSE IF(ABS(DeltaTemp) > SmallTempDiff .AND. SupplyTemp .LT. CalcFinalZoneSizing(I)%ZoneTempatHeatPeak)THEN
CALL ShowSevereError('UpdateZoneSizing: Supply air temperature is less than zone'// &
' temperature during heating air flow calculations')
CALL ShowContinueError('...zone temperature = '// &
TRIM(RoundSigDigits(CalcFinalZoneSizing(I)%ZoneTempatHeatPeak,3))//' C')
CALL ShowContinueError('...supply air temperature = '//TRIM(RoundSigDigits(SupplyTemp,3))//' C')
CALL ShowContinueError('...occurs in zone = '// &
TRIM(CalcFinalZoneSizing(I)%ZoneName))
END IF
END IF
ENDDO
WRITE(OutputFileZoneSizing,fmta) ' '
! HourFrac = 0.0
Minutes=0
TimeStepIndex=0
DO HourCounter=1,24
DO TimeStepCounter=1,NumOfTimeStepInHour
TimeStepIndex=TimeStepIndex+1
Minutes=Minutes+MinutesPerTimeStep
IF (Minutes == 60) THEN
Minutes=0
HourPrint=HourCounter
ELSE
HourPrint=HourCounter-1
ENDIF
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
IF (TimeStepIndex == CalcFinalZoneSizing(CtrlZoneNum)%TimeStepNumAtHeatMax) THEN
WRITE(HrMinString,PeakHrMinFmt) HourPrint, Minutes
HeatPeakDateHrMin(CtrlZoneNum)=TRIM(CalcFinalZoneSizing(CtrlZoneNum)%cHeatDDDate)//' '//TRIM(HrMinString)
END IF
IF (TimeStepIndex == CalcFinalZoneSizing(CtrlZoneNum)%TimeStepNumAtCoolMax) THEN
WRITE(HrMinString,PeakHrMinFmt) HourPrint, Minutes
CoolPeakDateHrMin(CtrlZoneNum)=TRIM(CalcFinalZoneSizing(CtrlZoneNum)%cCoolDDDate)//' '//TRIM(HrMinString)
END IF
END DO
WRITE(OutputFileZoneSizing,ZSizeFmt20,ADVANCE='No') HourPrint,Minutes
DO I=1,NumOfZones
IF (.not. ZoneEquipConfig(I)%IsControlled) CYCLE
WRITE(OutputFileZoneSizing,ZSizeFmt21,ADVANCE='No') &
SizingFileColSep,CalcFinalZoneSizing(I)%HeatLoadSeq(TimeStepIndex), &
SizingFileColSep,CalcFinalZoneSizing(I)%CoolLoadSeq(TimeStepIndex), &
SizingFileColSep,CalcFinalZoneSizing(I)%HeatFlowSeq(TimeStepIndex), &
SizingFileColSep,CalcFinalZoneSizing(I)%CoolFlowSeq(TimeStepIndex)
END DO
WRITE(OutputFileZoneSizing,fmta) ' '
END DO
END DO
WRITE(OutputFileZoneSizing,ZSizeFmt30,ADVANCE='No')
DO I=1,NumOfZones
IF (.not. ZoneEquipConfig(I)%IsControlled) CYCLE
WRITE(OutputFileZoneSizing,ZSizeFmt31,ADVANCE='No') SizingFileColSep,CalcFinalZoneSizing(I)%DesHeatLoad, &
SizingFileColSep,CalcFinalZoneSizing(I)%DesCoolLoad, &
SizingFileColSep,CalcFinalZoneSizing(I)%DesHeatMassFlow, &
SizingFileColSep,CalcFinalZoneSizing(I)%DesCoolMassFlow
END DO
WRITE(OutputFileZoneSizing,fmta) ' '
WRITE(OutputFileZoneSizing,ZSizeFmt40,ADVANCE='No')
DO I=1,NumOfZones
IF (.not. ZoneEquipConfig(I)%IsControlled) CYCLE
WRITE(OutputFileZoneSizing,ZSizeFmt41,ADVANCE='No') SizingFileColSep,SizingFileColSep, &
SizingFileColSep,CalcFinalZoneSizing(I)%DesHeatVolFlow, &
SizingFileColSep,CalcFinalZoneSizing(I)%DesCoolVolFlow
END DO
WRITE(OutputFileZoneSizing,fmta) ' '
CLOSE (OutputFileZoneSizing)
END IF
! Move data from Calc arrays to user modified arrays
ZoneSizing%CoolDesDay = CalcZoneSizing%CoolDesDay
ZoneSizing%HeatDesDay = CalcZoneSizing%HeatDesDay
ZoneSizing%DesHeatDens = CalcZoneSizing%DesHeatDens
ZoneSizing%DesCoolDens = CalcZoneSizing%DesCoolDens
ZoneSizing%HeatDDNum = CalcZoneSizing%HeatDDNum
ZoneSizing%CoolDDNum = CalcZoneSizing%CoolDDNum
ZoneSizing%DesHeatLoad = CalcZoneSizing%DesHeatLoad
ZoneSizing%DesHeatMassFlow = CalcZoneSizing%DesHeatMassFlow
ZoneSizing%ZoneTempAtHeatPeak = CalcZoneSizing%ZoneTempAtHeatPeak
ZoneSizing%OutTempAtHeatPeak = CalcZoneSizing%OutTempAtHeatPeak
ZoneSizing%ZoneRetTempAtHeatPeak = CalcZoneSizing%ZoneRetTempAtHeatPeak
ZoneSizing%ZoneHumRatAtHeatPeak = CalcZoneSizing%ZoneHumRatAtHeatPeak
ZoneSizing%OutHumRatAtHeatPeak = CalcZoneSizing%OutHumRatAtHeatPeak
ZoneSizing%TimeStepNumAtHeatMax = CalcZoneSizing%TimeStepNumAtHeatMax
ZoneSizing%DesHeatVolFlow = CalcZoneSizing%DesHeatVolFlow
ZoneSizing%DesHeatCoilInTemp = CalcZoneSizing%DesHeatCoilInTemp
ZoneSizing%DesHeatCoilInHumRat = CalcZoneSizing%DesHeatCoilInHumRat
ZoneSizing%DesCoolLoad = CalcZoneSizing%DesCoolLoad
ZoneSizing%DesCoolMassFlow = CalcZoneSizing%DesCoolMassFlow
ZoneSizing%ZoneTempAtCoolPeak = CalcZoneSizing%ZoneTempAtCoolPeak
ZoneSizing%OutTempAtCoolPeak = CalcZoneSizing%OutTempAtCoolPeak
ZoneSizing%ZoneRetTempAtCoolPeak = CalcZoneSizing%ZoneRetTempAtCoolPeak
ZoneSizing%ZoneHumRatAtCoolPeak = CalcZoneSizing%ZoneHumRatAtCoolPeak
ZoneSizing%OutHumRatAtCoolPeak = CalcZoneSizing%OutHumRatAtCoolPeak
ZoneSizing%TimeStepNumAtCoolMax = CalcZoneSizing%TimeStepNumAtCoolMax
ZoneSizing%DesCoolVolFlow = CalcZoneSizing%DesCoolVolFlow
ZoneSizing%DesCoolCoilInTemp = CalcZoneSizing%DesCoolCoilInTemp
ZoneSizing%DesCoolCoilInHumRat = CalcZoneSizing%DesCoolCoilInHumRat
FinalZoneSizing%CoolDesDay = CalcFinalZoneSizing%CoolDesDay
FinalZoneSizing%HeatDesDay = CalcFinalZoneSizing%HeatDesDay
FinalZoneSizing%DesHeatDens = CalcFinalZoneSizing%DesHeatDens
FinalZoneSizing%DesCoolDens = CalcFinalZoneSizing%DesCoolDens
FinalZoneSizing%HeatDDNum = CalcFinalZoneSizing%HeatDDNum
FinalZoneSizing%CoolDDNum = CalcFinalZoneSizing%CoolDDNum
FinalZoneSizing%DesHeatLoad = CalcFinalZoneSizing%DesHeatLoad
FinalZoneSizing%DesHeatMassFlow = CalcFinalZoneSizing%DesHeatMassFlow
FinalZoneSizing%ZoneTempAtHeatPeak = CalcFinalZoneSizing%ZoneTempAtHeatPeak
FinalZoneSizing%OutTempAtHeatPeak = CalcFinalZoneSizing%OutTempAtHeatPeak
FinalZoneSizing%ZoneRetTempAtHeatPeak = CalcFinalZoneSizing%ZoneRetTempAtHeatPeak
FinalZoneSizing%ZoneHumRatAtHeatPeak = CalcFinalZoneSizing%ZoneHumRatAtHeatPeak
FinalZoneSizing%OutHumRatAtHeatPeak = CalcFinalZoneSizing%OutHumRatAtHeatPeak
FinalZoneSizing%TimeStepNumAtHeatMax = CalcFinalZoneSizing%TimeStepNumAtHeatMax
FinalZoneSizing%DesHeatVolFlow = CalcFinalZoneSizing%DesHeatVolFlow
FinalZoneSizing%DesHeatCoilInTemp = CalcFinalZoneSizing%DesHeatCoilInTemp
FinalZoneSizing%DesHeatCoilInHumRat = CalcFinalZoneSizing%DesHeatCoilInHumRat
FinalZoneSizing%DesCoolLoad = CalcFinalZoneSizing%DesCoolLoad
FinalZoneSizing%DesCoolMassFlow = CalcFinalZoneSizing%DesCoolMassFlow
FinalZoneSizing%ZoneTempAtCoolPeak = CalcFinalZoneSizing%ZoneTempAtCoolPeak
FinalZoneSizing%OutTempAtCoolPeak = CalcFinalZoneSizing%OutTempAtCoolPeak
FinalZoneSizing%ZoneRetTempAtCoolPeak = CalcFinalZoneSizing%ZoneRetTempAtCoolPeak
FinalZoneSizing%ZoneHumRatAtCoolPeak = CalcFinalZoneSizing%ZoneHumRatAtCoolPeak
FinalZoneSizing%OutHumRatAtCoolPeak = CalcFinalZoneSizing%OutHumRatAtCoolPeak
FinalZoneSizing%TimeStepNumAtCoolMax = CalcFinalZoneSizing%TimeStepNumAtCoolMax
FinalZoneSizing%DesCoolVolFlow = CalcFinalZoneSizing%DesCoolVolFlow
FinalZoneSizing%DesCoolCoilInTemp = CalcFinalZoneSizing%DesCoolCoilInTemp
FinalZoneSizing%DesCoolCoilInHumRat = CalcFinalZoneSizing%DesCoolCoilInHumRat
DO DesDayNum = 1,TotDesDays+TotRunDesPersDays
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
DO TimeStepIndex = 1,NumOfTimeStepInDay
ZoneSizing(CtrlZoneNum,DesDayNum)%HeatFlowSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%HeatFlowSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%HeatLoadSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%HeatLoadSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%CoolFlowSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%CoolFlowSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%CoolLoadSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%CoolLoadSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%HeatZoneTempSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%HeatZoneTempSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%HeatOutTempSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%HeatOutTempSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%HeatZoneRetTempSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%HeatZoneRetTempSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%HeatTstatTempSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%HeatTstatTempSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%HeatZoneHumRatSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%HeatZoneHumRatSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%HeatOutHumRatSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%HeatOutHumRatSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%CoolZoneTempSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%CoolZoneTempSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%CoolOutTempSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%CoolOutTempSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%CoolZoneRetTempSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%CoolZoneRetTempSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%CoolTstatTempSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%CoolTstatTempSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%CoolZoneHumRatSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%CoolZoneHumRatSeq(TimeStepIndex)
ZoneSizing(CtrlZoneNum,DesDayNum)%CoolOutHumRatSeq(TimeStepIndex) = &
CalcZoneSizing(CtrlZoneNum,DesDayNum)%CoolOutHumRatSeq(TimeStepIndex)
END DO
END DO
END DO
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
DO TimeStepIndex = 1,NumOfTimeStepInDay
FinalZoneSizing(CtrlZoneNum)%HeatFlowSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%HeatFlowSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%HeatLoadSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%HeatLoadSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%CoolFlowSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%CoolFlowSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%CoolLoadSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%CoolLoadSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%HeatZoneTempSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%HeatZoneTempSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%HeatOutTempSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%HeatOutTempSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%HeatZoneRetTempSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%HeatZoneRetTempSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%HeatTstatTempSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%HeatTstatTempSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%HeatZoneHumRatSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%HeatZoneHumRatSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%HeatOutHumRatSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%HeatOutHumRatSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%CoolZoneTempSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%CoolZoneTempSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%CoolOutTempSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%CoolOutTempSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%CoolZoneRetTempSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%CoolZoneRetTempSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%CoolTstatTempSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%CoolTstatTempSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%CoolZoneHumRatSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%CoolZoneHumRatSeq(TimeStepIndex)
FinalZoneSizing(CtrlZoneNum)%CoolOutHumRatSeq(TimeStepIndex) = &
CalcFinalZoneSizing(CtrlZoneNum)%CoolOutHumRatSeq(TimeStepIndex)
END DO
END DO
DO CtrlZoneNum = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
! Now take into account the user specified sizing factor and user specified cooling design air flow
! rate
TotCoolSizMult = 0.0d0
! Calculate a sizing factor from the user specified cooling design air flow rate
IF (FinalZoneSizing(CtrlZoneNum)%InpDesCoolAirFlow > 0.0d0 .AND. &
FinalZoneSizing(CtrlZoneNum)%CoolAirDesMethod == InpDesAirFlow .AND. &
FinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow > 0.0d0) THEN
TotCoolSizMult = (FinalZoneSizing(CtrlZoneNum)%InpDesCoolAirFlow / &
FinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow) * FinalZoneSizing(CtrlZoneNum)%CoolSizingFactor
! If no user specified cooling design air flow rate input, use the user specified szing factor
ELSE
TotCoolSizMult = FinalZoneSizing(CtrlZoneNum)%CoolSizingFactor
END IF
! If the cooling sizing multiplier is not 1, adjust the cooling design data
IF (ABS(TotCoolSizMult-1.0d0) > .00001d0) THEN
IF (FinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow > 0.0d0) THEN
TimeStepAtPeak = FinalZoneSizing(CtrlZoneNum)%TimeStepNumAtCoolMax
DDNum = FinalZoneSizing(CtrlZoneNum)%CoolDDNum
FinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow = CalcFinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow * TotCoolSizMult
FinalZoneSizing(CtrlZoneNum)%DesCoolMassFlow = CalcFinalZoneSizing(CtrlZoneNum)%DesCoolMassFlow &
* TotCoolSizMult
FinalZoneSizing(CtrlZoneNum)%DesCoolLoad = CalcFinalZoneSizing(CtrlZoneNum)%DesCoolLoad * TotCoolSizMult
FinalZoneSizing(CtrlZoneNum)%CoolFlowSeq = CalcFinalZoneSizing(CtrlZoneNum)%CoolFlowSeq * TotCoolSizMult
FinalZoneSizing(CtrlZoneNum)%CoolLoadSeq = CalcFinalZoneSizing(CtrlZoneNum)%CoolLoadSeq * TotCoolSizMult
OAFrac = FinalZoneSizing(CtrlZoneNum)%MinOA &
/ FinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow
OAFrac = MIN(1.0d0,MAX(0.0d0,OAFrac))
FinalZoneSizing(CtrlZoneNum)%DesCoolCoilInTemp = OAFrac*DesDayWeath(DDNum)%Temp(TimeStepAtPeak) + &
(1.0d0-OAFrac)*FinalZoneSizing(CtrlZoneNum)%ZoneTempAtCoolPeak
FinalZoneSizing(CtrlZoneNum)%DesCoolCoilInHumRat = &
OAFrac*DesDayWeath(DDNum)%HumRat(TimeStepAtPeak) + &
(1.0d0-OAFrac)*FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtCoolPeak
ELSE
FinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow = FinalZoneSizing(CtrlZoneNum)%InpDesCoolAirFlow
FinalZoneSizing(CtrlZoneNum)%DesCoolMassFlow = FinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow * &
FinalZoneSizing(CtrlZoneNum)%DesCoolDens
END IF
DO DDNum = 1,TotDesDays+TotRunDesPersDays
IF (ZoneSizing(CtrlZoneNum,DDNum)%DesCoolVolFlow > 0.0d0) THEN
TimeStepAtPeak = ZoneSizing(CtrlZoneNum,DDNum)%TimeStepNumAtCoolMax
ZoneSizing(CtrlZoneNum,DDNum)%DesCoolVolFlow = CalcZoneSizing(CtrlZoneNum,DDNum)%DesCoolVolFlow * &
TotCoolSizMult
ZoneSizing(CtrlZoneNum,DDNum)%DesCoolMassFlow = CalcZoneSizing(CtrlZoneNum,DDNum)%DesCoolMassFlow &
* TotCoolSizMult
ZoneSizing(CtrlZoneNum,DDNum)%DesCoolLoad = CalcZoneSizing(CtrlZoneNum,DDNum)%DesCoolLoad * TotCoolSizMult
ZoneSizing(CtrlZoneNum,DDNum)%CoolFlowSeq = CalcZoneSizing(CtrlZoneNum,DDNum)%CoolFlowSeq * TotCoolSizMult
ZoneSizing(CtrlZoneNum,DDNum)%CoolLoadSeq = CalcZoneSizing(CtrlZoneNum,DDNum)%CoolLoadSeq * TotCoolSizMult
OAFrac = ZoneSizing(CtrlZoneNum,DDNum)%MinOA &
/ ZoneSizing(CtrlZoneNum,DDNum)%DesCoolVolFlow
OAFrac = MIN(1.0d0,MAX(0.0d0,OAFrac))
ZoneSizing(CtrlZoneNum,DDNum)%DesCoolCoilInTemp = OAFrac*DesDayWeath(DDNum)%Temp(TimeStepAtPeak) + &
(1.0d0-OAFrac)*ZoneSizing(CtrlZoneNum,DDNum)%ZoneTempAtCoolPeak
ZoneSizing(CtrlZoneNum,DDNum)%DesCoolCoilInHumRat = &
OAFrac*DesDayWeath(DDNum)%HumRat(TimeStepAtPeak) + &
(1.0d0-OAFrac)*ZoneSizing(CtrlZoneNum,DDNum)%ZoneHumRatAtCoolPeak
ELSE
ZoneSizing(CtrlZoneNum,DDNum)%DesCoolVolFlow = ZoneSizing(CtrlZoneNum,DDNum)%InpDesCoolAirFlow
ZoneSizing(CtrlZoneNum,DDNum)%DesCoolMassFlow = ZoneSizing(CtrlZoneNum,DDNum)%DesCoolVolFlow * &
ZoneSizing(CtrlZoneNum,DDNum)%DesCoolDens
END IF
END DO
END IF
! Now make sure that the design cooling air flow rates are greater than or equal to the specified minimums
IF (FinalZoneSizing(CtrlZoneNum)%CoolAirDesMethod == DesAirFlowWithLim) THEN
MaxOfMinCoolVolFlow = MAX(FinalZoneSizing(CtrlZoneNum)%DesCoolMinAirFlow, &
FinalZoneSizing(CtrlZoneNum)%DesCoolMinAirFlow2, &
FinalZoneSizing(CtrlZoneNum)%MinOA)
ELSE
MaxOfMinCoolVolFlow = FinalZoneSizing(CtrlZoneNum)%MinOA
END IF
MaxOfMinCoolMassFlow = MaxOfMinCoolVolFlow * FinalZoneSizing(CtrlZoneNum)%DesCoolDens
IF (MaxOfMinCoolVolFlow > FinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow) THEN
FinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow = MaxOfMinCoolVolFlow
FinalZoneSizing(CtrlZoneNum)%DesCoolMassFlow = MaxOfMinCoolMassFlow
END IF
DO TimeStepIndex = 1,NumOfTimeStepInDay
IF (MaxOfMinCoolMassFlow > FinalZoneSizing(CtrlZoneNum)%CoolFlowSeq(TimeStepIndex)) THEN
FinalZoneSizing(CtrlZoneNum)%CoolFlowSeq(TimeStepIndex) = MaxOfMinCoolMassFlow
END IF
END DO
DO DDNum = 1,TotDesDays+TotRunDesPersDays
MaxOfMinCoolVolFlow = MAX(ZoneSizing(CtrlZoneNum,DDNum)%DesCoolMinAirFlow, &
ZoneSizing(CtrlZoneNum,DDNum)%DesCoolMinAirFlow, &
ZoneSizing(CtrlZoneNum,DDNum)%MinOA)
MaxOfMinCoolMassFlow = MaxOfMinCoolVolFlow * ZoneSizing(CtrlZoneNum,DDNum)%DesCoolDens
IF (MaxOfMinCoolVolFlow > ZoneSizing(CtrlZoneNum,DDNum)%DesCoolVolFlow) THEN
ZoneSizing(CtrlZoneNum,DDNum)%DesCoolVolFlow = MaxOfMinCoolVolFlow
ZoneSizing(CtrlZoneNum,DDNum)%DesCoolMassFlow = MaxOfMinCoolMassFlow
END IF
DO TimeStepIndex = 1,NumOfTimeStepInDay
IF (MaxOfMinCoolMassFlow > ZoneSizing(CtrlZoneNum,DDNum)%CoolFlowSeq(TimeStepIndex)) THEN
ZoneSizing(CtrlZoneNum,DDNum)%CoolFlowSeq(TimeStepIndex) = MaxOfMinCoolMassFlow
END IF
END DO
END DO
! IF cooling flow rate is 0, this data may be used to size a HP so initialize DDNum, TimeStepatPeak, and sizing data (end of IF)
! check for flow rate having been set (by MinOA or other min) but no timestep at max
! IF (FinalZoneSizing(CtrlZoneNum)%DesCoolMassFlow > 0.0d0 .AND. &
IF ((FinalZoneSizing(CtrlZoneNum)%TimeStepNumAtCoolMax == 0 .OR. &
FinalZoneSizing(CtrlZoneNum)%CoolDDNum == 0) ) THEN
DO DDNum = 1,TotDesDays+TotRunDesPersDays
ZoneSizing(CtrlZoneNum,DDNum)%TimeStepNumAtCoolMax = 1
TimeStepAtPeak = ZoneSizing(CtrlZoneNum,DDNum)%TimeStepNumAtCoolMax
DO TimeStepIndex = 1,NumOfTimeStepInDay
IF (DesDayWeath(DDNum)%Temp(TimeStepIndex) > DesDayWeath(DDNum)%Temp(TimeStepAtPeak)) THEN
TimeStepAtPeak = TimeStepIndex
END IF
END DO
ZoneSizing(CtrlZoneNum,DDNum)%TimeStepNumAtCoolMax = TimeStepAtPeak
END DO
FinalZoneSizing(CtrlZoneNum)%TimeStepNumAtCoolMax = 1
FinalZoneSizing(CtrlZoneNum)%CoolDDNum = 1
TimeStepAtPeakF = FinalZoneSizing(CtrlZoneNum)%TimeStepNumAtCoolMax
DDNumF = FinalZoneSizing(CtrlZoneNum)%CoolDDNum
DO DDNum = 1,TotDesDays+TotRunDesPersDays
TimeStepAtPeak = ZoneSizing(CtrlZoneNum,DDNum)%TimeStepNumAtCoolMax
IF (DesDayWeath(DDNum)%Temp(TimeStepAtPeak) > DesDayWeath(DDNumF)%Temp(TimeStepAtPeakF)) THEN
DDNumF = DDNum
TimeStepAtPeakF = TimeStepAtPeak
END IF
END DO
FinalZoneSizing(CtrlZoneNum)%TimeStepNumAtCoolMax = TimeStepAtPeakF
FinalZoneSizing(CtrlZoneNum)%CoolDDNum = DDNumF
FinalZoneSizing(CtrlZoneNum)%CoolDesDay = ZoneSizing(CtrlZoneNum,DDNumF)%CoolDesDay
! initialize sizing conditions if they have not been set (i.e., no corresponding load) to zone condition
IF(FinalZoneSizing(CtrlZoneNum)%ZoneTempAtCoolPeak == 0.d0)THEN
FinalZoneSizing(CtrlZoneNum)%ZoneTempAtCoolPeak = ZoneSizing(CtrlZoneNum,DDNumF)%DesCoolSetPtSeq(TimeStepAtPeakF)
FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtCoolPeak = ZoneSizing(CtrlZoneNum,DDNumF)%CoolZoneHumRatSeq(TimeStepAtPeakF)
IF(FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtCoolPeak .GT. 0.d0)THEN
FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtCoolPeak = &
MIN(FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtCoolPeak, &
PsyWFnTdpPb(FinalZoneSizing(CtrlZoneNum)%ZoneTempAtCoolPeak,StdBaroPress,'UpdateZoneSizing'))
ELSE
FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtCoolPeak = ZoneSizing(CtrlZoneNum,DDNumF)%CoolDesHumRat
END IF
FinalZoneSizing(CtrlZoneNum)%DesCoolCoilInTemp = FinalZoneSizing(CtrlZoneNum)%ZoneTempAtCoolPeak
FinalZoneSizing(CtrlZoneNum)%DesCoolCoilInHumRat = FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtCoolPeak
FinalZoneSizing(CtrlZoneNum)%ZoneRetTempAtCoolPeak = FinalZoneSizing(CtrlZoneNum)%ZoneTempAtCoolPeak
END IF
END IF
! Now take into account the user specified sizing factor or user specified heating design air flow
! rate (which overrides the sizing factor)
TotHeatSizMult = 0.0d0
! Calculate a sizing factor from the user specified heating design air flow rate
IF (FinalZoneSizing(CtrlZoneNum)%InpDesHeatAirFlow > 0.0d0 .AND. &
FinalZoneSizing(CtrlZoneNum)%HeatAirDesMethod == InpDesAirFlow .AND. &
FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow > 0.0d0) THEN
TotHeatSizMult = (FinalZoneSizing(CtrlZoneNum)%InpDesHeatAirFlow / &
FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow) * FinalZoneSizing(CtrlZoneNum)%HeatSizingFactor
! Calculate a sizing factor from the user specified max heating design air flow rates
ELSE IF ( FinalZoneSizing(CtrlZoneNum)%HeatAirDesMethod == DesAirFlowWithLim .AND. &
FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow > 0.0d0) THEN
MaxHeatVolFlow = MAX(FinalZoneSizing(CtrlZoneNum)%DesHeatMaxAirFlow, &
FinalZoneSizing(CtrlZoneNum)%DesHeatMaxAirFlow2, &
FinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow * &
FinalZoneSizing(CtrlZoneNum)%DesHeatMaxAirFlowFrac)
IF (MaxHeatVolFlow < FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow) THEN
TotHeatSizMult = (MaxHeatVolFlow / FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow) * &
FinalZoneSizing(CtrlZoneNum)%HeatSizingFactor
ELSE
TotHeatSizMult = FinalZoneSizing(CtrlZoneNum)%HeatSizingFactor
END IF
! If no user specified heating design air flow rate input, use the user specified sizing factor
ELSE
TotHeatSizMult = FinalZoneSizing(CtrlZoneNum)%HeatSizingFactor
END IF
IF (ABS(TotHeatSizMult-1.0d0) > .00001d0 ) THEN
IF (FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow > 0.0d0) THEN
TimeStepAtPeak = FinalZoneSizing(CtrlZoneNum)%TimeStepNumAtHeatMax
DDNum = FinalZoneSizing(CtrlZoneNum)%HeatDDNum
FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow = CalcFinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow * TotHeatSizMult
FinalZoneSizing(CtrlZoneNum)%DesHeatMassFlow = CalcFinalZoneSizing(CtrlZoneNum)%DesHeatMassFlow * TotHeatSizMult
FinalZoneSizing(CtrlZoneNum)%DesHeatLoad = CalcFinalZoneSizing(CtrlZoneNum)%DesHeatLoad * TotHeatSizMult
FinalZoneSizing(CtrlZoneNum)%HeatFlowSeq = CalcFinalZoneSizing(CtrlZoneNum)%HeatFlowSeq * TotHeatSizMult
FinalZoneSizing(CtrlZoneNum)%HeatLoadSeq = CalcFinalZoneSizing(CtrlZoneNum)%HeatLoadSeq * TotHeatSizMult
OAFrac = FinalZoneSizing(CtrlZoneNum)%MinOA &
/ FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow
OAFrac = MIN(1.0d0,MAX(0.0d0,OAFrac))
FinalZoneSizing(CtrlZoneNum)%DesHeatCoilInTemp = OAFrac*DesDayWeath(DDNum)%Temp(TimeStepAtPeak) + &
(1.d0-OAFrac)*FinalZoneSizing(CtrlZoneNum)%ZoneTempAtHeatPeak
FinalZoneSizing(CtrlZoneNum)%DesHeatCoilInHumRat = &
OAFrac*DesDayWeath(DDNum)%HumRat(TimeStepAtPeak) + &
(1.d0-OAFrac)*FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtHeatPeak
ELSE
FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow = FinalZoneSizing(CtrlZoneNum)%InpDesHeatAirFlow
FinalZoneSizing(CtrlZoneNum)%DesHeatMassFlow = FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow * &
FinalZoneSizing(CtrlZoneNum)%DesHeatDens
END IF
DO DDNum = 1,TotDesDays+TotRunDesPersDays
IF (ZoneSizing(CtrlZoneNum,DDNum)%DesHeatVolFlow > 0.0d0) THEN
TimeStepAtPeak = ZoneSizing(CtrlZoneNum,DDNum)%TimeStepNumAtHeatMax
ZoneSizing(CtrlZoneNum,DDNum)%DesHeatVolFlow = CalcZoneSizing(CtrlZoneNum,DDNum)%DesHeatVolFlow * &
TotHeatSizMult
ZoneSizing(CtrlZoneNum,DDNum)%DesHeatMassFlow = CalcZoneSizing(CtrlZoneNum,DDNum)%DesHeatMassFlow &
* TotHeatSizMult
ZoneSizing(CtrlZoneNum,DDNum)%DesHeatLoad = CalcZoneSizing(CtrlZoneNum,DDNum)%DesHeatLoad * TotHeatSizMult
ZoneSizing(CtrlZoneNum,DDNum)%HeatFlowSeq = CalcZoneSizing(CtrlZoneNum,DDNum)%HeatFlowSeq * TotHeatSizMult
ZoneSizing(CtrlZoneNum,DDNum)%HeatLoadSeq = CalcZoneSizing(CtrlZoneNum,DDNum)%HeatLoadSeq * TotHeatSizMult
OAFrac = ZoneSizing(CtrlZoneNum,DDNum)%MinOA &
/ ZoneSizing(CtrlZoneNum,DDNum)%DesHeatVolFlow
OAFrac = MIN(1.0d0,MAX(0.0d0,OAFrac))
ZoneSizing(CtrlZoneNum,DDNum)%DesHeatCoilInTemp = OAFrac*DesDayWeath(DDNum)%Temp(TimeStepAtPeak) + &
(1.d0-OAFrac)*ZoneSizing(CtrlZoneNum,DDNum)%ZoneTempAtHeatPeak
ZoneSizing(CtrlZoneNum,DDNum)%DesHeatCoilInHumRat = &
OAFrac*DesDayWeath(DDNum)%HumRat(TimeStepAtPeak) + &
(1.d0-OAFrac)*ZoneSizing(CtrlZoneNum,DDNum)%ZoneHumRatAtHeatPeak
ELSE
ZoneSizing(CtrlZoneNum,DDNum)%DesHeatVolFlow = ZoneSizing(CtrlZoneNum,DDNum)%InpDesHeatAirFlow
ZoneSizing(CtrlZoneNum,DDNum)%DesHeatMassFlow = ZoneSizing(CtrlZoneNum,DDNum)%DesHeatVolFlow * &
ZoneSizing(CtrlZoneNum,DDNum)%DesHeatDens
END IF
END DO
END IF
MinOAMass = FinalZoneSizing(CtrlZoneNum)%MinOA * FinalZoneSizing(CtrlZoneNum)%DesHeatDens
IF (FinalZoneSizing(CtrlZoneNum)%MinOA > FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow) THEN
FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow = FinalZoneSizing(CtrlZoneNum)%MinOA
FinalZoneSizing(CtrlZoneNum)%DesHeatMassFlow = MinOAMass
END IF
DO TimeStepIndex = 1,NumOfTimeStepInDay
IF (MinOAMass > FinalZoneSizing(CtrlZoneNum)%HeatFlowSeq(TimeStepIndex)) THEN
FinalZoneSizing(CtrlZoneNum)%HeatFlowSeq(TimeStepIndex) = MinOAMass
END IF
END DO
DO DDNum = 1,TotDesDays+TotRunDesPersDays
MinOAMass = ZoneSizing(CtrlZoneNum,DDNum)%MinOA * ZoneSizing(CtrlZoneNum,DDNum)%DesHeatDens
IF (ZoneSizing(CtrlZoneNum,DDNum)%MinOA > ZoneSizing(CtrlZoneNum,DDNum)%DesHeatVolFlow) THEN
ZoneSizing(CtrlZoneNum,DDNum)%DesHeatVolFlow = ZoneSizing(CtrlZoneNum,DDNum)%MinOA
ZoneSizing(CtrlZoneNum,DDNum)%DesHeatMassFlow = MinOAMass
END IF
DO TimeStepIndex = 1,NumOfTimeStepInDay
IF (MinOAMass > ZoneSizing(CtrlZoneNum,DDNum)%HeatFlowSeq(TimeStepIndex)) THEN
ZoneSizing(CtrlZoneNum,DDNum)%HeatFlowSeq(TimeStepIndex) = MinOAMass
END IF
END DO
END DO
! IF heating flow rate is 0, this data may be used to size a HP so initialize DDNum, TimeStepatPeak, and sizing data (end of IF)
! check for flow rate having been set (by MinOA or other min) but no timestep at max
! IF (FinalZoneSizing(CtrlZoneNum)%DesHeatMassFlow > 0.0d0 .AND. &
IF ((FinalZoneSizing(CtrlZoneNum)%TimeStepNumAtHeatMax == 0 .OR. &
FinalZoneSizing(CtrlZoneNum)%HeatDDNum == 0) ) THEN
DO DDNum = 1,TotDesDays+TotRunDesPersDays
ZoneSizing(CtrlZoneNum,DDNum)%TimeStepNumAtHeatMax = 1
TimeStepAtPeak = ZoneSizing(CtrlZoneNum,DDNum)%TimeStepNumAtHeatMax
DO TimeStepIndex = 1,NumOfTimeStepInDay
IF (DesDayWeath(DDNum)%Temp(TimeStepIndex) < DesDayWeath(DDNum)%Temp(TimeStepAtPeak)) THEN
TimeStepAtPeak = TimeStepIndex
END IF
END DO
ZoneSizing(CtrlZoneNum,DDNum)%TimeStepNumAtHeatMax = TimeStepAtPeak
END DO
FinalZoneSizing(CtrlZoneNum)%TimeStepNumAtHeatMax = 1
FinalZoneSizing(CtrlZoneNum)%HeatDDNum = 1
TimeStepAtPeakF = FinalZoneSizing(CtrlZoneNum)%TimeStepNumAtHeatMax
DDNumF = FinalZoneSizing(CtrlZoneNum)%HeatDDNum
DO DDNum = 1,TotDesDays+TotRunDesPersDays
TimeStepAtPeak = ZoneSizing(CtrlZoneNum,DDNum)%TimeStepNumAtHeatMax
IF (DesDayWeath(DDNum)%Temp(TimeStepAtPeak) < DesDayWeath(DDNumF)%Temp(TimeStepAtPeakF)) THEN
DDNumF = DDNum
TimeStepAtPeakF = TimeStepAtPeak
END IF
END DO
FinalZoneSizing(CtrlZoneNum)%TimeStepNumAtHeatMax = TimeStepAtPeakF
FinalZoneSizing(CtrlZoneNum)%HeatDDNum = DDNumF
FinalZoneSizing(CtrlZoneNum)%HeatDesDay = ZoneSizing(CtrlZoneNum,DDNumF)%HeatDesDay
! initialize sizing conditions if they have not been set (i.e., no corresponding load) to zone condition
IF(FinalZoneSizing(CtrlZoneNum)%ZoneTempAtHeatPeak == 0.d0)THEN
FinalZoneSizing(CtrlZoneNum)%ZoneTempAtHeatPeak = ZoneSizing(CtrlZoneNum,DDNumF)%DesHeatSetPtSeq(TimeStepAtPeakF)
FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtHeatPeak = ZoneSizing(CtrlZoneNum,DDNumF)%HeatZoneHumRatSeq(TimeStepAtPeakF)
IF(FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtHeatPeak .GT. 0.d0)THEN
FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtHeatPeak = &
MIN(FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtHeatPeak, &
PsyWFnTdpPb(FinalZoneSizing(CtrlZoneNum)%ZoneTempAtHeatPeak,StdBaroPress,'UpdateZoneSizing'))
ELSE
FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtHeatPeak = ZoneSizing(CtrlZoneNum,DDNumF)%HeatDesHumRat
END IF
FinalZoneSizing(CtrlZoneNum)%DesHeatCoilInTemp = FinalZoneSizing(CtrlZoneNum)%ZoneTempAtHeatPeak
FinalZoneSizing(CtrlZoneNum)%DesHeatCoilInHumRat = FinalZoneSizing(CtrlZoneNum)%ZoneHumRatAtHeatPeak
FinalZoneSizing(CtrlZoneNum)%ZoneRetTempAtHeatPeak = FinalZoneSizing(CtrlZoneNum)%ZoneTempAtHeatPeak
END IF
END IF
! set the zone minimum cooling supply air flow rate. This will be used for autosizing VAV terminal unit
! minimum flow rates
FinalZoneSizing(CtrlZoneNum)%DesCoolVolFlowMin = MAX(FinalZoneSizing(CtrlZoneNum)%DesCoolMinAirFlow, &
FinalZoneSizing(CtrlZoneNum)%DesCoolMinAirFlow2, &
FinalZoneSizing(CtrlZoneNum)%DesCoolVolFlow * &
FinalZoneSizing(CtrlZoneNum)%DesCoolMinAirFlowFrac)
! set the zone maximum heating supply air flow rate. This will be used for autosizing VAV terminal unit
! max heating flow rates
FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlowMax = MAX(FinalZoneSizing(CtrlZoneNum)%DesHeatMaxAirFlow, &
FinalZoneSizing(CtrlZoneNum)%DesHeatMaxAirFlow2, &
FinalZoneSizing(CtrlZoneNum)%DesHeatVolFlow * &
FinalZoneSizing(CtrlZoneNum)%DesHeatMaxAirFlowFrac)
! Determine the design cooling supply air temperature if the supply air temperature difference is specified by user.
IF (FinalZoneSizing(CtrlZoneNum)%ZnCoolDgnSAMethod == TemperatureDifference) THEN
FinalZoneSizing(CtrlZoneNum)%CoolDesTemp = FinalZoneSizing(CtrlZoneNum)%ZoneTempAtCoolPeak - &
ABS(FinalZoneSizing(CtrlZoneNum)%CoolDesTempDiff)
END IF
! Determine the design heating supply air temperature if the supply air temperature difference is specified by user.
IF (FinalZoneSizing(CtrlZoneNum)%ZnHeatDgnSAMethod == TemperatureDifference) THEN
FinalZoneSizing(CtrlZoneNum)%HeatDesTemp = FinalZoneSizing(CtrlZoneNum)%ZoneTempAtHeatPeak + &
ABS(FinalZoneSizing(CtrlZoneNum)%HeatDesTempDiff)
END IF
END DO
END SELECT
TermUnitFinalZoneSizing = FinalZoneSizing
RETURN
END SUBROUTINE UpdateZoneSizing