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.
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 GetZoneAirLoopEquipment
! SUBROUTINE INFORMATION:
! AUTHOR Russ Taylor
! DATE WRITTEN June 1997
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Get all the system related equipment which may be attached to
! a zone
! METHODOLOGY EMPLOYED:
! Needs description, as appropriate.
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: GetNumObjectsFound, GetObjectItem, GetObjectItemNum, VerifyName, SameString
USE NodeInputManager, ONLY: GetOnlySingleNode
USE DataLoopNode
USE BranchNodeConnections, ONLY: SetUpCompSets
USE DataZoneEquipment, ONLY: ZoneEquipConfig,ZoneEquipList
USE DualDuct, ONLY: GetDualDuctOutdoorAirRecircUse
USE SingleDuct, ONLY: GetATMixerPriNode
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: RoutineName='GetZoneAirLoopEquipment: ' ! include trailing blank space
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: AirDistUnitNum
INTEGER :: AirDistCompUnitNum
INTEGER :: ZoneEqNum ! zone equip config index
INTEGER :: InletNum ! zone equip config inlet node index
INTEGER :: NumAlphas
INTEGER :: NumNums
INTEGER :: IOSTAT
CHARACTER(len=MaxNameLength), DIMENSION(4) :: AlphArray
REAL(r64), DIMENSION(2) :: NumArray
LOGICAL :: ErrorsFound = .false. ! If errors detected in input
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
CHARACTER(len=MaxNameLength) :: CurrentModuleObject ! Object type for getting and error messages
CHARACTER(len=MaxNameLength), DIMENSION(4) :: cAlphaFields ! Alpha field names
CHARACTER(len=MaxNameLength), DIMENSION(2) :: cNumericFields ! Numeric field names
LOGICAL, DIMENSION(4) :: lAlphaBlanks ! Logical array, alpha field input BLANK = .true.
LOGICAL, DIMENSION(2) :: lNumericBlanks ! Logical array, numeric field input BLANK = .true.
LOGICAL :: DualDuctRecircIsUsed !local temporary for deciding if recirc side used by dual duct terminal
INTEGER :: ATMixerPriNode=0 ! primary air inlet node for air terminal mixers
! make sure the input data is read in only once
IF (.not. GetAirDistUnitsFlag) THEN
RETURN
ELSE
GetAirDistUnitsFlag = .FALSE.
END IF
CurrentModuleObject = 'ZoneHVAC:AirDistributionUnit'
NumAirDistUnits = GetNumObjectsFound(CurrentModuleObject)
ALLOCATE (AirDistUnit(NumAirDistUnits)) !
IF (NumAirDistUnits .GT. 0)THEN
DO AirDistUnitNum = 1, NumAirDistUnits
CALL GetObjectItem(CurrentModuleObject,AirDistUnitNum,AlphArray,NumAlphas, &
NumArray,NumNums,IOSTAT,NumBlank=lNumericBlanks,AlphaBlank=lAlphaBlanks, &
AlphaFieldNames=cAlphaFields,NumericFieldNames=cNumericFields) ! data for one zone
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(AlphArray(1),AirDistUnit%Name,AirDistUnitNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) AlphArray(1)='xxxxx'
ENDIF
AirDistUnit(AirDistUnitNum)%Name = AlphArray(1)
!Input Outlet Node Num
AirDistUnit(AirDistUnitNum)%OutletNodeNum = &
GetOnlySingleNode(AlphArray(2),ErrorsFound,TRIM(CurrentModuleObject),AlphArray(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsParent)
AirDistUnit(AirDistUnitNum)%InletNodeNum = 0
AirDistUnit(AirDistUnitNum)%NumComponents = 1
AirDistCompUnitNum=1
!Load the air Distribution Unit Equip and Name
AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum) = AlphArray(3)
AirDistUnit(AirDistUnitNum)%EquipName(AirDistCompUnitNum) = AlphArray(4)
CALL ValidateComponent(AlphArray(3),AlphArray(4),IsNotOK,TRIM(CurrentModuleObject))
IF (IsNotOK) THEN
CALL ShowContinueError('In '//TRIM(CurrentModuleObject)//' = '//TRIM(AlphArray(1)))
ErrorsFound=.true.
ENDIF
AirDistUnit(AirDistUnitNum)%UpStreamLeakFrac = NumArray(1)
AirDistUnit(AirDistUnitNum)%DownStreamLeakFrac = NumArray(2)
IF (AirDistUnit(AirDistUnitNum)%DownStreamLeakFrac <= 0.0d0) THEN
AirDistUnit(AirDistUnitNum)%LeakLoadMult = 1.0d0
ELSE IF (AirDistUnit(AirDistUnitNum)%DownStreamLeakFrac < 1.0d0 .AND. &
AirDistUnit(AirDistUnitNum)%DownStreamLeakFrac > 0.0d0) THEN
AirDistUnit(AirDistUnitNum)%LeakLoadMult = 1.0d0/(1.0d0-AirDistUnit(AirDistUnitNum)%DownStreamLeakFrac)
ELSE
CALL ShowSevereError('Error found in '//TRIM(CurrentModuleObject)//' = '//TRIM(AirDistUnit(AirDistUnitNum)%Name))
CALL ShowContinueError(TRIM(cNumericFields(2))//' must be less than 1.0')
ErrorsFound=.true.
END IF
IF (AirDistUnit(AirDistUnitNum)%UpStreamLeakFrac > 0.0d0) THEN
AirDistUnit(AirDistUnitNum)%UpStreamLeak = .TRUE.
ELSE
AirDistUnit(AirDistUnitNum)%UpStreamLeak = .FALSE.
END IF
IF (AirDistUnit(AirDistUnitNum)%DownStreamLeakFrac > 0.0d0) THEN
AirDistUnit(AirDistUnitNum)%DownStreamLeak = .TRUE.
ELSE
AirDistUnit(AirDistUnitNum)%DownStreamLeak = .FALSE.
END IF
! Validate EquipType for Air Distribution Unit
IF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum),'AirTerminal:DualDuct:ConstantVolume')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=DualDuctConstVolume
IF (AirDistUnit(AirDistUnitNum)%UpStreamLeak .or. AirDistUnit(AirDistUnitNum)%DownStreamLeak) THEN
CALL ShowSevereError('Error found in '//TRIM(CurrentModuleObject)//' = '//TRIM(AirDistUnit(AirDistUnitNum)%Name))
CALL ShowContinueError('Simple duct leakage model not available for '//TRIM(cAlphaFields(3))//' = '// &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum)))
ErrorsFound=.true.
END IF
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum),'AirTerminal:DualDuct:VAV')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=DualDuctVAV
IF (AirDistUnit(AirDistUnitNum)%UpStreamLeak .or. AirDistUnit(AirDistUnitNum)%DownStreamLeak) THEN
CALL ShowSevereError('Error found in '//TRIM(CurrentModuleObject)//' = '//TRIM(AirDistUnit(AirDistUnitNum)%Name))
CALL ShowContinueError('Simple duct leakage model not available for '//TRIM(cAlphaFields(3))//' = '// &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum)))
ErrorsFound=.true.
END IF
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum),'AirTerminal:DualDuct:VAV:OutdoorAir')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=DualDuctVAVOutdoorAir
IF (AirDistUnit(AirDistUnitNum)%UpStreamLeak .or. AirDistUnit(AirDistUnitNum)%DownStreamLeak) THEN
CALL ShowSevereError('Error found in '//TRIM(CurrentModuleObject)//' = '//TRIM(AirDistUnit(AirDistUnitNum)%Name))
CALL ShowContinueError('Simple duct leakage model not available for '//TRIM(cAlphaFields(3))//' = '// &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum)))
ErrorsFound=.true.
END IF
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum), &
'AirTerminal:SingleDuct:ConstantVolume:Reheat')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuctConstVolReheat
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum),'AirTerminal:SingleDuct:VAV:Reheat')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuctVAVReheat
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum),'AirTerminal:SingleDuct:VAV:NoReheat')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuctVAVNoReheat
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum), &
'AirTerminal:SingleDuct:VAV:HeatAndCool:Reheat')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuctCBVAVReheat
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum), &
'AirTerminal:SingleDuct:VAV:HeatAndCool:NoReheat')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuctCBVAVNoReheat
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum), &
'AirTerminal:SingleDuct:SeriesPIU:Reheat')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuct_SeriesPIU_Reheat
IF (AirDistUnit(AirDistUnitNum)%UpStreamLeak .or. AirDistUnit(AirDistUnitNum)%DownStreamLeak) THEN
CALL ShowSevereError('Error found in '//TRIM(CurrentModuleObject)//' = '//TRIM(AirDistUnit(AirDistUnitNum)%Name))
CALL ShowContinueError('Simple duct leakage model not available for '//TRIM(cAlphaFields(3))//' = '// &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum)))
ErrorsFound=.true.
END IF
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum), &
'AirTerminal:SingleDuct:ParallelPIU:Reheat')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuct_ParallelPIU_Reheat
IF (AirDistUnit(AirDistUnitNum)%UpStreamLeak .or. AirDistUnit(AirDistUnitNum)%DownStreamLeak) THEN
CALL ShowSevereError('Error found in '//TRIM(CurrentModuleObject)//' = '//TRIM(AirDistUnit(AirDistUnitNum)%Name))
CALL ShowContinueError('Simple duct leakage model not available for '//TRIM(cAlphaFields(3))//' = '// &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum)))
ErrorsFound=.true.
END IF
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum), &
'AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuct_ConstVol_4PipeInduc
IF (AirDistUnit(AirDistUnitNum)%UpStreamLeak .or. AirDistUnit(AirDistUnitNum)%DownStreamLeak) THEN
CALL ShowSevereError('Error found in '//TRIM(CurrentModuleObject)//' = '//TRIM(AirDistUnit(AirDistUnitNum)%Name))
CALL ShowContinueError('Simple duct leakage model not available for '//TRIM(cAlphaFields(3))//' = '// &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum)))
ErrorsFound=.true.
END IF
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum), &
'AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuctVAVReheatVSFan
IF (AirDistUnit(AirDistUnitNum)%UpStreamLeak .or. AirDistUnit(AirDistUnitNum)%DownStreamLeak) THEN
CALL ShowSevereError('Error found in '//TRIM(CurrentModuleObject)//' = '//TRIM(AirDistUnit(AirDistUnitNum)%Name))
CALL ShowContinueError('Simple duct leakage model not available for '//TRIM(cAlphaFields(3))//' = '// &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum)))
ErrorsFound=.true.
END IF
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum), &
'AirTerminal:SingleDuct:ConstantVolume:CooledBeam')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuctConstVolCooledBeam
IF (AirDistUnit(AirDistUnitNum)%UpStreamLeak .or. AirDistUnit(AirDistUnitNum)%DownStreamLeak) THEN
CALL ShowSevereError('Error found in '//TRIM(CurrentModuleObject)//' = '//TRIM(AirDistUnit(AirDistUnitNum)%Name))
CALL ShowContinueError('Simple duct leakage model not available for '//TRIM(cAlphaFields(3))//' = '// &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum)))
ErrorsFound=.true.
END IF
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum),'AirTerminal:SingleDuct:UserDefined')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuctUserDefined
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum),'AirTerminal:SingleDuct:InletSideMixer')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuctInletATMixer
CALL GetATMixerPriNode(AirDistUnit(AirDistUnitNum)%EquipName(1),ATMixerPriNode)
AirDistUnit(AirDistUnitNum)%InletNodeNum = ATMixerPriNode
IF (AirDistUnit(AirDistUnitNum)%UpStreamLeak .or. AirDistUnit(AirDistUnitNum)%DownStreamLeak) THEN
CALL ShowSevereError('Error found in '//TRIM(CurrentModuleObject)//' = '//TRIM(AirDistUnit(AirDistUnitNum)%Name))
CALL ShowContinueError('Simple duct leakage model not available for '//TRIM(cAlphaFields(3))//' = '// &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum)))
ErrorsFound=.true.
END IF
ELSEIF (SameString(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum),'AirTerminal:SingleDuct:SupplySideMixer')) THEN
AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum)=SingleDuctSupplyATMixer
CALL GetATMixerPriNode(AirDistUnit(AirDistUnitNum)%EquipName(1),ATMixerPriNode)
AirDistUnit(AirDistUnitNum)%InletNodeNum = ATMixerPriNode
IF (AirDistUnit(AirDistUnitNum)%UpStreamLeak .or. AirDistUnit(AirDistUnitNum)%DownStreamLeak) THEN
CALL ShowSevereError('Error found in '//TRIM(CurrentModuleObject)//' = '//TRIM(AirDistUnit(AirDistUnitNum)%Name))
CALL ShowContinueError('Simple duct leakage model not available for '//TRIM(cAlphaFields(3))//' = '// &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum)))
ErrorsFound=.true.
END IF
ELSE
CALL ShowSevereError('Error found in '//TRIM(CurrentModuleObject)//' = '//TRIM(AirDistUnit(AirDistUnitNum)%Name))
CALL ShowContinueError('Invalid '//TRIM(cAlphaFields(3))//' = '// &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum)))
ErrorsFound=.true.
ENDIF
! Set up component set for air terminal unit
IF ((AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum) == DualDuctConstVolume) .OR. &
(AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum) == DualDuctVAV)) THEN
! For dual duct units, set up two component sets, one for heat and one for cool
CALL SetUpCompSets(TRIM(CurrentModuleObject), AirDistUnit(AirDistUnitNum)%Name, &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum))//':HEAT', &
AirDistUnit(AirDistUnitNum)%EquipName(AirDistCompUnitNum), &
'UNDEFINED',AlphArray(2))
CALL SetUpCompSets(TRIM(CurrentModuleObject), AirDistUnit(AirDistUnitNum)%Name, &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum))//':COOL', &
AirDistUnit(AirDistUnitNum)%EquipName(AirDistCompUnitNum), &
'UNDEFINED',AlphArray(2))
! For dual duct units with decoupled OA and RA, set up two component sets, one for OA (Outdoor Air)
! and one for RA (Recirculated Air)
ELSEIF ((AirDistUnit(AirDistUnitNum)%EquipType_Num(AirDistCompUnitNum) == DualDuctVAVOutdoorAir)) THEN
CALL SetUpCompSets(TRIM(CurrentModuleObject), AirDistUnit(AirDistUnitNum)%Name, &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum))//':OutdoorAir', &
AirDistUnit(AirDistUnitNum)%EquipName(AirDistCompUnitNum), &
'UNDEFINED',AlphArray(2))
CALL GetDualDuctOutdoorAirRecircUse( AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum) , &
AirDistUnit(AirDistUnitNum)%EquipName(AirDistCompUnitNum) , &
DualDuctRecircIsUsed )
IF ( DualDuctRecircIsUsed ) THEN
CALL SetUpCompSets(TRIM(CurrentModuleObject), AirDistUnit(AirDistUnitNum)%Name, &
TRIM(AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum))//':RecirculatedAir', &
AirDistUnit(AirDistUnitNum)%EquipName(AirDistCompUnitNum), &
'UNDEFINED',AlphArray(2))
ENDIF
ELSE
CALL SetUpCompSets(TRIM(CurrentModuleObject), AirDistUnit(AirDistUnitNum)%Name, &
AirDistUnit(AirDistUnitNum)%EquipType(AirDistCompUnitNum), &
AirDistUnit(AirDistUnitNum)%EquipName(AirDistCompUnitNum), &
'UNDEFINED',AlphArray(2))
ENDIF
! find and save corresponding zone equip config
DO ZoneEqNum=1,NumOfZones
IF (.not. ZoneEquipConfig(ZoneEqNum)%IsControlled) CYCLE
DO InletNum=1,ZoneEquipConfig(ZoneEqNum)%NumInletNodes
IF (ZoneEquipConfig(ZoneEqNum)%InletNode(InletNum) == AirDistUnit(AirDistUnitNum)%OutletNodeNum) THEN
AirDistUnit(AirDistUnitNum)%ZoneEqNum = ZoneEqNum
END IF
END DO
END DO
IF ( AirDistUnit(AirDistUnitNum)%UpStreamLeak .or. AirDistUnit(AirDistUnitNum)%DownStreamLeak ) THEN
ZoneEquipConfig(AirDistUnit(AirDistUnitNum)%ZoneEqNum)%SupLeakToRetPlen = .TRUE.
END IF
END DO !End of Air Dist Do Loop
END IF
IF (ErrorsFound) THEN
CALL ShowFatalError(RoutineName//'Errors found in getting '//TRIM(CurrentModuleObject)//' Input')
ENDIF
RETURN
END SUBROUTINE GetZoneAirLoopEquipment