Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | UnitNum | |||
integer, | intent(in) | :: | ZoneNum | |||
real(kind=r64), | intent(in) | :: | ZoneCoolingLoad |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE ControlVSEvapUnitToMeetLoad(UnitNum, ZoneNum, ZoneCoolingLoad)
! SUBROUTINE INFORMATION:
! AUTHOR <author>
! DATE WRITTEN <date_written>
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! <description>
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
USE DataGlobals, ONLY: WarmupFlag
USE DataHVACGlobals, ONLY: ZoneCompTurnFansOn, ZoneCompTurnFansOff
USE Fans, ONLY: SimulateFanComponents
USE General, ONLY: SolveRegulaFalsi, RoundSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: UnitNum ! unit number
INTEGER, INTENT(IN) :: ZoneNum ! number of zone being served
REAL(r64), INTENT(IN) :: ZoneCoolingLoad ! target cooling load
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: MaxIte = 500 ! maximum number of iterations
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: MinHumRat
REAL(r64), DIMENSION(5) :: Par ! Parameters passed to RegulaFalsi
REAL(r64) :: FanSpeedRatio
REAL(r64) :: ErrorToler = 0.001d0 ! error tolerance
INTEGER :: SolFla ! Flag of RegulaFalsi solver
REAL(r64) :: FullFlowSensibleOutputProvided
! first get full load result
ErrorToler = 0.01d0
ZoneEvapUnit(UnitNum)%FanSpeedRatio = ZoneEvapUnit(UnitNum)%DesignFanSpeedRatio
Node(ZoneEvapUnit(UnitNum)%OAInletNodeNum)%MassFlowRate = ZoneEvapUnit(UnitNum)%DesignAirMassFlowRate &
* ZoneEvapUnit(UnitNum)%FanSpeedRatio
Node(ZoneEvapUnit(UnitNum)%OAInletNodeNum)%MassFlowRateMaxAvail = Node(ZoneEvapUnit(UnitNum)%OAInletNodeNum)%MassFlowRate
Node(ZoneEvapUnit(UnitNum)%UnitOutletNodeNum)%MassFlowRate = Node(ZoneEvapUnit(UnitNum)%OAInletNodeNum)%MassFlowRate
Node(ZoneEvapUnit(UnitNum)%UnitOutletNodeNum)%MassFlowRateMaxAvail = &
Node(ZoneEvapUnit(UnitNum)%UnitOutletNodeNum)%MassFlowRate
IF (ZoneEvapUnit(UnitNum)%UnitReliefNodeNum > 0) THEN
Node(ZoneEvapUnit(UnitNum)%UnitReliefNodeNum)%MassFlowRate = Node(ZoneEvapUnit(UnitNum)%OAInletNodeNum)%MassFlowRate
Node(ZoneEvapUnit(UnitNum)%UnitReliefNodeNum)%MassFlowRateMaxAvail = &
Node(ZoneEvapUnit(UnitNum)%OAInletNodeNum)%MassFlowRate
ENDIF
IF (ZoneEvapUnit(UnitNum)%FanLocation == BlowThruFan) THEN
Node(ZoneEvapUnit(UnitNum)%FanOutletNodeNum)%MassFlowRate = Node(ZoneEvapUnit(UnitNum)%OAInletNodeNum)%MassFlowRate
Node(ZoneEvapUnit(UnitNum)%FanOutletNodeNum)%MassFlowRateMaxAvail = Node(ZoneEvapUnit(UnitNum)%OAInletNodeNum)%MassFlowRate
CALL SimulateFanComponents(ZoneEvapUnit(UnitNum)%FanName,.FALSE.,ZoneEvapUnit(UnitNum)%FanIndex,&
ZoneEvapUnit(UnitNum)%FanSpeedRatio,&
ZoneCompTurnFansOn,ZoneCompTurnFansOff)
ENDIF
IF (ZoneEvapUnit(UnitNum)%EvapCooler_1_AvailStatus) THEN
CALL SimEvapCooler(ZoneEvapUnit(UnitNum)%EvapCooler_1_Name , ZoneEvapUnit(UnitNum)%EvapCooler_1_Index)
ENDIF
IF ((ZoneEvapUnit(UnitNum)%EvapCooler_2_Index > 0) .AND. ZoneEvapUnit(UnitNum)%EvapCooler_2_AvailStatus) THEN
CALL SimEvapCooler(ZoneEvapUnit(UnitNum)%EvapCooler_2_Name , ZoneEvapUnit(UnitNum)%EvapCooler_2_Index)
ENDIF
IF (ZoneEvapUnit(UnitNum)%FanLocation == DrawThruFan) THEN
CALL SimulateFanComponents(ZoneEvapUnit(UnitNum)%FanName,.FALSE.,ZoneEvapUnit(UnitNum)%FanIndex,&
ZoneEvapUnit(UnitNum)%FanSpeedRatio,&
ZoneCompTurnFansOn,ZoneCompTurnFansOff)
ENDIF
! calculate sensible load met using delta enthalpy at a constant (minimum) humidity ratio)
MinHumRat = MIN(Node(ZoneEvapUnit(UnitNum)%ZoneNodeNum )%HumRat,Node(ZoneEvapUnit(UnitNum)%UnitOutletNodeNum)%HumRat)
FullFlowSensibleOutputProvided = Node(ZoneEvapUnit(UnitNum)%UnitOutletNodeNum)%MassFlowRate &
* (PsyHFnTdbW(Node(ZoneEvapUnit(UnitNum)%UnitOutletNodeNum)%Temp,MinHumRat) &
- PsyHFnTdbW(Node(ZoneEvapUnit(UnitNum)%ZoneNodeNum)%Temp,MinHumRat))
IF (FullFlowSensibleOutputProvided < ZoneCoolingLoad) THEN ! find speed ratio by regula falsi numerical method
Par(1) = UnitNum
Par(2) = ZoneNum
Par(3) = ZoneEvapUnit(UnitNum)%ZoneNodeNum
Par(5) = ZoneCoolingLoad
FanSpeedRatio = 1.0d0
CALL SolveRegulaFalsi(ErrorToler, MaxIte, SolFla, FanSpeedRatio, VSEvapUnitLoadResidual, 0.0d0, 1.0d0, Par)
IF (SolFla == -1) THEN
IF (ZoneEvapUnit(UnitNum)%UnitVSControlMaxIterErrorIndex == 0) THEN
CALL ShowWarningError('Iteration limit exceeded calculating variable speed evap unit fan speed ratio, for unit='// &
TRIM(ZoneEvapUnit(UnitNum)%Name))
CALL ShowContinueErrorTimeStamp(' ')
CALL ShowContinueError('Fan speed ratio returned='//RoundSigDigits(FanSpeedRatio,2))
CALL ShowContinueError('Check input for Fan Placement.')
ENDIF
CALL ShowRecurringWarningErrorAtEnd('Zone Evaporative Cooler unit control failed (iteration limit ['// &
trim(RoundSigDigits(MaxIte))//']) for ZoneHVAC:EvaporativeCoolerUnit ="'// &
TRIM(ZoneEvapUnit(UnitNum)%Name),ZoneEvapUnit(UnitNum)%UnitVSControlMaxIterErrorIndex)
ELSE IF (SolFla == -2) THEN
IF (ZoneEvapUnit(UnitNum)%UnitVSControlLimitsErrorIndex == 0) THEN
CALL ShowWarningError('Variable speed evaporative cooler unit calculation failed: fan speed ratio limits exceeded,' &
//' for unit = '//TRIM(ZoneEvapUnit(UnitNum)%Name))
CALL ShowContinueError('Check input for Fan Placement.')
CALL ShowContinueErrorTimeStamp(' ')
IF (WarmupFlag) CALL ShowContinueError ('Error occurred during warmup days.')
ENDIF
CALL ShowRecurringWarningErrorAtEnd('Zone Evaporative Cooler unit control failed (limits exceeded) ' &
// 'for ZoneHVAC:EvaporativeCoolerUnit ="'// &
TRIM(ZoneEvapUnit(UnitNum)%Name),ZoneEvapUnit(UnitNum)%UnitVSControlLimitsErrorIndex)
ENDIF
ZoneEvapUnit(UnitNum)%FanSpeedRatio = FanSpeedRatio
ENDIF
RETURN
END SUBROUTINE ControlVSEvapUnitToMeetLoad