Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | DesicDehumNum | |||
real(kind=r64), | intent(out) | :: | HumRatNeeded | |||
logical, | intent(in) | :: | FirstHVACIteration |
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 ControlDesiccantDehumidifier(DesicDehumNum,HumRatNeeded,FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Michael J. Witte, GARD Analytics, Inc.
! for Gas Research Institute
! DATE WRITTEN March 2001
! MODIFIED Jan 2005 M. J. Witte, GARD Analytics, Inc.
! Add new control type option:
! NODE LEAVING HUMRAT SETPOINT:BYPASS
! Change existing control type to:
! FIXED LEAVING HUMRAT SETPOINT:BYPASS
! Work supported by ASHRAE research project 1254-RP
! June 2007 R. Raustad, FSEC
! Added new dehumidifier type -- DESICCANT DEHUMIDIFIER
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine sets the output required from the dehumidifier
! METHODOLOGY EMPLOYED:
! Uses a maximum humidity ratio setpoint to calculate required process
! leaving humidity ratio
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: DesicDehumNum ! number of the current dehumidifier being simulated
REAL(r64), INTENT(OUT) :: HumRatNeeded ! process air leaving humidity ratio set by controller [kg water/kg air]
LOGICAL, INTENT (IN) :: FirstHVACIteration ! TRUE if 1st HVAC simulation of system timestep !unused1208
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL :: UnitOn ! unit on flag
REAL(r64) :: ProcAirMassFlowRate ! process air mass flow rate [kg/s]
REAL(r64) :: RegenAirMassFlowRate ! regen air mass flow rate [kg/s]
ProcAirMassFlowRate = 0.0d0
RegenAirMassFlowRate = 0.0d0
UnitOn = .TRUE.
SELECT CASE ((DesicDehum(DesicDehumNum)%DehumTypeCode))
CASE (Solid)
IF (DesicDehum(DesicDehumNum)%HumRatSet .LE. 0.0d0) UnitOn = .FALSE.
ProcAirMassFlowRate = DesicDehum(DesicDehumNum)%ProcAirInMassFlowRate
IF (ProcAirMassFlowRate .LE. SmallMassFlow) UnitOn = .FALSE.
IF (GetCurrentScheduleValue(DesicDehum(DesicDehumNum)%SchedPtr) .LE. 0.0d0) UnitOn = .FALSE.
! If incoming conditions are outside valid range for curve fits, then shut unit off, do not issue warnings
IF (UnitOn) THEN
IF((DesicDehum(DesicDehumNum)%ProcAirInTemp .LT. DesicDehum(DesicDehumNum)%MinProcAirInTemp) .OR. &
(DesicDehum(DesicDehumNum)%ProcAirInTemp .GT. DesicDehum(DesicDehumNum)%MaxProcAirInTemp)) THEN
UnitOn = .FALSE.
ENDIF
IF((DesicDehum(DesicDehumNum)%ProcAirInHumRat .LT. DesicDehum(DesicDehumNum)%MinProcAirInHumRat) .OR. &
(DesicDehum(DesicDehumNum)%ProcAirInHumRat .GT. DesicDehum(DesicDehumNum)%MaxProcAirInHumRat)) THEN
UnitOn = .FALSE.
ENDIF
ENDIF
IF (UnitOn) THEN
! perform the correct dehumidifier control strategy
SELECT CASE(DesicDehum(DesicDehumNum)%ControlType)
CASE (FixedHumratBypass)
HumRatNeeded = DesicDehum(DesicDehumNum)%HumRatSet
IF (HumRatNeeded <= 0.0d0) THEN
CALL ShowSevereError('Dehumidifier:Desiccant:NoFans: '//TRIM(DesicDehum(DesicDehumNum)%Name))
CALL ShowContinueError('Invalid Leaving Max Humidity Ratio Setpoint='//TRIM(TrimSigDigits(HumRatNeeded,8)))
CALL ShowFatalError('must be > 0.0')
END IF
CASE (NodeHumratBypass)
HumRatNeeded = Node(DesicDehum(DesicDehumNum)%ProcAirOutNode)%HumRatMax
CASE DEFAULT
CALL ShowFatalError('Invalid control type in desiccant dehumidifier = '//TRIM(DesicDehum(DesicDehumNum)%Name))
END SELECT
! Setpoint of zero indicates no load from setpoint manager max hum
IF ((HumRatNeeded == 0.0d0) .OR. &
(DesicDehum(DesicDehumNum)%ProcAirInHumRat .LE. HumRatNeeded)) THEN
UnitOn = .FALSE.
HumRatNeeded = DesicDehum(DesicDehumNum)%ProcAirInHumRat
ENDIF
ELSE
HumRatNeeded = DesicDehum(DesicDehumNum)%ProcAirInHumRat
END IF
CASE (Generic)
ProcAirMassFlowRate = Node(DesicDehum(DesicDehumNum)%ProcAirInNode)%MassFlowRate
IF (ProcAirMassFlowRate .LE. SmallMassFlow) UnitOn = .FALSE.
IF (GetCurrentScheduleValue(DesicDehum(DesicDehumNum)%SchedPtr) .LE. 0.0d0) UnitOn = .FALSE.
IF (UnitOn) THEN
IF(DesicDehum(DesicDehumNum)%ControlNodeNum .EQ. DesicDehum(DesicDehumNum)%ProcAirOutNode)THEN
HumRatNeeded = Node(DesicDehum(DesicDehumNum)%ControlNodeNum)%HumRatMax
ELSE
IF(Node(DesicDehum(DesicDehumNum)%ControlNodeNum)%HumRatMax .GT. 0.0d0)THEN
HumRatNeeded = Node(DesicDehum(DesicDehumNum)%ControlNodeNum)%HumRatMax - &
(Node(DesicDehum(DesicDehumNum)%ControlNodeNum)%HumRat - Node(DesicDehum(DesicDehumNum)%ProcAirOutNode)%HumRat)
ELSE
HumRatNeeded = 0.0d0
END IF
END IF
! Setpoint of zero indicates no load from setpoint manager max hum
IF ((HumRatNeeded == 0.0d0) .OR. &
(Node(DesicDehum(DesicDehumNum)%ProcAirInNode)%HumRat .LE. HumRatNeeded)) THEN
HumRatNeeded = Node(DesicDehum(DesicDehumNum)%ProcAirInNode)%HumRat
ENDIF
ELSE
HumRatNeeded = Node(DesicDehum(DesicDehumNum)%ProcAirInNode)%HumRat
END IF
CASE DEFAULT
END SELECT
RETURN
END SUBROUTINE ControlDesiccantDehumidifier