!LKL discrepancy with < 0?
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | FurnaceNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
integer, | intent(in) | :: | CompOp | |||
real(kind=r64), | intent(in) | :: | ZoneLoad | |||
real(kind=r64), | intent(in) | :: | MoistureLoad | |||
real(kind=r64), | intent(inout) | :: | HeatCoilLoad | |||
real(kind=r64), | intent(inout) | :: | ReheatCoilLoad | |||
real(kind=r64), | intent(inout) | :: | OnOffAirFlowRatio | |||
logical, | intent(inout) | :: | HXUnitOn |
SUBROUTINE CalcNewZoneHeatCoolFlowRates(FurnaceNum,FirstHVACIteration,CompOp,ZoneLoad,MoistureLoad,HeatCoilLoad,ReheatCoilLoad, &
OnOffAirFlowRatio, HXUnitOn)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Liesen
! DATE WRITTEN Feb 2001
! MODIFIED R. Raustad and D. Shirey, Feb/Mar/Sept/Oct/Dec 2001, Jan/Oct 2002
! RE-ENGINEERED R. Raustad, Feb. 2005 (added RegulaFalsi for iteration technique)
! PURPOSE OF THIS SUBROUTINE:
! This subroutine updates the coil outlet nodes.
! METHODOLOGY EMPLOYED:
! Determine the operating PLR to meet the zone sensible load. If a humidistat is specified, determine
! the operating PLR (greater of the sensible and latent PLR) to meet the zone SENSIBLE load
! (Multimode dehumidification control) or zone LATENT load (CoolReheat dehumidification control).
!
! For dehumidification control type COOLREHEAT, both a sensible and latent PLR may exist for a
! single time step (heating and dehumidificaiton can occur). For all other sytem types,
! only a single PLR is allowed for any given time step.
!
! Order of simulation depends on dehumidification control option as described below.
!
! Dehumidificaiton control options:
!
! Dehumidification Control NONE: Cooling performance is simulated first and then heating performance. If a HX
! assisted cooling coil is selected, the HX is always active.
!
! Dehumidification Control COOLREHEAT: Continuous Fan Operation:
! For cooling operation, the sensible and latent capacities are calculated to
! meet the thermostat setpoint. If a HX assisted cooling coil is selected,
! the HX is always active. If the latent load is not met by operating the
! system at the sensible PLR, a new PLR is calculated to meet the humidistat
! setpoint. The reheat coil load is then calculated to meet the HEATING
! setpoint temperature.
!
! Cycling Fan Operation:
! The heating part-load ratio is calculated first. Since the fan will be
! controlled at the higher of the heating or cooling PLR's, a ratio of the
! cooling to heating PLR is used to pass to the cooling coil (MAX=1). This allows
! the cooling coil to operate at the heating PLR when the heating PLR is
! higher than the cooling PLR. The sensible and latent capacities are then
! calculated to meet the thermostat setpoint.
! If a HX assisted cooling coil is selected, the HX is always active.
! If the latent load is not met by operating the system at the sensible PLR,
! a new PLR is calculated to meet the humidistat setpoint.
! The reheat coil load is then calculated to meet the HEATING setpoint temperature.
!
! Dehumidification Control MULTIMODE: For cooling operation, the sensible and latent capacities are calculated to
! meet the thermostat setpoint. If a HX assisted cooling coil is selected,
! the HX is off for this calculation. If the latent load is not met by operating
! the system at the sensible PLR, a new PLR is calculated with the HX operating
! and the target is the thermostat setpoint. Humidity is not controlled in this
! mode. No reheat coil is used in this configuration.
!
! Note: A supplemental heater augments the heating capacity for air-to-air heat pumps.
! A reheat coil is used for the HeatCool furnace/unitarysystem to offset the sensible cooling when the
! dehumidification control type is COOLREHEAT. Both the supplemental and reheat heating coil load is calculated
! in the Calc routines. The actual simulation of these coils is performed in the SimFurnace routine (i.e. the
! supplemental and reheat coil loads are passed as 0 to CalcFurnaceOutput).
! REFERENCES:
! na
! USE STATEMENTS:
USE HeatingCoils, ONLY: SimulateHeatingCoilComponents
USE DataHeatBalFanSys, ONLY: MAT
USE ScheduleManager
USE DataZoneEnergyDemands
USE General, ONLY: SolveRegulaFalsi, TrimSigDigits
USE DXCoils, ONLY: DXCoilPartLoadRatio
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, Intent(IN) :: FurnaceNum
LOGICAL, Intent(IN) :: FirstHVACIteration
INTEGER, Intent(IN) :: CompOp ! compressor operation flag (1=On, 0=Off)
REAL(r64), Intent(IN) :: ZoneLoad ! the control zone load (watts)
REAL(r64), Intent(IN) :: MoistureLoad ! the control zone latent load (watts)
REAL(r64), Intent(INOUT) :: HeatCoilLoad ! Heating load to be met by heating coil ( excluding heat pump DX coil)
REAL(r64), Intent(INOUT) :: ReheatCoilLoad ! Heating load to be met by reheat coil using hstat (excluding HP DX coil)
REAL(r64), Intent(INOUT) :: OnOffAirFlowRatio ! Ratio of compressor ON air flow to AVERAGE air flow over time step
LOGICAL, Intent(INOUT) :: HXUnitOn ! flag to control HX based on zone moisture load
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: MaxIter = 100 ! maximum number of iterations
REAL(r64), PARAMETER :: MinPLR = 0.0d0 ! minimum part load ratio allowed
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: SystemMoistureLoad ! Total latent load to be removed by furnace/unitary system
REAL(r64) :: cpair ! Heat capacity of air
REAL(r64) :: deltaT ! Temperature rise across heating coil (C)
REAL(r64) :: TempOutHeatingCoil ! Temperature leaving heating coil (C)
REAL(r64) :: FullSensibleOutput ! Full sensible output of AC (W)
REAL(r64) :: FullLatentOutput ! Full latent output of AC (W)
REAL(r64) :: NoCoolOutput ! Sensible output of AC with no cooling allowed (W)
REAL(r64) :: NoHeatOutput ! Sensible output of heater with no heating allowed (W)
REAL(r64) :: NoLatentOutput ! Latent output of AC with no cooling allowed (W)
INTEGER :: FurnaceInletNode ! Inlet node to furnace or unitary system
INTEGER :: FurnaceOutletNode ! Outlet node of furnace or unitary system
INTEGER :: OpMode ! Mode of Operation (fan cycling = 1 or fan continuous = 2)
REAL(r64), SAVE :: CoolCoilLoad ! Negative value means cooling required
REAL(r64), SAVE :: SystemSensibleLoad ! Positive value means heating required
REAL(r64) :: CoolErrorToler ! Error tolerance in cooling mode
REAL(r64) :: HeatErrorToler ! Error tolerance in heating mode
REAL(r64) :: ActualSensibleOutput ! Actual furnace sensible capacity
REAL(r64) :: ActualLatentOutput ! Actual furnace latent capacity
REAL(r64) :: PartLoadRatio ! Part load ratio (greater of sensible or latent part load ratio for cooling,
! or heating PLR)
REAL(r64) :: LatentPartLoadRatio ! Part load ratio to meet dehumidification load
REAL(r64) :: TempCoolOutput ! Temporary Sensible output of AC while iterating on PLR (W)
REAL(r64) :: TempHeatOutput ! Temporary Sensible output of heating coil while iterating on PLR (W)
REAL(r64) :: TempLatentOutput ! Temporary Latent output of AC at increasing PLR (W)
! ! (Temp variables are used to find min PLR for positive latent removal)
LOGICAL :: HumControl = .FALSE. ! Logical flag signaling when dehumidification is required
REAL(r64), DIMENSION(10) :: Par ! parameters passed to RegulaFalsi function
INTEGER :: SolFlag ! return flag from RegulaFalsi
REAL(r64) :: TempMinPLR ! Temporary min latent PLR when hum control is required and iter is exceeded
REAL(r64) :: TempMinPLR2 ! Temporary min latent PLR when cyc fan hum control is required and iter is exceeded
REAL(r64) :: TempMaxPLR ! Temporary max latent PLR when hum control is required and iter is exceeded
REAL(r64) :: QToHeatSetPt ! Load required to meet heating setpoint temp (>0 is a heating load)
REAL(r64) :: CoolingHeatingPLRRatio ! ratio of cooling to heating PLR (MAX=1). Used in heating mode.
REAL(r64) :: HeatingSensibleOutput
REAL(r64) :: HeatingLatentOutput
! Set local variables
FurnaceOutletNode = Furnace(FurnaceNum)%FurnaceOutletNodeNum
FurnaceInletNode = Furnace(FurnaceNum)%FurnaceInletNodeNum
OpMode = Furnace(FurnaceNum)%OpMode
! Furnace(FurnaceNum)%MdotFurnace = Furnace(FurnaceNum)%DesignMassFlowRate
HumControl = .FALSE.
!Calculate the Cp Air for all conditions
cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode)%HumRat,Node(FurnaceInletNode)%Temp)
NoHeatOutput = 0.0d0
SystemSensibleLoad = 0.0d0
ReHeatCoilLoad = 0.0d0
HeatCoilLoad = 0.0d0
ReheatCoilLoad = 0.0d0
PartLoadRatio = 0.0d0
IF(FirstHVACIteration) THEN
! Set selected values during first HVAC iteration
!Init for heating
IF(HeatingLoad)THEN
IF (Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_AirToAir .OR. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_WatertoAir .AND. &
Furnace(FurnaceNum)%WatertoAirHPType == WatertoAir_Simple))THEN
Furnace(FurnaceNum)%HeatPartLoadRatio = 1.0d0
HeatCoilLoad = 0.0d0
Furnace(FurnaceNum)%HeatingCoilSensDemand=0.0d0
Furnace(FurnaceNum)%CoolingCoilSensDemand=0.0d0
Furnace(FurnaceNum)%CoolingCoilLatentDemand=0.0d0
ELSE !for furnaces
Furnace(FurnaceNum)%HeatPartLoadRatio = 0.0d0
HeatCoilLoad = ZoneLoad
Node(FurnaceInletNode)%MassFlowRate = Furnace(FurnaceNum)%MdotFurnace
Furnace(FurnaceNum)%HeatingCoilSensDemand=0.0d0
Furnace(FurnaceNum)%CoolingCoilSensDemand=0.0d0
Furnace(FurnaceNum)%CoolingCoilLatentDemand=0.0d0
ENDIF
ReheatCoilLoad = 0.0d0
Furnace(FurnaceNum)%CoolPartLoadRatio = 0.0d0
!Init for cooling
ELSEIF(CoolingLoad)THEN
!air to air heat pumps
Furnace(FurnaceNum)%CoolPartLoadRatio = 1.0d0
Furnace(FurnaceNum)%HeatPartLoadRatio = 0.0d0
HeatCoilLoad = 0.0d0
ReheatCoilLoad = 0.0d0
!Init for moisture load only
ELSE
Furnace(FurnaceNum)%CoolPartLoadRatio = 0.0d0
Furnace(FurnaceNum)%HeatPartLoadRatio = 0.0d0
HeatCoilLoad = 0.0d0
ReheatCoilLoad = 0.0d0
Furnace(FurnaceNum)%HeatingCoilSensDemand=0.0d0
Furnace(FurnaceNum)%CoolingCoilSensDemand=0.0d0
Furnace(FurnaceNum)%CoolingCoilLatentDemand=0.0d0
ENDIF
CALL SetAverageAirFlow(FurnaceNum, &
MAX(Furnace(FurnaceNum)%HeatPartLoadRatio,Furnace(FurnaceNum)%CoolPartLoadRatio), &
OnOffAirFlowRatio)
! if dehumidification load exists (for heat pumps) turn on the supplmental heater
IF (HPDehumidificationLoadFlag) HumControl = .TRUE.
ELSE !not FirstHVACIteration
!Init for heating
IF(HeatingLoad)THEN
CoolCoilLoad = 0.0d0
IF (Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_AirToAir .OR. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_WatertoAir .AND. &
Furnace(FurnaceNum)%WatertoAirHPType == WatertoAir_Simple))THEN
SystemSensibleLoad = ZoneLoad
SystemMoistureLoad = 0.0d0
HeatCoilLoad = 0.0d0
Furnace(FurnaceNum)%HeatingCoilSensDemand=SystemSensibleLoad
Furnace(FurnaceNum)%CoolingCoilSensDemand=0.0d0
Furnace(FurnaceNum)%CoolingCoilLatentDemand=0.0d0
ELSE
SystemMoistureLoad = MoistureLoad
HeatCoilLoad = ZoneLoad
END IF
!Init for cooling
ELSEIF(CoolingLoad)THEN
CoolCoilLoad = ZoneLoad
SystemMoistureLoad = MoistureLoad
HeatCoilLoad = 0.0d0
Furnace(FurnaceNum)%CoolingCoilSensDemand=ABS(CoolCoilLoad)
Furnace(FurnaceNum)%CoolingCoilLatentDemand=ABS(SystemMoistureLoad)
Furnace(FurnaceNum)%HeatingCoilSensDemand=0.0d0
!Init for latent
ELSE
SystemMoistureLoad = MoistureLoad
CoolCoilLoad = 0.0d0
HeatCoilLoad = 0.0d0
!set report variables
Furnace(FurnaceNum)%CoolingCoilSensDemand=0.0d0
Furnace(FurnaceNum)%CoolingCoilLatentDemand=SystemMoistureLoad
Furnace(FurnaceNum)%HeatingCoilSensDemand=0.0d0
ENDIF
HeatingSensibleOutput = 0.0d0
HeatingLatentOutput = 0.0d0
ReheatCoilLoad = 0.0d0
Furnace(FurnaceNum)%CoolPartLoadRatio = 0.0d0
Furnace(FurnaceNum)%HeatPartLoadRatio = 0.0d0
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0
Furnace(FurnaceNum)%DehumidInducedHeatingDemandRate = 0.0d0
! When humidity control is used with cycling fan control and a heating load exists, if a moisture load
! also exists, the heating PLR must be available for the cooling coil calculations.
!*********** Heating Section ************
! If Furnace runs with a heating load then set HeatCoilLoad on Heating Coil and the Mass Flow
IF((GetCurrentScheduleValue(Furnace(FurnaceNum)%SchedPtr) .gt. 0.0d0) .and. &
! (Node(FurnaceInletNode)%MassFlowRate .gt. 0.0) .and. &
(HeatingLoad)) THEN
! Heat pumps only calculate a single PLR each time step (i.e. only cooling or heating allowed in a single time step)
IF (Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_AirToAir .OR. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_WaterToAir .AND. &
Furnace(FurnaceNum)%WatertoAirHPType == WatertoAir_Simple )) THEN
Node(FurnaceInletNode)%MassFlowRate=Furnace(FurnaceNum)%MdotFurnace
! Get no load result
IF (OpMode .EQ. CycFanCycCoil) THEN
Node(FurnaceInletNode)%MassFlowRate = 0.0d0
END IF
! Set the inlet mass flow rate based on user specified coil OFF flow rate
PartLoadRatio = 0.0d0
CALL SetAverageAirFlow(FurnaceNum, PartLoadRatio, OnOffAirFlowRatio)
!Set the input parameters for CalcFurnaceOutput
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0 !compressor off
Furnace(FurnaceNum)%WSHPRuntimeFrac = 0.0d0
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,0.0d0,minPLR,0.0d0,0.0d0,NoHeatOutput, NoLatentOutput, &
OnOffAirFlowRatio, .FALSE.)
PartLoadRatio = 1.0d0
Node(FurnaceInletNode)%MassFlowRate=Furnace(FurnaceNum)%MdotFurnace
Furnace(FurnaceNum)%CompPartLoadRatio = 1.0d0 !compressor ON
Furnace(FurnaceNum)%WSHPRuntimeFrac = 1.0d0
! Set fan part-load fraction equal to 1 while getting full load result
OnOffFanPartLoadFraction = 1.0d0
OnOffAirFlowRatio = 1.0d0
! Get full load result
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp, &
0.0d0,PartLoadRatio,0.0d0,0.0d0,FullSensibleOutput, FullLatentOutput, &
OnOffAirFlowRatio, .FALSE.)
! Check that SystemSensibleLoad is between FullSensibleOutput and NoHeatOutput
! If so then calculate PartLoadRatio for the DX Heating coil
IF(SystemSensibleLoad .LT. FullSensibleOutput .AND. SystemSensibleLoad .GT. NoHeatOutput)THEN
! check bounds on sensible output prior to iteration using RegulaFalsi
IF(FullSensibleOutput .LT. SystemSensibleLoad)THEN
PartLoadRatio = 1.0d0
ELSEIF(NoHeatOutput .GT. SystemSensibleLoad)THEN
PartLoadRatio = 0.0d0
ELSE
! Calculate the part load ratio through iteration
HeatErrorToler = Furnace(FurnaceNum)%HeatingConvergenceTolerance !Error tolerance for convergence from input deck
SolFlag = 0 ! # of iterations if positive, -1 means failed to converge, -2 means bounds are incorrect
Par(1) = REAL(FurnaceNum,r64)
Par(2) = 0.0d0 ! FLAG, if 1.0 then FirstHVACIteration equals TRUE, if 0.0 then FirstHVACIteration equals false
IF(FirstHVACIteration)Par(2)=1.0d0
Par(3) = REAL(OpMode,r64)
Par(4) = REAL(CompOp,r64)
Par(5) = SystemSensibleLoad
Par(6) = 0.0d0 ! FLAG, 0.0 if heating load, 1.0 if cooling or moisture load
Par(7) = 1.0d0 ! FLAG, 0.0 if latent load, 1.0 if sensible load to be met
Par(8) = OnOffAirFlowRatio ! Ratio of compressor ON mass flow rate to AVERAGE mass flow rate over time step
Par(9) = 0.0d0 ! HXUnitOn is always false for HX
Par(10) = 0.0d0
! HeatErrorToler is in fraction of load, MaxIter = 30, SolFalg = # of iterations or error as appropriate
CALL SolveRegulaFalsi(HeatErrorToler, MaxIter, SolFlag, PartLoadRatio, CalcFurnaceResidual, 0.0d0, 1.0d0, Par)
! OnOffAirFlowRatio is updated during the above iteration. Reset to correct value based on PLR.
OnOffAirFlowRatio = OnOffAirFlowRatioSave
IF (SolFlag == -1) THEN
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,0.0d0, &
PartLoadRatio,0.0d0,0.0d0, TempHeatOutput, TempLatentOutput, OnOffAirFlowRatio, .FALSE.)
IF(ABS(SystemSensibleLoad - TempHeatOutput) .GT. SmallLoad)THEN
IF(Furnace(FurnaceNum)%DXHeatingMaxIterIndex == 0)THEN
CALL ShowWarningMessage('Heating coil control failed to converge for ' &
//TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//':'//TRIM(Furnace(FurnaceNum)%Name))
CALL ShowContinueError(' Iteration limit exceeded in calculating DX heating coil sensible part-load ratio.')
CALL ShowContinueErrorTimeStamp('Sensible load to be met by DX heating coil = ' &
//TRIM(TrimSigDigits(SystemSensibleLoad,2))//' (watts), sensible output of DX heating coil = ' &
//TRIM(TrimSigDigits(TempHeatOutput,2))//' (watts), and the simulation continues.')
END IF
CALL ShowRecurringWarningErrorAtEnd(TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//' "'&
//TRIM(Furnace(FurnaceNum)%Name)//'" - Iteration limit exceeded in calculating'// &
' DX sensible heating part-load ratio error continues. Sensible load statistics:' &
,Furnace(FurnaceNum)%DXHeatingMaxIterIndex,SystemSensibleLoad,SystemSensibleLoad)
END IF
ELSE IF (SolFlag == -2) THEN
IF(Furnace(FurnaceNum)%DXHeatingRegulaFalsiFailedIndex == 0)THEN
CALL ShowWarningMessage('Heating coil control failed for ' &
//TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//':'//TRIM(Furnace(FurnaceNum)%Name))
CALL ShowContinueError(' DX sensible heating part-load ratio determined to be outside the range of 0-1.')
CALL ShowContinueErrorTimeStamp('Sensible load to be met by DX heating coil = ' &
//TRIM(TrimSigDigits(SystemSensibleLoad,2))//' (watts), and the simulation continues.')
END IF
CALL ShowRecurringWarningErrorAtEnd(TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//' "'&
//TRIM(Furnace(FurnaceNum)%Name)//'" - '// &
' DX sensible heating part-load ratio out of range error continues. Sensible load statistics:' &
,Furnace(FurnaceNum)%DXHeatingRegulaFalsiFailedIndex,SystemSensibleLoad,SystemSensibleLoad)
END IF
END IF
Furnace(FurnaceNum)%HeatPartLoadRatio = PartLoadRatio
! Check if Heat Pump compressor is allowed to run based on outdoor temperature
IF (Furnace(FurnaceNum)%CondenserNodeNum > 0) THEN
IF (Node(Furnace(FurnaceNum)%CondenserNodeNum)%Temp .GT. Furnace(FurnaceNum)%MinOATCompressor) THEN
Furnace(FurnaceNum)%CompPartLoadRatio = PartLoadRatio
ELSE
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0
END IF
ELSE
IF (OutDryBulbTemp .GT. Furnace(FurnaceNum)%MinOATCompressor) THEN
Furnace(FurnaceNum)%CompPartLoadRatio = PartLoadRatio
ELSE
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0
END IF
ENDIF
ELSEIF(SystemSensibleLoad .GT. FullSensibleOutput) THEN
! SystemSensibleLoad is greater than full DX Heating coil output so heat pump runs entire
! timestep and additional supplemental heating is required
Furnace(FurnaceNum)%HeatPartLoadRatio = 1.0d0
IF (Furnace(FurnaceNum)%CondenserNodeNum > 0) THEN
IF(Node(Furnace(FurnaceNum)%CondenserNodeNum)%Temp .GT. Furnace(FurnaceNum)%MinOATCompressor) THEN
! Check to see if Heat Pump compressor was allowed to run based on outdoor temperature
Furnace(FurnaceNum)%CompPartLoadRatio = 1.0d0
ELSE
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0
END IF
ELSE
IF(OutDryBulbTemp .GT. Furnace(FurnaceNum)%MinOATCompressor) THEN
! Check to see if Heat Pump compressor was allowed to run based on outdoor temperature
Furnace(FurnaceNum)%CompPartLoadRatio = 1.0d0
ELSE
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0
END IF
ENDIF
ELSEIF(SystemSensibleLoad .LT. NoHeatOutput) THEN
! SystemSensibleLoad is less than minimum DX Heating coil output so heat pump does not run and
! the load will be met by the supplemental heater
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0
Furnace(FurnaceNum)%HeatPartLoadRatio = 1.0d0
ENDIF
IF (Furnace(FurnaceNum)%HeatPartLoadRatio .EQ. 1.0d0 ) THEN
! Determine the load on the supplemental heating coil
IF((SystemSensibleLoad - FullSensibleOutput) .GT. Furnace(FurnaceNum)%DesignSuppHeatingCapacity) THEN
HeatCoilLoad = Furnace(FurnaceNum)%DesignSuppHeatingCapacity
TempOutHeatingCoil = Node(FurnaceOutletNode)%Temp + HeatCoilLoad/(cpair*Furnace(FurnaceNum)%MdotFurnace)
ELSEIF(SystemSensibleLoad .LT. NoHeatOutput) THEN
HeatCoilLoad = MAX(0.0d0,SystemSensibleLoad) !BG 10/22/2008 need a case for when its all suppl heat
TempOutHeatingCoil = Node(FurnaceInletNode)%Temp + HeatCoilLoad/(cpair*Furnace(FurnaceNum)%MdotFurnace)
ELSE
HeatCoilLoad = MAX(0.0d0,(SystemSensibleLoad - FullSensibleOutput))
TempOutHeatingCoil = Node(FurnaceOutletNode)%Temp + HeatCoilLoad/(cpair*Furnace(FurnaceNum)%MdotFurnace)
END IF
IF (Furnace(FurnaceNum)%CondenserNodeNum > 0) THEN
IF(Node(Furnace(FurnaceNum)%CondenserNodeNum)%Temp .GT. Furnace(FurnaceNum)%MaxOATSuppHeat) THEN
HeatCoilLoad = 0.0d0
IF(SystemSensibleLoad .LT. NoHeatOutput) THEN
TempOutHeatingCoil = Node(FurnaceInletNode)%Temp
ELSE
TempOutHeatingCoil = Node(FurnaceOutletNode)%Temp
ENDIF
ENDIF
ELSE
IF(OutDryBulbTemp .GT. Furnace(FurnaceNum)%MaxOATSuppHeat) THEN
HeatCoilLoad = 0.0d0
IF(SystemSensibleLoad .LT. NoHeatOutput) THEN
TempOutHeatingCoil = Node(FurnaceInletNode)%Temp
ELSE
TempOutHeatingCoil = Node(FurnaceOutletNode)%Temp
ENDIF
ENDIF
ENDIF
cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode)%HumRat,Node(FurnaceOutletNode)%Temp)
! TempOutHeatingCoil = Node(FurnaceOutletNode)%Temp + HeatCoilLoad/(cpair*Furnace(FurnaceNum)%MdotFurnace)
IF((TempOutHeatingCoil .GT. Furnace(FurnaceNum)%DesignMaxOutletTemp) .AND. (HeatCoilLoad > 0.0D0) ) THEN
! deltaT = Furnace(FurnaceNum)%DesignMaxOutletTemp - Node(FurnaceOutletNode)%Temp
!BG 10/22/2008 above made no sense if DX heat is off and its all supplemental,
! because Node(FurnaceOutletNode)%Temp will have been calc'd with full DX heat in last faux call to CalcFurnaceOutput
deltaT = (Furnace(FurnaceNum)%DesignMaxOutletTemp - TempOutHeatingCoil)
HeatCoilLoad = HeatCoilLoad - (Node(FurnaceInletNode)%MassFlowRate * cpair * deltaT)
HeatCoilLoad = MAX(0.0D0, HeatCoilLoad)
END IF
ELSE
HeatCoilLoad = 0.0d0
END IF
PartLoadRatio = 0.0d0
! HeatCool systems can have both a sensible and latent PLR in a single time step
! (i.e. both cooling and heating can occur in a single time step)
ELSE ! else not a heatpump DX coil
Node(FurnaceInletNode)%MassFlowRate = Furnace(FurnaceNum)%MdotFurnace
HeatCoilLoad = Furnace(FurnaceNum)%DesignHeatingCapacity
SystemSensibleLoad = ZoneLoad
! Get no load result
IF (OpMode .EQ. CycFanCycCoil) THEN
Node(FurnaceInletNode)%MassFlowRate = 0.0d0
END IF
IF (OpMode .EQ. ContFanCycCoil) THEN
OnOffFanPartLoadFraction = 1.0d0 ! The on/off fan will not cycle, so set part-load fraction = 1
END IF
! Set the inlet mass flow rate based on user specified coil OFF flow rate
PartLoadRatio = 0.0d0
CALL SetAverageAirFlow(FurnaceNum, PartLoadRatio, OnOffAirFlowRatio)
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,0.0d0,MinPLR,0.0d0,0.0d0,NoHeatOutput,NoLatentOutput, &
OnOffAirFlowRatio, .FALSE.)
IF(NoHeatOutput .LT. SystemSensibleLoad)THEN
Node(FurnaceInletNode)%MassFlowRate = Furnace(FurnaceNum)%MdotFurnace
! Set fan part-load fraction equal to 1 while getting full load result
OnOffFanPartLoadFraction = 1.0d0
OnOffAirFlowRatio = 1.0d0
! Get full load result
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,0.0d0,1.0d0,HeatCoilLoad,0.0d0, &
FullSensibleOutput,FullLatentOutput, OnOffAirFlowRatio, .FALSE.)
ELSE
FullSensibleOutput = NoHeatOutput + 0.000000001d0
END IF
! Since we are heating, we expect FullSensibleOutput to be > 0 and FullSensibleOutput > NoSensibleOutput
! Check that this is the case; if not set PartLoadRatio = 0.0 (off) and return
IF(FullSensibleOutput.GT.NoHeatOutput)THEN
! check bounds on sensible output prior to iteration using RegulaFalsi
IF(FullSensibleOutput .LE. SystemSensibleLoad)THEN
PartLoadRatio = 1.0d0
! save modified HeatCoilLoad in case it was reset because outlet temp > DesignMaxOutletTemp
IF(ModifiedHeatCoilLoad .GT. 0.0d0)THEN
HeatCoilLoad = ModifiedHeatCoilLoad
ELSE
HeatCoilLoad = Furnace(FurnaceNum)%DesignHeatingCapacity
END IF
ELSEIF(NoHeatOutput .GE. SystemSensibleLoad)THEN
PartLoadRatio = 0.0d0
HeatCoilLoad = 0.0d0
ELSE
! Calculate the part load ratio through iteration
HeatErrorToler = Furnace(FurnaceNum)%HeatingConvergenceTolerance !Error tolerance for convergence from input deck
SolFlag = 0 ! # of iterations if positive, -1 means failed to converge, -2 means bounds are incorrect
Par(1) = REAL(FurnaceNum,r64)
Par(2) = 0.0d0 ! FLAG, if 1.0 then FirstHVACIteration equals TRUE, if 0.0 then FirstHVACIteration equals false
IF(FirstHVACIteration)Par(2)=1.0d0
Par(3) = REAL(OpMode,r64)
Par(4) = REAL(CompOp,r64)
Par(5) = SystemSensibleLoad
Par(6) = 0.0d0 ! FLAG, 0.0 if heating load, 1.0 if cooling or moisture load
Par(7) = 1.0d0 ! FLAG, 0.0 if latent load, 1.0 if sensible load to be met
Par(8) = OnOffAirFlowRatio ! Ratio of compressor ON mass flow rate to AVERAGE mass flow rate over time step
Par(9) = 0.0d0 ! HXUnitOn is always false for HX
Par(10) = 0.0d0
! HeatErrorToler is in fraction load, MaxIter = 30, SolFalg = # of iterations or error as appropriate
CALL SolveRegulaFalsi(HeatErrorToler, MaxIter, SolFlag, PartLoadRatio, CalcFurnaceResidual, 0.0d0, 1.0d0, Par)
! OnOffAirFlowRatio is updated during the above iteration. Reset to correct value based on PLR.
OnOffAirFlowRatio = OnOffAirFlowRatioSave
! Reset HeatCoilLoad calculated in CalcFurnaceResidual (in case it was reset because output temp > DesignMaxOutletTemp)
IF(ModifiedHeatCoilLoad .GT. 0.0d0)THEN
HeatCoilLoad = ModifiedHeatCoilLoad
ELSE
HeatCoilLoad = Furnace(FurnaceNum)%DesignHeatingCapacity * PartLoadRatio
END IF
IF (SolFlag == -1) THEN
! RegulaFalsi may not find heating PLR when the maximum supply air temperature is exceeded.
! If iteration limit is exceeded, find tighter boundary of solution and repeat RegulaFalsi
TempMaxPLR = -0.1d0
TempHeatOutput = NoHeatOutput
DO WHILE((TempHeatOutput - SystemSensibleLoad) .LT. 0.0d0 .AND. TempMaxPLR .LT. 1.0d0)
! find upper limit of HeatingPLR
TempMaxPLR = TempMaxPLR + 0.1d0
HeatCoilLoad = Furnace(FurnaceNum)%DesignHeatingCapacity * TempMaxPLR
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp, &
0.0d0, TempMaxPLR, HeatCoilLoad,0.0d0, TempHeatOutput, TempLatentOutput, OnOffAirFlowRatio, .FALSE.)
END DO
TempMinPLR = TempMaxPLR
DO WHILE((TempHeatOutput - SystemSensibleLoad) .GT. 0.0d0 .AND. TempMinPLR .GT. 0.0d0)
! pull upper limit of HeatingPLR down to last valid limit (i.e. heat output still exceeds SystemSensibleLoad)
TempMaxPLR = TempMinPLR
! find minimum limit of HeatingPLR
TempMinPLR = TempMinPLR - 0.01d0
HeatCoilLoad = Furnace(FurnaceNum)%DesignHeatingCapacity * TempMinPLR
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp, &
0.0d0, TempMinPLR, HeatCoilLoad,0.0d0, TempHeatOutput, TempLatentOutput, OnOffAirFlowRatio, .FALSE.)
END DO
! Now solve again with tighter PLR limits
CALL SolveRegulaFalsi(HeatErrorToler,MaxIter,SolFlag,PartLoadRatio,CalcFurnaceResidual,TempMinPLR,TempMaxPLR,Par)
IF(ModifiedHeatCoilLoad .GT. 0.0d0)THEN
HeatCoilLoad = ModifiedHeatCoilLoad
ELSE
HeatCoilLoad = Furnace(FurnaceNum)%DesignHeatingCapacity * PartLoadRatio
END IF
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp, &
0.0d0, PartLoadRatio, HeatCoilLoad,0.0d0, TempHeatOutput, TempLatentOutput, OnOffAirFlowRatio, .FALSE.)
! After iterating with tighter boundaries, if still out of tolerance, show warning.
IF(SolFlag == -1 .AND. ABS(SystemSensibleLoad - TempHeatOutput) .GT. SmallLoad)THEN
IF(Furnace(FurnaceNum)%HeatingMaxIterIndex == 0)THEN
CALL ShowWarningMessage('Heating coil control failed to converge for ' &
//TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//':'//TRIM(Furnace(FurnaceNum)%Name))
CALL ShowContinueError(' Iteration limit exceeded in calculating heating coil sensible part-load ratio.')
CALL ShowContinueErrorTimeStamp('Sensible load to be met by heating coil = ' &
//TRIM(TrimSigDigits(SystemSensibleLoad,2))//' (watts), sensible output of heating coil = ' &
//TRIM(TrimSigDigits(TempHeatOutput,2))//' (watts), and the simulation continues.')
END IF
CALL ShowRecurringWarningErrorAtEnd(TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//' "'&
//TRIM(Furnace(FurnaceNum)%Name)//'" - Iteration limit exceeded in calculating'// &
' sensible heating part-load ratio error continues. Sensible load statistics:' &
,Furnace(FurnaceNum)%HeatingMaxIterIndex,SystemSensibleLoad,SystemSensibleLoad)
END IF
ELSE IF (SolFlag == -2) THEN
IF(Furnace(FurnaceNum)%HeatingRegulaFalsiFailedIndex == 0)THEN
CALL ShowWarningMessage('Heating coil control failed for ' &
//TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//':'//TRIM(Furnace(FurnaceNum)%Name))
CALL ShowContinueError(' Sensible heating part-load ratio determined to be outside the range of 0-1.')
CALL ShowContinueErrorTimeStamp('Sensible load to be met by heating coil = ' &
//TRIM(TrimSigDigits(SystemSensibleLoad,2))//' (watts), and the simulation continues.')
END IF
CALL ShowRecurringWarningErrorAtEnd(TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//' "'&
//TRIM(Furnace(FurnaceNum)%Name)//'" - '// &
' Sensible heating part-load ratio out of range error continues. Sensible load statistics:' &
,Furnace(FurnaceNum)%HeatingRegulaFalsiFailedIndex,SystemSensibleLoad,SystemSensibleLoad)
END IF
END IF
ELSE !ELSE from IF(FullSensibleOutput.GT.NoSensibleOutput)THEN above
! Set part load ratio to 1 and run heater at design heating capacity
PartLoadRatio = 1.0d0
HeatCoilLoad = Furnace(FurnaceNum)%DesignHeatingCapacity
END IF
END IF !End of IF HeatPump
END IF !End of IF for heating
! Non-heat pump systems do not set a heating PLR, set it here for use with the DX cooling coil calculations.
! Set this variable back to 0 for non-heat pump systems at the end of this routine.
Furnace(FurnaceNum)%HeatPartLoadRatio = MAX(PartLoadRatio,Furnace(FurnaceNum)%HeatPartLoadRatio)
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,0.0d0, &
Furnace(FurnaceNum)%HeatPartLoadRatio,HeatCoilLoad,0.0d0, &
HeatingSensibleOutput,HeatingLatentOutput, OnOffAirFlowRatio, .FALSE.)
IF (Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_AirToAir .OR. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_WaterToAir .AND. &
Furnace(FurnaceNum)%WatertoAirHPType == WatertoAir_Simple ) .AND. CoolingLoad) THEN
HeatingSensibleOutput = 0.0d0
HeatingLatentOutput = 0.0d0
ENDIF
!***********Cooling Section*****************
! Simulate if scheduled ON and cooling load or if a moisture load exists when using a humidistat
! Check of HeatingLatentOutput is used to reduce overshoot during simultaneous heating and cooling
! Setback flag is used to avoid continued RH control when Tstat is setback (RH should float down)
IF((GetCurrentScheduleValue(Furnace(FurnaceNum)%SchedPtr) .gt. 0.0d0 .and. CoolingLoad) .or. &
(Furnace(FurnaceNum)%Humidistat .AND. &
Furnace(FurnaceNum)%DehumidControlType_Num == DehumidControl_CoolReheat .and. &
(SystemMoistureLoad.lt.0.0d0 .OR. (SystemMoistureLoad .GE. 0.0d0 .AND. &
HeatingLatentOutput .GT. SystemMoistureLoad .AND. .NOT. Setback(Furnace(FurnaceNum)%ControlZoneNum))))) THEN
! For cooling operation, the first step is to set the HX operation flag in case a HX assisted coil is used.
! (if a HX assisted coil is not used, this flag is not used. It's only used in the CALL to SimHXAssistedCoolingCoil)
! Check the dehumidification control type:
! For dehumidification control options CoolReheat and None, the HX is always active (locked ON).
! For dehumidification control option Multimode, the system is operated first with the HX off.
! If the moisture load is not met, the HX will then be turned on and the system is re-simulated.
IF(Furnace(FurnaceNum)%DehumidControlType_Num .EQ. DehumidControl_CoolReheat .OR. &
Furnace(FurnaceNum)%DehumidControlType_Num .EQ. DehumidControl_None) THEN
HXUnitOn = .TRUE.
ELSE
HXUnitOn = .FALSE.
END IF
! The next step is to determine the system output at no load (PLR=0) and full load (PLR=1)
! Set the inlet mass flow rate based on user specified coil OFF flow rate
PartLoadRatio = 0.0d0
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0 !compressor off
Furnace(FurnaceNum)%WSHPRuntimeFrac = 0.0d0
! SetAverageAirFlow calculates the operating mass flow rate based on PLR and the user specified inputs
! for MaxCoolAirMassFlow and MaxNoCoolHeatAirMassFlow.
! Air flow rate is set according to max of cooling and heating PLR if heating and latent load exists.
IF(OpMode .EQ. CycFanCycCoil .AND. &
Furnace(FurnaceNum)%HeatPartLoadRatio .GT. 0.0d0 .AND. &
Furnace(FurnaceNum)%Humidistat .AND. &
Furnace(FurnaceNum)%DehumidControlType_Num == DehumidControl_CoolReheat .AND. &
(SystemMoistureLoad.lt.0.0d0 .OR. (SystemMoistureLoad .GE. 0.0d0 .AND. &
HeatingLatentOutput .GT. SystemMoistureLoad .AND. .NOT. Setback(Furnace(FurnaceNum)%ControlZoneNum)))) THEN
CoolingHeatingPLRRatio = MIN(1.0d0,PartLoadRatio/Furnace(FurnaceNum)%HeatPartLoadRatio)
CALL SetAverageAirFlow(FurnaceNum, MAX(PartLoadRatio,Furnace(FurnaceNum)%HeatPartLoadRatio), OnOffAirFlowRatio)
ELSE
CoolingHeatingPLRRatio = 1.0d0
CALL SetAverageAirFlow(FurnaceNum, PartLoadRatio, OnOffAirFlowRatio)
END IF
! Get no load result (coils simulated OFF)
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,MinPLR,PartLoadRatio,0.0d0,0.0d0, &
NoCoolOutput, NoLatentOutput, OnOffAirFlowRatio, HXUnitOn, CoolingHeatingPLRRatio)
! Don't calculate full load output if no load output can meet sensible load
IF(NoCoolOutput .GE. CoolCoilLoad .AND. (CoolCoilLoad .NE. 0.0d0 .OR. HPDehumidificationLoadFlag))THEN
! Set full mass flow rate for full load calculation
Node(FurnaceInletNode)%MassFlowRate = Furnace(FurnaceNum)%MdotFurnace
! Set fan part-load fraction equal to 1 while getting full load result
OnOffFanPartLoadFraction = 1.0d0
OnOffAirFlowRatio = 1.0d0
PartLoadRatio = 1.0d0
Furnace(FurnaceNum)%CompPartLoadRatio = 1.0d0 !compressor ON
Furnace(FurnaceNum)%WSHPRuntimeFrac = 1.0d0
! Get full load result (coils simulated full ON)
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,PartLoadRatio,0.0d0,0.0d0,0.0d0, &
FullSensibleOutput, FullLatentOutput, OnOffAirFlowRatio, HXUnitOn)
ELSE
FullSensibleOutput = NoCoolOutput - 0.00000001d0
END IF
! The next step is to compare the results of the full load and no load results
!
! 1) Since we are cooling, we expect FullSensibleOutput < NoCoolOutput
! Check that this is the case; if not set PartLoadRatio = 0.0 (off)
! 2) Verify that the load to be met is within the range of available output
! (i.e. between FullSensibleOutput and NoCoolOutput)
! 3) Set PLR if load is out of range or RegulaFalsi on PLR if system can meet the load
!
IF(FullSensibleOutput.LT.NoCoolOutput)THEN
IF(CoolCoilLoad .NE. 0.0d0 .OR. HPDehumidificationLoadFlag)THEN
! check bounds on sensible output prior to iteration using RegulaFalsi
! Negative value represents cooling load, IF FullSensibleOutput .GT. CoolCoilLoad, load is greater than capacity
IF(FullSensibleOutput .GE. CoolCoilLoad)THEN
PartLoadRatio = 1.0d0
! Likewise IF NoCoolOutput .LT. CoolCoilLoad, then load can be met using only the fan (constant fan mode only)
ELSEIF(NoCoolOutput .LE. CoolCoilLoad)THEN
PartLoadRatio = 0.0d0
! ELSE load is between NoCoolOutput and FullSensibleOuput, find PLR required to meet load
ELSE
! Calculate the sensible part load ratio through iteration
CoolErrorToler = Furnace(FurnaceNum)%CoolingConvergenceTolerance !Error tolerance for convergence from input deck
SolFlag = 0 ! # of iterations if positive, -1 means failed to converge, -2 means bounds are incorrect
Par(1) = REAL(FurnaceNum,r64)
Par(2) = 0.0d0 ! FLAG, if 1.0 then FirstHVACIteration equals TRUE, if 0.0 then FirstHVACIteration equals false
IF(FirstHVACIteration)Par(2)=1.0d0
Par(3) = REAL(OpMode,r64)
Par(4) = REAL(CompOp,r64)
Par(5) = CoolCoilLoad
Par(6) = 1.0d0 ! FLAG, 0.0 if heating load, 1.0 if cooling or moisture load
Par(7) = 1.0d0 ! FLAG, 0.0 if latent load, 1.0 if sensible load to be met
Par(8) = OnOffAirFlowRatio ! Ratio of compressor ON mass flow rate to AVERAGE mass flow rate over time step
IF(HXUnitOn)THEN
Par(9) = 1.0d0
ELSE
Par(9) = 0.0d0
END IF
! Par(10) is the heating coil PLR, set this value to 0 for sensible PLR calculations.
Par(10) = 0.0d0
! CoolErrorToler is in fraction of load, MaxIter = 30, SolFalg = # of iterations or error as appropriate
CALL SolveRegulaFalsi(CoolErrorToler, MaxIter, SolFlag, PartLoadRatio, CalcFurnaceResidual, 0.0d0, 1.0d0, Par)
! OnOffAirFlowRatio is updated during the above iteration. Reset to correct value based on PLR.
OnOffAirFlowRatio = OnOffAirFlowRatioSave
IF (SolFlag == -1) THEN
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,PartLoadRatio, &
0.0d0,0.0d0,0.0d0, TempCoolOutput, TempLatentOutput, OnOffAirFlowRatio, HXUnitOn)
IF(.NOT. WarmupFlag)THEN
IF(ABS(CoolCoilLoad - TempCoolOutput) .GT. SmallLoad)THEN
IF(Furnace(FurnaceNum)%SensibleMaxIterIndex == 0)THEN
CALL ShowWarningMessage('Cooling coil control failed to converge for ' &
//TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//':'//TRIM(Furnace(FurnaceNum)%Name))
CALL ShowContinueError(' Iteration limit exceeded in calculating DX cooling coil sensible part-load ratio.')
CALL ShowContinueErrorTimeStamp('Sensible load to be met by DX coil = ' &
//TRIM(TrimSigDigits(CoolCoilLoad,2))//' (watts), sensible output of DX coil = ' &
//TRIM(TrimSigDigits(TempCoolOutput,2))//' (watts), and the simulation continues.')
END IF
CALL ShowRecurringWarningErrorAtEnd(TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//' "'&
//TRIM(Furnace(FurnaceNum)%Name)//'" - Iteration limit exceeded in calculating'// &
' sensible cooling part-load ratio error continues. Sensible load statistics:' &
,Furnace(FurnaceNum)%SensibleMaxIterIndex,CoolCoilLoad,CoolCoilLoad)
END IF
END IF
ELSE IF (SolFlag == -2) THEN
IF(.NOT. WarmupFlag)THEN
IF(Furnace(FurnaceNum)%SensibleRegulaFalsiFailedIndex == 0)THEN
CALL ShowWarningMessage('Cooling coil control failed for ' &
//TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//':'//TRIM(Furnace(FurnaceNum)%Name))
CALL ShowContinueError(' Cooling sensible part-load ratio determined to be outside the range of 0-1.')
CALL ShowContinueErrorTimeStamp(' Cooling sensible load = '//TRIM(TrimSigDigits(CoolCoilLoad,2)))
END IF
CALL ShowRecurringWarningErrorAtEnd(TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//' "'&
//TRIM(Furnace(FurnaceNum)%Name)//'" - Cooling sensible part-load ratio out of range'// &
' error continues. Sensible cooling load statistics:' &
,Furnace(FurnaceNum)%SensibleRegulaFalsiFailedIndex,CoolCoilLoad,CoolCoilLoad)
END IF
END IF
END IF
ELSE
PartLoadRatio = 0.0d0
END IF ! EndIf for IF(CoolCoilLoad.NE.0.0)
! Calculate the delivered capacity from the PLR caculated above
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,PartLoadRatio,Furnace(FurnaceNum)%HeatPartLoadRatio, &
0.0d0,0.0d0, TempCoolOutput, TempLatentOutput, OnOffAirFlowRatio, HXUnitOn)
! Calculate the latent part load ratio through iteration
! Negative SystemMoistureLoad means dehumidification load is present
!
! IF this furnace uses MultiMode control AND there is a moisture load AND the moisture load met by the furnace in
! cooling only mode above is sufficient to meet the moisture demand OR there is no sensible load (PLR=0 from above)
! then set LatentPartLoadRatio to 0 (no additional dehumidification is required).
IF(Furnace(FurnaceNum)%DehumidControlType_Num == DehumidControl_Multimode .AND. ((SystemMoistureLoad .LT. 0.0d0 .AND. &
TempLatentOutput .LT. SystemMoistureLoad) .OR. PartLoadRatio .EQ. 0.0d0)) THEN
LatentPartLoadRatio = 0.0d0
! ELSE calculate a new PLR for valid dehumidification control types if a moisture load exists.
ELSE IF(Furnace(FurnaceNum)%DehumidControlType_Num /= DehumidControl_None .AND. &
(SystemMoistureLoad .LT. 0.0d0 .OR. (SystemMoistureLoad .GE. 0.0d0 .AND. TempLatentOutput .GT. SystemMoistureLoad &
.AND. .NOT. Setback(Furnace(FurnaceNum)%ControlZoneNum))))THEN
! IF the furnace uses dehumidification control MultiMode, turn on the HX and calculate the latent output with
! the HX ON to compare to the moisture load predicted by the humidistat.
IF(Furnace(FurnaceNum)%DehumidControlType_Num == DehumidControl_Multimode)THEN
HXUnitOn = .TRUE.
Node(FurnaceInletNode)%MassFlowRate = Furnace(FurnaceNum)%MdotFurnace
! Set fan part-load fraction equal to 1 while getting full load result
OnOffFanPartLoadFraction = 1.0d0
OnOffAirFlowRatio = 1.0d0
! Get full load result
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,1.0d0,0.0d0,0.0d0,0.0d0, TempCoolOutput, &
TempLatentOutput, OnOffAirFlowRatio, HXUnitOn)
END IF
! Set the global cooling to heating PLR ratio. CoolHeatPLRRat = MIN(1,CoolingPLR/HeatingPLR)
CoolHeatPLRRat = 1.0d0 ! means cooling dominated operation (applies to cycling fan mode)
IF(TempLatentOutput .GT. SystemMoistureLoad)THEN
! Set full mass flow rate for full load calculation
Node(FurnaceInletNode)%MassFlowRate = Furnace(FurnaceNum)%MdotFurnace
! Set fan part-load fraction equal to 1 while getting full load result
OnOffFanPartLoadFraction = 1.0d0
OnOffAirFlowRatio = 1.0d0
Furnace(FurnaceNum)%CompPartLoadRatio = 1.0d0 !compressor ON
Furnace(FurnaceNum)%WSHPRuntimeFrac = 1.0d0
! Get full load result (coils simulated full ON)
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,1.0d0,0.0d0,0.0d0,0.0d0, &
TempCoolOutput, TempLatentOutput, OnOffAirFlowRatio, HXUnitOn)
END IF
! check bounds on latent output prior to iteration using RegulaFalsi
IF(TempLatentOutput .GT. SystemMoistureLoad .OR. &
(Furnace(FurnaceNum)%DehumidControlType_Num == DehumidControl_Multimode .AND. TempCoolOutput.GT.CoolCoilLoad))THEN
LatentPartLoadRatio = 1.0d0
ELSEIF(NoLatentOutput .LT. SystemMoistureLoad .OR. HeatingLatentOutput .LT. SystemMoistureLoad)THEN
LatentPartLoadRatio = 0.0d0
ELSE
CoolErrorToler = Furnace(FurnaceNum)%CoolingConvergenceTolerance !Error tolerance for convergence
SolFlag = 0 ! # of iterations if positive, -1 means failed to converge, -2 means bounds are incorrect
Par(1) = REAL(FurnaceNum,r64)
Par(2) = 0.0d0 ! FLAG, if 1.0 then FirstHVACIteration equals TRUE, if 0.0 then FirstHVACIteration equals false
IF(FirstHVACIteration)Par(2)=1.0d0
Par(3) = REAL(OpMode,r64)
Par(4) = REAL(CompOp,r64)
! Multimode always controls to meet the SENSIBLE load (however, HXUnitOn is now TRUE)
IF(Furnace(FurnaceNum)%DehumidControlType_Num == DehumidControl_Multimode)THEN
Par(5) = CoolCoilLoad
ELSE
Par(5) = SystemMoistureLoad
END IF
Par(6) = 1.0d0 ! FLAG, 0.0 if heating load, 1.0 if cooling or moisture load
! Multimode always controls to meet the SENSIBLE load (however, HXUnitOn is now TRUE)
IF(Furnace(FurnaceNum)%DehumidControlType_Num == DehumidControl_Multimode)THEN
Par(7) = 1.0d0 ! FLAG, 0.0 if latent load, 1.0 if sensible load to be met
ELSE
Par(7) = 0.0d0
END IF
Par(8) = OnOffAirFlowRatio ! Ratio of compressor ON mass flow rate to AVERAGE mass flow rate over time step
IF(HXUnitOn)THEN
Par(9) = 1.0d0
ELSE
Par(9) = 0.0d0
END IF
! Par(10) used only with cycling fan.
! Par(10) is the heating coil PLR, set this value only if there is a heating load (heating PLR > 0)
! and the latent PLR is being calculated. Otherwise set Par(10) to 0.
IF(OpMode .EQ. CycFanCycCoil .AND. Furnace(FurnaceNum)%HeatPartLoadRatio .GT. 0.0d0 .AND. Par(7) .EQ. 0.0d0)THEN
Par(10) = Furnace(FurnaceNum)%HeatPartLoadRatio
ELSE
Par(10) = 0.0d0
END IF
! CoolErrorToler is in fraction of load, MaxIter = 30, SolFalg = # of iterations or error as appropriate
CALL SolveRegulaFalsi(CoolErrorToler, MaxIter, SolFlag, LatentPartLoadRatio, CalcFurnaceResidual, 0.0d0, 1.0d0, Par)
! OnOffAirFlowRatio is updated during the above iteration. Reset to correct value based on PLR.
OnOffAirFlowRatio = OnOffAirFlowRatioSave
IF (SolFlag == -1) THEN
! RegulaFalsi may not find latent PLR when the latent degradation model is used.
! If iteration limit is exceeded, find tighter boundary of solution and repeat RegulaFalsi
TempMaxPLR = -0.1d0
TempLatentOutput = NoLatentOutput
DO WHILE((TempLatentOutput - SystemMoistureLoad) .GT. 0.0d0 .AND. TempMaxPLR .LT. 1.0d0)
! find upper limit of LatentPLR
TempMaxPLR = TempMaxPLR + 0.1d0
! Same calculation as is done in Function CalcFurnaceResidual for latent PLR calculation.
! Set cooling to heating PLR for use with Subroutine CalcFurnaceOutput. IF Par(10) = 0,
! heating PLR = 0 so set the CoolingHeatingPLRRatio to 1 so the cooling PLR is used in the
! DX cooling coil calculations.
IF(Par(10) .GT. 0.0d0)THEN
! Par(10) = Furnace(FurnaceNum)%HeatPartLoadRatio
! OpMode = CycFan and Furnace(FurnaceNum)%HeatPartLoadRatio must be > 0 for Part(10) to be greater than 0
CoolingHeatingPLRRatio = MIN(1.0d0,TempMaxPLR/Furnace(FurnaceNum)%HeatPartLoadRatio)
ELSE
CoolingHeatingPLRRatio = 1.0d0
END IF
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,TempMaxPLR, &
0.0d0,0.0d0,0.0d0, TempCoolOutput, TempLatentOutput, OnOffAirFlowRatio, &
HXUnitOn, CoolingHeatingPLRRatio)
END DO
TempMinPLR = TempMaxPLR
DO WHILE((TempLatentOutput - SystemMoistureLoad) .LT. 0.0d0 .AND. TempMinPLR .GT. 0.0d0)
! pull upper limit of LatentPLR down to last valid limit (i.e. latent output still exceeds SystemMoisuterLoad)
! CR7558 - relax final limits to allow HX assisted coils to converge
TempMaxPLR = TempMinPLR + 0.001d0
! find minimum limit of Latent PLR
TempMinPLR = TempMinPLR - 0.001d0
! Set cooling to heating PLR for use with Subroutine CalcFurnaceOutput.
IF(Par(10) .GT. 0.0d0)THEN
! Par(10) = Furnace(FurnaceNum)%HeatPartLoadRatio
! OpMode = CycFan and Furnace(FurnaceNum)%HeatPartLoadRatio must be > 0 for Part(10) to be greater than 0
! Since the latent output of cycling fan systems is 0 at PLR=0, do not allow the PLR to be 0,
! otherwise RegulaFalsi can fail when a heating and moisture load exists and heating PLR > latent PLR.
TempMinPLR2 = MAX(0.0000000001d0,TempMinPLR)
CoolingHeatingPLRRatio = MIN(1.0d0,TempMinPLR2/Furnace(FurnaceNum)%HeatPartLoadRatio)
ELSE
TempMinPLR2 = TempMinPLR
CoolingHeatingPLRRatio = 1.0d0
END IF
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,TempMinPLR2, &
0.0d0,0.0d0,0.0d0, TempCoolOutput, TempLatentOutput, OnOffAirFlowRatio, &
HXUnitOn, CoolingHeatingPLRRatio)
END DO
! tighter boundary of solution has been found, call RegulaFalsi a second time
CALL SolveRegulaFalsi(CoolErrorToler,MaxIter,SolFlag,LatentPartLoadRatio, &
CalcFurnaceResidual,TempMinPLR2,TempMaxPLR,Par)
! OnOffAirFlowRatio is updated during the above iteration. Reset to correct value based on PLR.
OnOffAirFlowRatio = OnOffAirFlowRatioSave
IF (SolFlag == -1) THEN
! Set cooling to heating PLR for use with Subroutine CalcFurnaceOutput.
IF(Par(10) .GT. 0.0d0)THEN
! Par(10) = Furnace(FurnaceNum)%HeatPartLoadRatio
! OpMode = CycFan and Furnace(FurnaceNum)%HeatPartLoadRatio must be > 0 for Part(10) to be greater than 0
CoolingHeatingPLRRatio = MIN(1.0d0,LatentPartLoadRatio/Furnace(FurnaceNum)%HeatPartLoadRatio)
ELSE
CoolingHeatingPLRRatio = 1.0d0
END IF
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,LatentPartLoadRatio, &
0.0d0,0.0d0,0.0d0, TempCoolOutput, TempLatentOutput, OnOffAirFlowRatio, &
HXUnitOn, CoolingHeatingPLRRatio)
IF(ABS((SystemMoistureLoad - TempLatentOutput)/SystemMoistureLoad) .GT. CoolErrorToler .AND. &
ABS(SystemMoistureLoad - TempLatentOutput).GT. 10.0d0)THEN
IF(.NOT. WarmupFlag)THEN
IF(Furnace(FurnaceNum)%LatentMaxIterIndex == 0)THEN
CALL ShowWarningMessage('Cooling coil control failed to converge for ' &
//TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//':'//TRIM(Furnace(FurnaceNum)%Name))
CALL ShowContinueError(' Iteration limit exceeded in calculating cooling coil latent part-load ratio.')
CALL ShowContinueError(' Latent load convergence error (percent) = '// &
TRIM(TrimSigDigits(100.0d0*ABS((SystemMoistureLoad - TempLatentOutput)/SystemMoistureLoad),2)))
CALL ShowContinueErrorTimeStamp('Moisture load to be met by DX coil = ' &
//TRIM(TrimSigDigits(SystemMoistureLoad,2))//' (watts), Latent output of DX coil = ' &
//TRIM(TrimSigDigits(TempLatentOutput,2))//' (watts), and the simulation continues.')
ENDIF
CALL ShowRecurringWarningErrorAtEnd(TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//' "'&
//TRIM(Furnace(FurnaceNum)%Name)//'" - Iteration limit exceeded in calculating'// &
' latent part-load ratio error continues. Latent load convergence error (percent) statistics follow.' &
,Furnace(FurnaceNum)%LatentMaxIterIndex, &
100.0d0*ABS((SystemMoistureLoad - TempLatentOutput)/SystemMoistureLoad), &
100.0d0*ABS((SystemMoistureLoad - TempLatentOutput)/SystemMoistureLoad))
END IF
END IF
ELSE IF (SolFlag == -2) THEN
IF(Furnace(FurnaceNum)%LatentRegulaFalsiFailedIndex2 == 0)THEN
CALL ShowWarningMessage('Cooling coil control failed for ' &
//TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//':'//TRIM(Furnace(FurnaceNum)%Name))
CALL ShowContinueError(' Latent part-load ratio determined to be outside the range of ' &
//TrimSigDigits(TempMinPLR,3)//' to '//TrimSigDigits(TempMaxPLR,3)//'.')
CALL ShowContinueErrorTimeStamp('A PLR of '//TRIM(TrimSigDigits(TempMinPLR,3))//' will be used and the ' &
//'simulation continues.')
ENDIF
CALL ShowRecurringWarningErrorAtEnd(TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//' "'&
//TRIM(Furnace(FurnaceNum)%Name)//'" - Cooling sensible part-load ratio out of range'// &
' error continues. System moisture load statistics:' &
,Furnace(FurnaceNum)%LatentRegulaFalsiFailedIndex2,SystemMoistureLoad,SystemMoistureLoad)
LatentPartLoadRatio = TempMinPLR
END IF
ELSE IF (SolFlag == -2) THEN
IF(Furnace(FurnaceNum)%LatentRegulaFalsiFailedIndex == 0)THEN
CALL ShowWarningMessage('Cooling coil control failed for ' &
//TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//':'//TRIM(Furnace(FurnaceNum)%Name))
CALL ShowContinueError(' Latent part-load ratio determined to be outside the range of 0-1.')
CALL ShowContinueErrorTimeStamp('A PLR of 0 will be used and the simulation continues.')
ENDIF
CALL ShowRecurringWarningErrorAtEnd(TRIM(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//' "'&
//TRIM(Furnace(FurnaceNum)%Name)//'" - Latent part-load ratio out of range or 0-1'// &
' error continues. System moisture load statistics:' &
,Furnace(FurnaceNum)%LatentRegulaFalsiFailedIndex,SystemMoistureLoad,SystemMoistureLoad)
LatentPartLoadRatio = 0.0d0
END IF
END IF
! Cooling to heating PLR ratio is now known as CoolHeatPLRRat (Module level global set in CalcFurnaceOutput
! This same variable is use in Subroutine SimFurnace for final calculations.
! Get the actual output in case reheat needs to be calculated (HumControl=TRUE [latent PLR > sensible PLR])
CALL CalcFurnaceOutput(FurnaceNum,FirstHVACIteration,OpMode,CompOp,LatentPartLoadRatio, &
0.0d0,0.0d0,0.0d0,ActualSensibleOutput, ActualLatentOutput, OnOffAirFlowRatio, &
HXUnitOn, CoolHeatPLRRat)
ELSE
LatentPartLoadRatio = 0.0d0
END IF !ENDIF for valid dehumidification control types
! IF a humidistat is used and there is a moisture load, check if the latent PLR is greater than the (sensible) PLR
! IF(LatentPartLoadRatio .GT. PartLoadRatio .and. SystemMoistureLoad .lt. 0.0 .and. Furnace(FurnaceNum)%Humidistat) THEN
IF(LatentPartLoadRatio .GT. PartLoadRatio .and. Furnace(FurnaceNum)%Humidistat) THEN
! For dehumidification mode CoolReheat, compare the Sensible and Latent PLR values, if latentPLR is greater
! than PLR (sensible), then overcooling is required and reheat will be activated using the HumControl flag.
IF(Furnace(FurnaceNum)%DehumidControlType_Num .EQ. DehumidControl_CoolReheat)THEN
PartLoadRatio = LatentPartLoadRatio
HumControl = .TRUE.
END IF
! For dehumidification mode MultiMode, compare the Sensible and Latent PLR values, if latentPLR is
! greater than PLR (sensible), then use the latent PLR to control the unit.
! For MultiMode control, the latent PLR is found by enabling the HX and calculating a PLR required to meet the sensible
! load. Overcooling is not required, and reheat will not be activated using the HumControl flag.
IF(Furnace(FurnaceNum)%DehumidControlType_Num .EQ. DehumidControl_Multimode)THEN
PartLoadRatio = LatentPartLoadRatio
END IF
END IF
Furnace(FurnaceNum)%CoolPartLoadRatio = PartLoadRatio
IF (CompOp == Off) THEN
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0
ELSE
Furnace(FurnaceNum)%CompPartLoadRatio = PartLoadRatio
END IF
ELSE !ELSE from IF(FullSensibleOutput.LT.NoCoolOutput)THEN above
! CR8679 - Unitary Heat Cool control problem, will not run to meeting cooling load
! underlying problem is that FullSensibleOutput is greater than 0 due to very high inlet temp, so the system should be on
! NoCoolOutput was 0 since the defect file is a cycling fan system and the system was turned off
! if FullSensibleOutput > NoCoolOutput, it means the system cannot meet the load and will run full out
! this same logic for WSHP does not seem to work (only the Unitary Heat Pump Compressor Part-Load Ratio report
! variable was affected in the HeatPumpWaterToAirRHControl.idf file while other variables showed very small diffs).
! The defect files meter.csv showed 2% diffs so this IF test is used to keep the results the same in that file.
! Additional logic is used here to make sure the coil actually turned on, e.g., if DX coil PLR > 0 then set to 1,
! otherwise 0 (to make sure coil is actually ON and not off due to schedule, OAT, or other reason).
! The global variable DXCoilPartLoadRatio(DXCoilNum) is not yet used for the WSHP to make the same check.
IF(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_WaterToAir) THEN
Furnace(FurnaceNum)%CoolPartLoadRatio = 0.0d0
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0
ELSE
IF(Furnace(FurnaceNum)%CoolingCoilType_Num == CoilDX_CoolingHXAssisted)THEN
IF(DXCoilPartLoadRatio(Furnace(FurnaceNum)%ActualDXCoilIndexforHXAssisted) .GT. 0.d0)THEN
Furnace(FurnaceNum)%CoolPartLoadRatio = 1.0d0
Furnace(FurnaceNum)%CompPartLoadRatio = 1.0d0
ELSE
Furnace(FurnaceNum)%CoolPartLoadRatio = 0.0d0
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0
END IF
ELSE
IF(DXCoilPartLoadRatio(Furnace(FurnaceNum)%CoolingCoilIndex) .GT. 0.d0)THEN
Furnace(FurnaceNum)%CoolPartLoadRatio = 1.0d0
Furnace(FurnaceNum)%CompPartLoadRatio = 1.0d0
ELSE
Furnace(FurnaceNum)%CoolPartLoadRatio = 0.0d0
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0
END IF
END IF
END IF
ENDIF
! Calculate the reheat coil output
IF(HumControl)THEN ! HumControl = .TRUE. if a Humidistat is installed and dehumdification control type is CoolReheat
IF (Furnace(FurnaceNum)%ZoneSequenceHeatingNum > 0) THEN
QToHeatSetPt=(ZoneSysEnergyDemand(Furnace(FurnaceNum)%ControlZoneNum)% &
SequencedOutputRequiredToHeatingSP(Furnace(FurnaceNum)%ZoneSequenceHeatingNum) / &
Furnace(FurnaceNum)%ControlZoneMassFlowFrac)
ELSE
QToHeatSetPt=(ZoneSysEnergyDemand(Furnace(FurnaceNum)%ControlZoneNum)%OutputRequiredToHeatingSP / &
Furnace(FurnaceNum)%ControlZoneMassFlowFrac)
ENDIF
! Cooling mode or floating condition and dehumidification is required
IF(QToHeatSetPt .LT. 0.0d0)THEN
! Calculate the reheat coil load wrt the heating setpoint temperature. Reheat coil picks up
! the entire excess sensible cooling (DX cooling coil and impact of outdoor air).
ReheatCoilLoad = MAX(0.0d0,(QToHeatSetPt-ActualSensibleOutput))
Furnace(FurnaceNum)%DehumidInducedHeatingDemandRate = ReheatCoilLoad
! Heating mode and dehumidification is required
ELSEIF(QToHeatSetPt .GE. 0.0d0)THEN
! Calculate the reheat coil load as the sensible capacity of the DX cooling coil only. Let
! the heating coil pick up the load due to outdoor air.
ReheatCoilLoad = MAX(0.0d0,(ActualSensibleOutput-NoCoolOutput)*(-1.0d0))
! Dehumidification is not required
IF (Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_AirToAir .OR. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_WaterToAir .AND. &
Furnace(FurnaceNum)%WatertoAirHPType == WatertoAir_Simple )) THEN
ReheatCoilLoad = MAX(QToHeatSetPt,QToHeatSetPt-ActualSensibleOutput)
ENDIF
Furnace(FurnaceNum)%DehumidInducedHeatingDemandRate = MAX(0.0d0,ActualSensibleOutput*(-1.0d0))
ELSE
ReheatCoilLoad = 0.0d0
END IF
ELSE
! No humidistat installed
ReheatCoilLoad = 0.0d0
END IF
END IF !End of cooling section IF statement
IF(NoHeatOutput .GT. SystemSensibleLoad .AND. ReHeatCoilLoad .GT. 0.0d0) THEN
! Reduce reheat coil load if you are controlling high humidity but outside air
! and/or the supply air fan is providing enough heat to meet the system sensible load.
! This will bring the zone temp closer to the heating setpoint temp.
ReHeatCoilLoad = MAX(0.0d0,ReHeatCoilLoad-(NoHeatOutput-SystemSensibleLoad))
END IF
! Set the final air flow. MdotFurnace will be used to set the fan part-load ratio in ReportFurnace
IF(HumControl .AND. SystemMoistureLoad .LT. 0.0d0)THEN
IF(OpMode .EQ. CycFanCycCoil)THEN
! set the flow rate at the maximum of the cooling and heating PLR's
CALL SetAverageAirFlow(FurnaceNum, &
MAX(Furnace(FurnaceNum)%CoolPartLoadRatio,Furnace(FurnaceNum)%HeatPartLoadRatio), OnOffAirFlowRatio)
ELSE
! ELSE set the flow rate at the cooling PLR
CALL SetAverageAirFlow(FurnaceNum, Furnace(FurnaceNum)%CoolPartLoadRatio, OnOffAirFlowRatio)
END IF
ELSE
CALL SetAverageAirFlow(FurnaceNum, &
MAX(Furnace(FurnaceNum)%CoolPartLoadRatio,Furnace(FurnaceNum)%HeatPartLoadRatio), OnOffAirFlowRatio)
END IF
Furnace(FurnaceNum)%MdotFurnace = Node(FurnaceInletNode)%MassFlowRate
IF (Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_AirToAir .OR. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatPump_WatertoAir .AND. &
Furnace(FurnaceNum)%WatertoAirHPType == WatertoAir_Simple))THEN
ELSE
! Non-HeatPump (non-DX) heating coils do not set PLR, reset to 0 here. This variable was set for non-DX
! coils to allow the SetAverageAirFlow CALL above to set the correct air mass flow rate. See this
! IF block above in heating section. HeatPLR is not set in the ELSE part of the IF (only HeatCoilLoad is set).
Furnace(FurnaceNum)%HeatPartLoadRatio = 0.0d0
END IF
!*********HVAC Scheduled OFF*************
! No heating or cooling or dehumidification
!!!LKL discrepancy with < 0?
IF(GetCurrentScheduleValue(Furnace(FurnaceNum)%SchedPtr) .eq. 0.0d0 .OR. &
Node(FurnaceInletNode)%MassFlowRate .eq. 0.0d0) THEN
Furnace(FurnaceNum)%MdotFurnace = 0.0d0
CoolCoilLoad = 0.0d0
HeatCoilLoad = 0.0d0
ReheatCoilLoad = 0.0d0
OnOffFanPartLoadFraction = 1.0d0 ! System off, so set on/off fan part-load fraction = 1
Furnace(FurnaceNum)%CoolPartLoadRatio = 0.0d0
Furnace(FurnaceNum)%HeatPartLoadRatio = 0.0d0
Furnace(FurnaceNum)%CompPartLoadRatio = 0.0d0
!set report variables
Furnace(FurnaceNum)%CoolingCoilSensDemand=0.0d0
Furnace(FurnaceNum)%CoolingCoilLatentDemand=0.0d0
Furnace(FurnaceNum)%HeatingCoilSensDemand=0.0d0
END IF
END IF ! End of the FirstHVACIteration control of the mass flow If block
! Set the fan inlet node flow rates
Node(FurnaceInletNode)%MassFlowRateMaxAvail = Furnace(FurnaceNum)%MdotFurnace
Node(FurnaceInletNode)%MassFlowRate = Furnace(FurnaceNum)%MdotFurnace
RETURN
END Subroutine CalcNewZoneHeatCoolFlowRates