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) | :: | OASysNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
integer, | intent(in) | :: | AirLoopNum |
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 SimOutsideAirSys(OASysNum,FirstHVACIteration,AirLoopNum)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN Oct 1998
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE
! Simulate the controllers and components in the outside air system.
! METHODOLOGY EMPLOYED:
! REFERENCES:
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList, SameString
IMPLICIT NONE
! SUBROUTINE ARGUMENT DEFINITIONS
INTEGER, INTENT(IN) :: OASysNum
LOGICAL, INTENT(IN) :: FirstHVACIteration
INTEGER, INTENT(IN) :: AirLoopNum
! SUBROUTINE PARAMETER DEFINITIONS:
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: CompNum
!INTEGER :: CtrlNum
INTEGER :: OAMixerNum
INTEGER :: OAControllerNum
CHARACTER(len=MaxNameLength) :: CompType
CHARACTER(len=MaxNameLength) :: CompName
CHARACTER(len=MaxNameLength) :: CtrlName
LOGICAL :: FatalErrorFlag
LOGICAL :: Sim
LOGICAL :: OAHeatCoil
LOGICAL :: OACoolCoil
LOGICAL :: OAHX
LOGICAL :: ReSim
! SimOutsideAirSys can handle only 1 controller right now. This must be
! an Outside Air Controller. This is because of the lack of iteration
! and convergence control in the following code.
! DO CtrlNum=1,OutsideAirSys(OASysNum)%NumControllers
! CtrlName = OutsideAirSys(OASysNum)%ControllerName(CtrlNum)
! CALL SimOAController(CtrlName,FirstHVACIteration)
!
! END DO
FatalErrorFlag = .FALSE.
CtrlName = OutsideAirSys(OASysNum)%ControllerName(1)
CurOASysNum = OASysNum
Sim = .TRUE.
ReSim = .FALSE.
CALL SimOAController(CtrlName,OutsideAirSys(OASysNum)%ControllerIndex(1),FirstHVACIteration,AirLoopNum)
DO CompNum=1,OutsideAirSys(OASysNum)%NumComponents
CompType = OutsideAirSys(OASysNum)%ComponentType(CompNum)
CompName = OutsideAirSys(OASysNum)%ComponentName(CompNum)
CALL SimOAComponent(CompType,CompName,OutsideAirSys(OASysNum)%ComponentType_Num(CompNum), &
FirstHVACIteration,OutsideAirSys(OASysNum)%ComponentIndex(CompNum),AirLoopNum,Sim,OASysNum, &
OAHeatCoil,OACoolCoil,OAHX)
IF (OAHX) ReSim = .TRUE.
END DO
! if there were heat exchangers and/or desiccant wheel in the OA path, need to simulate again
! in reverse order to propagate the air flow and conditions out the relief air path to the relief air
! exit node
IF (ReSim) THEN
DO CompNum=OutsideAirSys(OASysNum)%NumComponents-1,1,-1
CompType = OutsideAirSys(OASysNum)%ComponentType(CompNum)
CompName = OutsideAirSys(OASysNum)%ComponentName(CompNum)
CALL SimOAComponent(CompType,CompName,OutsideAirSys(OASysNum)%ComponentType_Num(CompNum), &
FirstHVACIteration,OutsideAirSys(OASysNum)%ComponentIndex(CompNum),AirLoopNum,Sim,OASysNum, &
OAHeatCoil,OACoolCoil,OAHX)
END DO
END IF
IF (MyOneTimeErrorFlag(OASysNum)) THEN
IF (OutsideAirSys(OASysNum)%NumControllers - OutsideAirSys(OASysNum)%NumSimpleControllers > 1) THEN
CALL ShowWarningError('AirLoopHVAC:OutdoorAirSystem ' // TRIM(OutsideAirSys(OASysNum)%Name) // &
' has more than 1 outside air controller; only the 1st will be used')
END IF
DO CompNum=1,OutsideAirSys(OASysNum)%NumComponents
CompType = OutsideAirSys(OASysNum)%ComponentType(CompNum)
CompName = OutsideAirSys(OASysNum)%ComponentName(CompNum)
IF (SameString(CompType,'OutdoorAir:Mixer')) THEN
OAMixerNum=FindItemInList(CompName,OAMixer%Name,NumOAMixers)
OAControllerNum=FindItemInList(CtrlName,OAController%Name,NumOAControllers)
IF (OAController(OAControllerNum)%MixNode .NE. OAMixer(OAMixerNum)%MixNode) THEN
CALL ShowSevereError('The mixed air node of Controller:OutdoorAir="'// TRIM(OAController(OAControllerNum)%Name)//'"')
CALL ShowContinueError('should be the same node as the mixed air node of OutdoorAir:Mixer="' // &
TRIM(OAMixer(OAMixerNum)%Name)//'".')
CALL ShowContinueError('Controller:OutdoorAir mixed air node="'//trim(NodeID(OAController(OAControllerNum)%MixNode))//'".')
CALL ShowContinueError('OutdoorAir:Mixer mixed air node="'//trim(NodeID(OAMixer(OAMixerNum)%MixNode))//'".')
FatalErrorFlag = .TRUE.
END IF
IF (OAController(OAControllerNum)%RelNode .NE. OAMixer(OAMixerNum)%RelNode) THEN
CALL ShowSevereError('The relief air node of Controller:OutdoorAir="' // TRIM(OAController(OAControllerNum)%Name)//'"')
CALL ShowContinueError('should be the same node as the relief air node of OutdoorAir:Mixer="' // &
TRIM(OAMixer(OAMixerNum)%Name)//'".')
CALL ShowContinueError('Controller:OutdoorAir relief air node="'//trim(NodeID(OAController(OAControllerNum)%RelNode))//'".')
CALL ShowContinueError('OutdoorAir:Mixer relief air node="'//trim(NodeID(OAMixer(OAMixerNum)%RelNode))//'".')
FatalErrorFlag = .TRUE.
END IF
IF (OAController(OAControllerNum)%RetNode .NE. OAMixer(OAMixerNum)%RetNode) THEN
CALL ShowSevereError('The return air node of Controller:OutdoorAir="' // TRIM(OAController(OAControllerNum)%Name)//'"')
CALL ShowContinueError('should be the same node as the return air node of OutdoorAir:Mixer="' // &
TRIM(OAMixer(OAMixerNum)%Name)//'".')
CALL ShowContinueError('Controller:OutdoorAir return air node="'//trim(NodeID(OAController(OAControllerNum)%RetNode))//'".')
CALL ShowContinueError('OutdoorAir:Mixer return air node="'//trim(NodeID(OAMixer(OAMixerNum)%RetNode))//'".')
FatalErrorFlag = .TRUE.
END IF
END IF
END DO
MyOneTimeErrorFlag(OASysNum) = .FALSE.
IF (FatalErrorFlag) CALL ShowFatalError('Previous severe error(s) cause program termination')
END IF
CurOASysNum = 0
AirLoopControlInfo(AirLoopNum)%OASysComponentsSimulated = .TRUE.
RETURN
END SUBROUTINE SimOutsideAirSys