SUBROUTINE GetCBVAV
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad
! DATE WRITTEN July 2006
! MODIFIED Bereket Nigusse, FSEC, April 2011: added OA Mixer object type
!
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Obtains input data for changeover-bypass VAV systems and stores it in CBVAV data structures
! METHODOLOGY EMPLOYED:
! Uses "Get" routines to read in data.
! REFERENCES:
! na
! USE STATEMENTS:
USE Fans, ONLY: GetFanType, GetFanIndex, GetFanVolFlow, GetFanInletNode, GetFanOutletNode
USE General, ONLY: TrimSigDigits
USE DXCoils, ONLY: GetMinOATDXCoilCompressor => GetMinOATCompressor, &
GetDXCoilInletNode=>GetCoilInletNode, GetDXCoilOutletNode=>GetCoilOutletNode, &
GetDXCoilCondenserInletNode=>GetCoilCondenserInletNode, GetDXCoolCoilIndex=>GetDXCoilIndex
USE MixedAir, ONLY: GetOAMixerNodeNumbers
USE DataSizing, ONLY: AutoSize
USE DataAirLoop, ONLY: AirToZoneNodeInfo
USE HeatingCoils, ONLY: GetCoilInletNode, GetCoilOutletNode
USE InputProcessor, ONLY: GetNumObjectsFound, GetObjectItem, VerifyName, SameString
USE DataAirSystems, ONLY: PrimaryAirSystem
USE ScheduleManager, ONLY: CheckScheduleValueMinMax, GetScheduleIndex
USE DataHVACGlobals, ONLY: FanType_SimpleConstVolume, FanType_SimpleVAV, FanType_SimpleOnOff, FanType_ZoneExhaust, &
NumPrimaryAirSys
USE NodeInputManager, ONLY: GetOnlySingleNode
USE DataZoneEquipment, ONLY: ZoneEquipConfig, ZoneEquipList,AirDistUnit_Num, DirectAir_Num
USE BranchNodeConnections, ONLY: SetUpCompSets, TestCompSet
USE DataZoneControls, ONLY: TempControlledZone, NumTempControlledZones
USE HVACHXAssistedCoolingCoil, ONLY: GetHXDXCoilName, GetHXDXCoilInletNode=>GetCoilInletNode, &
GetHXDXCoilOutletNode=>GetCoilOutletNode
USE SteamCoils, ONLY: GetSteamCoilAirInletNode=>GetCoilAirInletNode, GetSteamCoilIndex, &
GetSteamCoilAirOutletNode=>GetCoilAirOutletNode, &
GetSteamCoilSteamInletNode=>GetCoilSteamInletNode, &
GetCoilMaxSteamFlowRate=>GetCoilMaxSteamFlowRate, GetTypeOfCoil, ZoneLoadControl
USE WaterCoils, ONLY: GetCoilWaterInletNode, GetCoilMaxWaterFlowRate, &
GetWaterCoilInletNode=>GetCoilInletNode,GetWaterCoilOutletNode=>GetCoilOutletNode
USE FluidProperties, ONLY: GetSatDensityRefrig
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: CBVAVIndex ! Loop index
INTEGER :: CBVAVNum ! Current CBVAV number
CHARACTER(len=MaxNameLength), &
DIMENSION(19) :: Alphas ! Alpha items for object
REAL(r64), DIMENSION(11) :: Numbers ! Numeric items for object
CHARACTER(len=MaxNameLength) :: CompSetFanInlet ! Used in SetUpCompSets call
CHARACTER(len=MaxNameLength) :: CompSetCoolInlet ! Used in SetUpCompSets call
CHARACTER(len=MaxNameLength) :: CompSetFanOutlet ! Used in SetUpCompSets call
CHARACTER(len=MaxNameLength) :: CompSetCoolOutlet ! Used in SetUpCompSets call
INTEGER :: NumAlphas ! Number of Alphas for each GetObjectItem call
INTEGER :: NumNumbers ! Number of Numbers for each GetObjectItem call
INTEGER :: IOStatus ! Used in GetObjectItem
LOGICAL :: ErrorsFound=.false. ! Set to true if errors in input, fatal at end of routine
LOGICAL :: DXErrorsFound=.false. ! Set to true if errors in get coil input
!unused0509 LOGICAL :: FanErrorsFound=.false. ! Set to true if errors in get fan input
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
CHARACTER(len=MaxNameLength) :: CurrentModuleObject ! Object type for getting and error messages
LOGICAL :: FanErrFlag = .FALSE. ! Error flag returned during CALL to GetFanType
LOGICAL :: ErrFlag = .FALSE. ! Error flag returned during CALL to mining functions
INTEGER :: FanIndex ! Index to CBVAV's supply air fan
REAL(r64) :: FanVolFlow ! Maximum air volumetric flow rate of fan
INTEGER :: AirLoopNum ! Index to air loop served by this system
INTEGER :: AirLoopZoneNum ! Index to controlled zone
INTEGER :: BranchNum ! Index to branch containing this system
INTEGER :: CompNum ! Index to this system
INTEGER, DIMENSION(4) :: OANodeNums ! Node numbers of OA mixer (OA, EA, RA, MA)
CHARACTER(len=MaxNameLength) :: HXDXCoolCoilName ! Name of DX cooling coil used with Heat Exchanger Assisted Cooling Coil
CHARACTER(len=MaxNameLength) :: MixerInletNodeName ! Name of mixer inlet node
CHARACTER(len=MaxNameLength) :: SplitterOutletNodeName ! Name of splitter outlet node
INTEGER :: ControlNodeNum ! Number of control zone when humidity control is specified
INTEGER :: TstatZoneNum ! Index to thermostats
LOGICAL :: FoundTstatZone ! TRUE if thermostat found in controlled zone
LOGICAL :: OANodeErrFlag ! TRUE if DX Coil condenser node is not found
LOGICAL :: DXCoilErrFlag ! used in warning messages
CHARACTER(Len=MaxNameLength), DIMENSION(19) :: cAlphaFields ! Alpha field names
CHARACTER(Len=MaxNameLength), DIMENSION(11) :: cNumericFields ! Numeric field names
LOGICAL, DIMENSION(19) :: lAlphaBlanks ! Logical array, alpha field input BLANK = .true.
LOGICAL, DIMENSION(11) :: lNumericBlanks ! Logical array, numeric field input BLANK = .true.
INTEGER :: EquipNum = 0 ! local do loop index for equipment listed for a zone
INTEGER :: HeatCoilInletNodeNum ! Heating coil air inlet node number
INTEGER :: HeatCoilOutletNodeNum ! Heating coil air outlet node number
INTEGER :: TempNodeNum ! HW coil water inlet node
INTEGER :: SteamIndex ! steam coil index
REAL(r64) :: SteamDensity ! steam coil steam density
Alphas = ' '
Numbers = 0.0d0
cAlphaFields=' '
cNumericFields=' '
lAlphaBlanks=.true.
lNumericBlanks=.true.
! find the number of each type of CBVAV unit
CurrentModuleObject = 'AirLoopHVAC:UnitaryHeatCool:VAVChangeoverBypass'
NumCBVAV = GetNumObjectsFound(CurrentModuleObject)
! allocate the data structures
ALLOCATE(CBVAV(NumCBVAV))
ALLOCATE(CheckEquipName(NumCBVAV))
CheckEquipName=.true.
! loop over CBVAV units; get and load the input data
DO CBVAVIndex = 1,NumCBVAV
HeatCoilInletNodeNum = 0
HeatCoilOutletNodeNum = 0
CALL GetObjectItem(CurrentModuleObject,CBVAVIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericBlanks,AlphaBlank=lAlphaBlanks, &
AlphaFieldNames=cAlphaFields,NumericFieldNames=cNumericFields)
CBVAVNum = CBVAVIndex
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),CBVAV%Name,CBVAVNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
CBVAV(CBVAVNum)%Name = Alphas(1)
CBVAV(CBVAVNum)%UnitType = CurrentModuleObject
CBVAV(CBVAVNum)%Sched = Alphas(2)
IF (lAlphaBlanks(2)) THEN
CBVAV(CBVAVNum)%SchedPtr = ScheduleAlwaysOn
ELSE
CBVAV(CBVAVNum)%SchedPtr = GetScheduleIndex(Alphas(2)) ! convert schedule name to pointer (index number)
IF (CBVAV(CBVAVNum)%SchedPtr .EQ. 0) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' '//TRIM(cAlphaFields(2))//' not found = '//TRIM(Alphas(2)))
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
ErrorsFound=.TRUE.
END IF
ENDIF
CBVAV(CBVAVNum)%MaxCoolAirVolFlow = Numbers(1)
IF (CBVAV(CBVAVNum)%MaxCoolAirVolFlow .LE. 0.0d0 .AND. CBVAV(CBVAVNum)%MaxCoolAirVolFlow .NE. AutoSize) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' illegal '//TRIM(cNumericFields(1))//' = ' &
//TRIM(TrimSigDigits(Numbers(1),7)))
CALL ShowContinueError(TRIM(cNumericFields(1))//' must be greater than zero.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
ErrorsFound = .TRUE.
END IF
CBVAV(CBVAVNum)%MaxHeatAirVolFlow = Numbers(2)
IF (CBVAV(CBVAVNum)%MaxHeatAirVolFlow .LE. 0.0d0 .AND. CBVAV(CBVAVNum)%MaxHeatAirVolFlow .NE. AutoSize) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' illegal '//TRIM(cNumericFields(2))//' = ' &
//TRIM(TrimSigDigits(Numbers(2),7)))
CALL ShowContinueError(TRIM(cNumericFields(2))//' must be greater than zero.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
ErrorsFound = .TRUE.
END IF
CBVAV(CBVAVNum)%MaxNoCoolHeatAirVolFlow = Numbers(3)
IF (CBVAV(CBVAVNum)%MaxNoCoolHeatAirVolFlow .LT. 0.0d0 .AND. CBVAV(CBVAVNum)%MaxNoCoolHeatAirVolFlow .NE. AutoSize) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' illegal '//TRIM(cNumericFields(3))//' = ' &
//TRIM(TrimSigDigits(Numbers(3),7)))
CALL ShowContinueError(TRIM(cNumericFields(3))//' must be greater than or equal to zero.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
ErrorsFound = .TRUE.
END IF
CBVAV(CBVAVNum)%CoolOutAirVolFlow = Numbers(4)
IF (CBVAV(CBVAVNum)%CoolOutAirVolFlow .LT. 0.0d0 .AND. CBVAV(CBVAVNum)%CoolOutAirVolFlow .NE. AutoSize) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' illegal '//TRIM(cNumericFields(4))//' = ' &
//TRIM(TrimSigDigits(Numbers(4),7)))
CALL ShowContinueError(TRIM(cNumericFields(4))//' must be greater than or equal to zero.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
ErrorsFound = .TRUE.
END IF
CBVAV(CBVAVNum)%HeatOutAirVolFlow = Numbers(5)
IF (CBVAV(CBVAVNum)%HeatOutAirVolFlow .LT. 0.0d0 .AND. CBVAV(CBVAVNum)%HeatOutAirVolFlow .NE. AutoSize) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' illegal '//TRIM(cNumericFields(5))//' = ' &
//TRIM(TrimSigDigits(Numbers(5),7)))
CALL ShowContinueError(TRIM(cNumericFields(5))//' must be greater than or equal to zero.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
ErrorsFound = .TRUE.
END IF
CBVAV(CBVAVNum)%NoCoolHeatOutAirVolFlow = Numbers(6)
IF (CBVAV(CBVAVNum)%NoCoolHeatOutAirVolFlow .LT. 0.0d0 .AND. CBVAV(CBVAVNum)%NoCoolHeatOutAirVolFlow .NE. AutoSize) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' illegal '//TRIM(cNumericFields(6))//' = ' &
//TRIM(TrimSigDigits(Numbers(6),7)))
CALL ShowContinueError(TRIM(cNumericFields(6))//' must be greater than or equal to zero.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
ErrorsFound = .TRUE.
END IF
CBVAV(CBVAVNum)%OutAirSchPtr = GetScheduleIndex(Alphas(3)) ! convert schedule name to pointer (index number)
IF (CBVAV(CBVAVNum)%OutAirSchPtr .NE. 0) THEN
IF(.NOT. CheckScheduleValueMinMax(CBVAV(CBVAVNum)%OutAirSchPtr,'<', 0.0d0, '>', 1.0d0))THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('The schedule values in '//TRIM(cAlphaFields(3))//' must be 0 to 1.')
ErrorsFound=.TRUE.
END IF
END IF
CBVAV(CBVAVNum)%AirInNode = GetOnlySingleNode(Alphas(4),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsParent)
MixerInletNodeName = Alphas(5)
SplitterOutletNodeName = Alphas(6)
CBVAV(CBVAVNum)%AirOutNode = GetOnlySingleNode(Alphas(7),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsParent)
CBVAV(CBVAVNum)%MixerInletAirNode = GetOnlySingleNode(MixerInletNodeName,ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Internal,1,ObjectIsParent)
CBVAV(CBVAVNum)%MixerInletAirNode = &
GetOnlySingleNode(MixerInletNodeName,ErrorsFound,TRIM(CurrentModuleObject),TRIM(Alphas(1)//'_Mixer'), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsParent)
CBVAV(CBVAVNum)%SplitterOutletAirNode = &
GetOnlySingleNode(SplitterOutletNodeName,ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Internal,1,ObjectIsParent)
CBVAV(CBVAVNum)%SplitterOutletAirNode = &
GetOnlySingleNode(SplitterOutletNodeName,ErrorsFound,TRIM(CurrentModuleObject),TRIM(Alphas(1)//'_Splitter'), &
NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsParent)
CBVAV(CBVAVNum)%OAMixType = Alphas(8)
CBVAV(CBVAVNum)%OAMixName = Alphas(9)
ErrFlag = .false.
CALL ValidateComponent(CBVAV(CBVAVNum)%OAMixType,CBVAV(CBVAVNum)%OAMixName,ErrFlag,TRIM(CurrentModuleObject))
IF (ErrFlag) THEN
CALL ShowContinueError('specified in '//TRIM(CurrentModuleObject)//' = "'//TRIM(CBVAV(CBVAVNum)%Name)//'".')
ErrorsFound = .TRUE.
ELSE
! Get OA Mixer node numbers
OANodeNums = GetOAMixerNodeNumbers(CBVAV(CBVAVNum)%OAMixName, ErrFlag)
IF (ErrFlag) THEN
CALL ShowContinueError('that was specified in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('..OutdoorAir:Mixer is required. Enter an OutdoorAir:Mixer object with this name.')
ErrorsFound=.true.
ELSE
CBVAV(CBVAVNum)%MixerOutsideAirNode = OANodeNums(1)
CBVAV(CBVAVNum)%MixerReliefAirNode = OANodeNums(2)
! CBVAV(CBVAVNum)%MixerInletAirNode = OANodeNums(3)
CBVAV(CBVAVNum)%MixerMixedAirNode = OANodeNums(4)
ENDIF
ENDIF
IF(CBVAV(CBVAVNum)%MixerInletAirNode .NE. OANodeNums(3))THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('Illegal '//TRIM(cAlphaFields(5))//' = '//TRIM(MixerInletNodeName)//'.')
CALL ShowContinueError(TRIM(cAlphaFields(5))//' must be the same as'// &
' the return air stream node specified in the OutdoorAir:Mixer object.')
ErrorsFound = .TRUE.
END IF
IF(CBVAV(CBVAVNum)%MixerInletAirNode .EQ. CBVAV(CBVAVNum)%AirInNode)THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('Illegal '//TRIM(cAlphaFields(5))//' = '//TRIM(MixerInletNodeName)//'.')
CALL ShowContinueError(TRIM(cAlphaFields(5))//' must be different than the '//TRIM(cAlphaFields(4))//'.')
ErrorsFound = .TRUE.
END IF
IF(CBVAV(CBVAVNum)%SplitterOutletAirNode .EQ. CBVAV(CBVAVNum)%AirOutNode)THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('Illegal '//TRIM(cAlphaFields(6))//' = '//TRIM(SplitterOutletNodeName)//'.')
CALL ShowContinueError(TRIM(cAlphaFields(6))//' must be different than the '//TRIM(cAlphaFields(7))//'.')
ErrorsFound = .TRUE.
END IF
CBVAV(CBVAVNum)%FanType = Alphas(10)
CBVAV(CBVAVNum)%FanName = Alphas(11)
IF(SameString(Alphas(12),'BlowThrough'))THEN
CBVAV(CBVAVNum)%FanPlace = BlowThru
ELSEIF(SameString(Alphas(12),'DrawThrough'))THEN
CBVAV(CBVAVNum)%FanPlace = DrawThru
ELSE
CALL ShowSevereError(TRIM(CurrentModuleObject)//' illegal '//TRIM(cAlphaFields(12))//' = '//TRIM(Alphas(12)))
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
ErrorsFound = .TRUE.
END IF
IF(CBVAV(CBVAVNum)%FanPlace == DrawThru)THEN
IF(CBVAV(CBVAVNum)%SplitterOutletAirNode .NE. &
GetFanOutletNode(CBVAV(CBVAVNum)%FanType,CBVAV(CBVAVNum)%FanName,ErrorsFound))THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('Illegal '//TRIM(cAlphaFields(6))//' = '//TRIM(SplitterOutletNodeName)//'.')
CALL ShowContinueError(TRIM(cAlphaFields(6))//' must be the same as the fan outlet node specified in ' &
//TRIM(cAlphaFields(10))//' = '//TRIM(CBVAV(CBVAVNum)%FanType)//': '// &
TRIM(CBVAV(CBVAVNum)%FanName)//' when draw through '//TRIM(cAlphaFields(11))//' is selected.')
ErrorsFound = .TRUE.
END IF
END IF
CALL GetFanType(CBVAV(CBVAVNum)%FanName,CBVAV(CBVAVNum)%FanType_Num,FanErrFlag,CurrentModuleObject,CBVAV(CBVAVNum)%Name)
IF(FanErrFlag)THEN
CALL ShowContinueError(' illegal '//TRIM(cAlphaFields(11))//'="'//TRIM(Alphas(11))//'".')
ErrorsFound = .TRUE.
FanVolFlow = 9999.0d0
ELSE
CBVAV(CBVAVNum)%FanInletNodeNum=GetFanInletNode(CBVAV(CBVAVNum)%FanType,CBVAV(CBVAVNum)%FanName,FanErrFlag)
CALL GetFanIndex(CBVAV(CBVAVNum)%FanName,FanIndex,FanErrFlag)
CALL GetFanVolFlow(FanIndex,CBVAV(CBVAVNum)%FanVolFlow)
FanVolFlow = CBVAV(CBVAVNum)%FanVolFlow
END IF
IF(FanVolFlow .NE. AutoSize)THEN
IF(FanVolFlow .LT. CBVAV(CBVAVNum)%MaxCoolAirVolFlow .AND. CBVAV(CBVAVNum)%MaxCoolAirVolFlow .NE. AutoSize)THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//' - air flow rate = '//TRIM(TrimSigDigits(FanVolFlow,7))// &
' in '//TRIM(cAlphaFields(11))//' = '//TRIM(CBVAV(CBVAVNum)%FanName)//' is less than the '// &
TRIM(cNumericFields(1)))
CALL ShowContinueError(' '//TRIM(cNumericFields(1))//' is reset to the'// &
' fan flow rate and the simulation continues.')
CALL ShowContinueError(' Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
CBVAV(CBVAVNum)%MaxCoolAirVolFlow = FanVolFlow
END IF
IF(FanVolFlow .LT. CBVAV(CBVAVNum)%MaxHeatAirVolFlow .AND. CBVAV(CBVAVNum)%MaxHeatAirVolFlow .NE. AutoSize)THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//' - air flow rate = '//TRIM(TrimSigDigits(FanVolFlow,7))// &
' in '//TRIM(cAlphaFields(11))//' = '//TRIM(CBVAV(CBVAVNum)%FanName)//' is less than the '// &
TRIM(cNumericFields(2)))
CALL ShowContinueError(' '//TRIM(cNumericFields(2))//' is reset to the'// &
' fan flow rate and the simulation continues.')
CALL ShowContinueError(' Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
CBVAV(CBVAVNum)%MaxHeatAirVolFlow = FanVolFlow
END IF
END IF
! only check that OA flow in cooling is >= SA flow in cooling when they are not autosized
IF (CBVAV(CBVAVNum)%CoolOutAirVolFlow .GT. CBVAV(CBVAVNum)%MaxCoolAirVolFlow .AND. &
CBVAV(CBVAVNum)%CoolOutAirVolFlow .NE. AutoSize .AND. CBVAV(CBVAVNum)%MaxCoolAirVolFlow .NE. AutoSize) THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//': '//TRIM(cNumericFields(4))//' cannot be greater than '// &
TRIM(cNumericFields(1)))
CALL ShowContinueError(' '//TRIM(cNumericFields(4))//' is reset to the'// &
' fan flow rate and the simulation continues.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
CBVAV(CBVAVNum)%CoolOutAirVolFlow = FanVolFlow
END IF
! only check that SA flow in heating is >= OA flow in heating when they are not autosized
IF (CBVAV(CBVAVNum)%HeatOutAirVolFlow .GT. CBVAV(CBVAVNum)%MaxHeatAirVolFlow .AND. &
CBVAV(CBVAVNum)%HeatOutAirVolFlow .NE. AutoSize .AND. CBVAV(CBVAVNum)%MaxHeatAirVolFlow .NE. AutoSize) THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//': '//TRIM(cNumericFields(5))//' cannot be greater than '// &
TRIM(cNumericFields(2)))
CALL ShowContinueError(' '//TRIM(cNumericFields(5))//' is reset to the'// &
' fan flow rate and the simulation continues.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
CBVAV(CBVAVNum)%HeatOutAirVolFlow = FanVolFlow
END IF
IF(SameString(Alphas(14),'Coil:Cooling:DX:SingleSpeed') .OR. &
SameString(Alphas(14),'CoilSystem:Cooling:DX:HeatExchangerAssisted') .OR. &
SameString(Alphas(14),'Coil:Cooling:DX:TwoStageWithHumidityControlMode')) THEN
CBVAV(CBVAVNum)%DXCoolCoilType = Alphas(14)
CBVAV(CBVAVNum)%DXCoolCoilName = Alphas(15)
IF (SameString(Alphas(14),'Coil:Cooling:DX:SingleSpeed')) THEN
CBVAV(CBVAVNum)%DXCoolCoilType_Num = CoilDX_CoolingSingleSpeed
CBVAV(CBVAVNum)%DXCoilInletNode = &
GetDXCoilInletNode(CBVAV(CBVAVNum)%DXCoolCoilType,CBVAV(CBVAVNum)%DXCoolCoilName,DXErrorsFound)
CBVAV(CBVAVNum)%DXCoilOutletNode = &
GetDXCoilOutletNode(CBVAV(CBVAVNum)%DXCoolCoilType,CBVAV(CBVAVNum)%DXCoolCoilName,DXErrorsFound)
IF(DXErrorsFound)THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('Coil:Cooling:DX:SingleSpeed "'//TRIM(CBVAV(CBVAVNum)%DXCoolCoilName)//'" not found.')
ErrorsFound = .TRUE.
ELSE
DXCoilErrFlag=.false.
CALL GetDXCoolCoilIndex(CBVAV(CBVAVNum)%DXCoolCoilName,CBVAV(CBVAVNum)%DXCoolCoilIndexNum, &
DXCoilErrFlag, CBVAV(CBVAVNum)%DXCoolCoilType)
IF(DXCoilErrFlag)CALL ShowContinueError('...occurs in '//TRIM(CBVAV(CBVAVNum)%UnitType)// &
' "'//TRIM(CBVAV(CBVAVNum)%Name)//'"')
! Mine outdoor condenser node from DX coil object
OANodeErrFlag = .FALSE.
CBVAV(CBVAVNum)%CondenserNodeNum = &
GetDXCoilCondenserInletNode(CBVAV(CBVAVNum)%DXCoolCoilType,CBVAV(CBVAVNum)%DXCoolCoilName,OANodeErrFlag)
IF(OANodeErrFlag)CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
END IF
ELSEIF (SameString(Alphas(14),'CoilSystem:Cooling:DX:HeatExchangerAssisted')) THEN
CBVAV(CBVAVNum)%DXCoolCoilType_Num = CoilDX_CoolingHXAssisted
HXDXCoolCoilName = GetHXDXCoilName(CBVAV(CBVAVNum)%DXCoolCoilType,CBVAV(CBVAVNum)%DXCoolCoilName,DXErrorsFound)
CBVAV(CBVAVNum)%DXCoilInletNode = &
GetHXDXCoilInletNode(CBVAV(CBVAVNum)%DXCoolCoilType,CBVAV(CBVAVNum)%DXCoolCoilName,DXErrorsFound)
CBVAV(CBVAVNum)%DXCoilOutletNode = &
GetHXDXCoilOutletNode(CBVAV(CBVAVNum)%DXCoolCoilType,CBVAV(CBVAVNum)%DXCoolCoilName,DXErrorsFound)
IF(DXErrorsFound)THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('CoilSystem:Cooling:DX:HeatExchangerAssisted "'//TRIM(CBVAV(CBVAVNum)%DXCoolCoilName)// &
'" not found.')
ErrorsFound = .TRUE.
ELSE
DXCoilErrFlag=.false.
CALL GetDXCoolCoilIndex( &
GetHXDXCoilName(CBVAV(CBVAVNum)%DXCoolCoilType,CBVAV(CBVAVNum)%DXCoolCoilName,DXCoilErrFlag), &
CBVAV(CBVAVNum)%DXCoolCoilIndexNum, DXCoilErrFlag, 'Coil:Cooling:DX:SingleSpeed')
IF(DXCoilErrFlag)CALL ShowContinueError('...occurs in '//TRIM(CBVAV(CBVAVNum)%UnitType)// &
' "'//TRIM(CBVAV(CBVAVNum)%Name)//'"')
! Mine outdoor condenser node from DX coil through HXAssistedDXCoil object
OANodeErrFlag = .FALSE.
CBVAV(CBVAVNum)%CondenserNodeNum = &
GetDXCoilCondenserInletNode('Coil:Cooling:DX:SingleSpeed', HXDXCoolCoilName, OANodeErrFlag)
IF(OANodeErrFlag)CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
END IF
ELSEIF (SameString(Alphas(14),'Coil:Cooling:DX:TwoStageWithHumidityControlMode')) THEN
CBVAV(CBVAVNum)%DXCoolCoilType_Num = CoilDX_CoolingTwoStageWHumControl
CBVAV(CBVAVNum)%DXCoilInletNode = &
GetDXCoilInletNode(CBVAV(CBVAVNum)%DXCoolCoilType,CBVAV(CBVAVNum)%DXCoolCoilName,DXErrorsFound)
CBVAV(CBVAVNum)%DXCoilOutletNode = &
GetDXCoilOutletNode(CBVAV(CBVAVNum)%DXCoolCoilType,CBVAV(CBVAVNum)%DXCoolCoilName,DXErrorsFound)
IF(DXErrorsFound)THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('Coil:Cooling:DX:TwoStageWithHumidityControlMode "'//TRIM(CBVAV(CBVAVNum)%DXCoolCoilName)// &
'" not found.')
ErrorsFound = .TRUE.
ELSE
DXCoilErrFlag=.false.
CALL GetDXCoolCoilIndex(CBVAV(CBVAVNum)%DXCoolCoilName,CBVAV(CBVAVNum)%DXCoolCoilIndexNum, &
DXCoilErrFlag, CBVAV(CBVAVNum)%DXCoolCoilType)
IF(DXCoilErrFlag)CALL ShowContinueError('...occurs in '//TRIM(CBVAV(CBVAVNum)%UnitType)// &
' "'//TRIM(CBVAV(CBVAVNum)%Name)//'"')
! Mine outdoor condenser node from multimode DX coil object
OANodeErrFlag = .FALSE.
CBVAV(CBVAVNum)%CondenserNodeNum = &
GetDXCoilCondenserInletNode(CBVAV(CBVAVNum)%DXCoolCoilType,CBVAV(CBVAVNum)%DXCoolCoilName,OANodeErrFlag)
IF(OANodeErrFlag)CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
END IF
END IF
ELSE
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('Illegal '//TRIM(cAlphaFields(14))//' = '//TRIM(Alphas(14)))
ErrorsFound = .TRUE.
END IF
CBVAV(CBVAVNum)%FanOpModeSchedPtr = GetScheduleIndex(Alphas(13)) ! convert schedule name to pointer (index number)
IF (CBVAV(CBVAVNum)%FanOpModeSchedPtr .NE. 0) THEN
IF(.NOT. CheckScheduleValueMinMax(CBVAV(CBVAVNum)%FanOpModeSchedPtr, '<', 0.0d0, '>', 1.0d0))THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('The schedule values in '//TRIM(cAlphaFields(13))//' must be 0 to 1.')
CALL ShowContinueError('A value of 0 represents cycling fan mode, any other value up to 1 represents constant fan mode.')
ErrorsFound=.TRUE.
END IF
! Check supply air fan operating mode for cycling fan, if NOT cycling fan set AirFlowControl
IF(.NOT. CheckScheduleValueMinMax(CBVAV(CBVAVNum)%FanOpModeSchedPtr,'>=',0.0d0,'<=',0.0d0))THEN !Objexx Range is 0 to 0?
! set air flow control mode,
! UseCompressorOnFlow = operate at last cooling or heating air flow requested when compressor is off
! UseCompressorOffFlow = operate at value specified by user (no input for this object type, UseCompONFlow)
! AirFlowControl only valid if fan opmode = ContFanCycCoil
IF (CBVAV(CBVAVNum)%MaxNoCoolHeatAirVolFlow .EQ. 0.0d0) THEN
CBVAV(CBVAVNum)%AirFlowControl = UseCompressorOnFlow
ELSE
CBVAV(CBVAVNum)%AirFlowControl = UseCompressorOffFlow
END IF
END IF
ELSE
IF(.NOT. lAlphaBlanks(13))THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError(TRIM(cAlphaFields(13))//' = '//TRIM(Alphas(13))// &
' not found. Supply air fan operating mode set to constant operation and simulation continues.')
END IF
CBVAV(CBVAVNum)%OpMode = ContFanCycCoil
IF (CBVAV(CBVAVNum)%MaxNoCoolHeatAirVolFlow .EQ. 0.0d0) THEN
CBVAV(CBVAVNum)%AirFlowControl = UseCompressorOnFlow
ELSE
CBVAV(CBVAVNum)%AirFlowControl = UseCompressorOffFlow
END IF
END IF
! Check FanVolFlow, must be >= CBVAV flow
IF(FanVolFlow .NE. AutoSize)THEN
IF(FanVolFlow .LT. CBVAV(CBVAVNum)%MaxNoCoolHeatAirVolFlow .AND. CBVAV(CBVAVNum)%MaxNoCoolHeatAirVolFlow .NE. AutoSize &
.AND. CBVAV(CBVAVNum)%MaxNoCoolHeatAirVolFlow .NE. 0.0d0)THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//' - air flow rate = '//TRIM(TrimSigDigits(FanVolFlow,7))// &
' in '//TRIM(cAlphaFields(11))//' = '//TRIM(CBVAV(CBVAVNum)%FanName)//' is less than '// &
TRIM(cNumericFields(3)))
CALL ShowContinueError(' '//TRIM(cNumericFields(3))//' is reset to the'// &
' fan flow rate and the simulation continues.')
CALL ShowContinueError(' Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
CBVAV(CBVAVNum)%MaxNoCoolHeatAirVolFlow = FanVolFlow
END IF
END IF
! only check that OA flow when compressor is OFF is >= SA flow when compressor is OFF when both are not autosized and
! that MaxNoCoolHeatAirVolFlow is /= 0 (trigger to use compressor ON flow, see AirFlowControl variable initialization above)
IF (CBVAV(CBVAVNum)%NoCoolHeatOutAirVolFlow .GT. CBVAV(CBVAVNum)%MaxNoCoolHeatAirVolFlow .AND. &
CBVAV(CBVAVNum)%NoCoolHeatOutAirVolFlow .NE. AutoSize .AND. CBVAV(CBVAVNum)%MaxNoCoolHeatAirVolFlow .NE. AutoSize .AND. &
CBVAV(CBVAVNum)%MaxNoCoolHeatAirVolFlow .NE. 0.0d0) THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//': '//TRIM(cNumericFields(6))//' cannot be greater than '// &
TRIM(cNumericFields(3)))
CALL ShowContinueError(' '//TRIM(cNumericFields(6))//' is reset to'// &
' the fan flow rate and the simulation continues.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
CBVAV(CBVAVNum)%NoCoolHeatOutAirVolFlow = FanVolFlow
END IF
IF(SameString(Alphas(16),'Coil:Heating:DX:SingleSpeed') .OR. &
SameString(Alphas(16),'Coil:Heating:Gas') .OR. &
SameString(Alphas(16),'Coil:Heating:Electric').OR. &
SameString(Alphas(16),'Coil:Heating:Water').OR. &
SameString(Alphas(16),'Coil:Heating:Steam')) THEN
CBVAV(CBVAVNum)%HeatCoilType = Alphas(16)
CBVAV(CBVAVNum)%HeatCoilName = Alphas(17)
IF (SameString(Alphas(16),'Coil:Heating:DX:SingleSpeed')) THEN
CBVAV(CBVAVNum)%HeatCoilType_Num = CoilDX_HeatingEmpirical
CBVAV(CBVAVNum)%MinOATCompressor = &
GetMinOATDXCoilCompressor(CBVAV(CBVAVNum)%HeatCoilType,CBVAV(CBVAVNum)%HeatCoilName,ErrorsFound)
CBVAV(CBVAVNum)%HeatingCoilInletNode = &
GetDXCoilInletNode(CBVAV(CBVAVNum)%HeatCoilType,CBVAV(CBVAVNum)%HeatCoilName,ErrorsFound)
CBVAV(CBVAVNum)%HeatingCoilOutletNode = &
GetDXCoilOutletNode(CBVAV(CBVAVNum)%HeatCoilType,CBVAV(CBVAVNum)%HeatCoilName,ErrorsFound)
CALL GetDXCoolCoilIndex(CBVAV(CBVAVNum)%HeatCoilName,CBVAV(CBVAVNum)%DXHeatCoilIndexNum, &
DXCoilErrFlag, CBVAV(CBVAVNum)%HeatCoilType)
IF(DXCoilErrFlag)CALL ShowContinueError('...occurs in '//TRIM(CBVAV(CBVAVNum)%UnitType)// &
' "'//TRIM(CBVAV(CBVAVNum)%Name)//'"')
ELSEIF (SameString(Alphas(16),'Coil:Heating:Gas')) THEN
CBVAV(CBVAVNum)%HeatCoilType_Num = Coil_HeatingGas
CBVAV(CBVAVNum)%MinOATCompressor = -999.9d0
CBVAV(CBVAVNum)%HeatingCoilInletNode = &
GetCoilInletNode(CBVAV(CBVAVNum)%HeatCoilType,CBVAV(CBVAVNum)%HeatCoilName,ErrorsFound)
CBVAV(CBVAVNum)%HeatingCoilOutletNode = &
GetCoilOutletNode(CBVAV(CBVAVNum)%HeatCoilType,CBVAV(CBVAVNum)%HeatCoilName,ErrorsFound)
ELSEIF (SameString(Alphas(16),'Coil:Heating:Electric')) THEN
CBVAV(CBVAVNum)%HeatCoilType_Num = Coil_HeatingElectric
CBVAV(CBVAVNum)%MinOATCompressor = -999.9d0
CBVAV(CBVAVNum)%HeatingCoilInletNode = &
GetCoilInletNode(CBVAV(CBVAVNum)%HeatCoilType,CBVAV(CBVAVNum)%HeatCoilName,ErrorsFound)
CBVAV(CBVAVNum)%HeatingCoilOutletNode = &
GetCoilOutletNode(CBVAV(CBVAVNum)%HeatCoilType,CBVAV(CBVAVNum)%HeatCoilName,ErrorsFound)
ELSEIF (SameString(Alphas(16),'Coil:Heating:Water')) THEN
CBVAV(CBVAVNum)%HeatCoilType_Num = Coil_HeatingWater
ErrFlag = .FALSE.
CBVAV(CBVAVNum)%CoilControlNode = GetCoilWaterInletNode('Coil:Heating:Water', &
CBVAV(CBVAVNum)%HeatCoilName,ErrFlag)
CBVAV(CBVAVNum)%MaxHeatCoilFluidFlow = GetCoilMaxWaterFlowRate('Coil:Heating:Water', &
CBVAV(CBVAVNum)%HeatCoilName,ErrFlag)
HeatCoilInletNodeNum = GetWaterCoilInletNode('Coil:Heating:Water', &
CBVAV(CBVAVNum)%HeatCoilName,ErrFlag)
CBVAV(CBVAVNum)%HeatingCoilInletNode = HeatCoilInletNodeNum
HeatCoilOutletNodeNum = GetWaterCoilOutletNode('Coil:Heating:Water', &
CBVAV(CBVAVNum)%HeatCoilName,ErrFlag)
CBVAV(CBVAVNum)%HeatingCoilOutletNode = HeatCoilOutletNodeNum
IF(ErrFlag)THEN
CALL ShowContinueError('...occurs in '//TRIM(CBVAV(CBVAVNum)%UnitType)// &
' "'//TRIM(CBVAV(CBVAVNum)%Name)//'"')
ErrorsFound = .TRUE.
END IF
ELSEIF (SameString(Alphas(16),'COIL:HEATING:STEAM')) THEN
CBVAV(CBVAVNum)%HeatCoilType_Num = Coil_HeatingSteam
ErrFlag = .FALSE.
CBVAV(CBVAVNum)%HeatCoilIndex = GetSTeamCoilIndex('COIL:HEATING:STEAM',CBVAV(CBVAVNum)%HeatCoilName,ErrFlag)
HeatCoilInletNodeNum = GetSteamCoilAirInletNode(CBVAV(CBVAVNum)%HeatCoilIndex, &
CBVAV(CBVAVNum)%HeatCoilName,ErrFlag)
CBVAV(CBVAVNum)%HeatingCoilInletNode = HeatCoilInletNodeNum
CBVAV(CBVAVNum)%CoilControlNode = GetSteamCoilSteamInletNode(CBVAV(CBVAVNum)%HeatCoilIndex, &
CBVAV(CBVAVNum)%HeatCoilName, ErrFlag)
CBVAV(CBVAVNum)%MaxHeatCoilFluidFlow = GetCoilMaxSteamFlowRate(CBVAV(CBVAVNum)%HeatCoilIndex,ErrFlag)
SteamIndex = 0 ! Function GetSatDensityRefrig will look up steam index if 0 is passed
SteamDensity=GetSatDensityRefrig("STEAM",TempSteamIn,1.0d0,SteamIndex,'GetUnitaryHeatCool:VAVChangeoverBypass')
IF(CBVAV(CBVAVNum)%MaxHeatCoilFluidFlow .GT. 0.0d0)THEN
CBVAV(CBVAVNum)%MaxHeatCoilFluidFlow = &
GetCoilMaxSteamFlowRate(CBVAV(CBVAVNum)%HeatCoilIndex,ErrFlag) * SteamDensity
END IF
HeatCoilOutletNodeNum = GetSteamCoilAirOutletNode(CBVAV(CBVAVNum)%HeatCoilIndex,CBVAV(CBVAVNum)%HeatCoilName,ErrFlag)
CBVAV(CBVAVNum)%HeatingCoilOutletNode = HeatCoilOutletNodeNum
IF(ErrFlag)THEN
CALL ShowContinueError('...occurs in '//TRIM(CBVAV(CBVAVNum)%UnitType)// &
' "'//TRIM(CBVAV(CBVAVNum)%Name)//'"')
ErrorsFound = .TRUE.
END IF
END IF
ELSE
CALL ShowSevereError(TRIM(CurrentModuleObject)//' illegal '//TRIM(cAlphaFields(16))//' = '//TRIM(Alphas(16)))
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
ErrorsFound = .TRUE.
END IF
IF(CBVAV(CBVAVNum)%DXCoilOutletNode .NE. CBVAV(CBVAVNum)%HeatingCoilInletNode)THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' illegal coil placement. Cooling coil must be upstream of heating coil.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
ErrorsFound = .TRUE.
END IF
IF(CBVAV(CBVAVNum)%FanPlace == BlowThru) THEN
IF(CBVAV(CBVAVNum)%SplitterOutletAirNode .NE. CBVAV(CBVAVNum)%HeatingCoilOutletNode)THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('Illegal '//TRIM(cAlphaFields(6))//' = '//TRIM(SplitterOutletNodeName)//'.')
CALL ShowContinueError(TRIM(cAlphaFields(6))//' must be the same as the outlet node specified'// &
' in the heating coil object = '//TRIM(CBVAV(CBVAVNum)%HeatCoilType)//': '// &
TRIM(CBVAV(CBVAVNum)%HeatCoilName)//' when blow through '//TRIM(cAlphaFields(12))//' is selected.')
ErrorsFound = .TRUE.
END IF
IF(CBVAV(CBVAVNum)%MixerMixedAirNode .NE. CBVAV(CBVAVNum)%FanInletNodeNum)THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('Illegal '//TRIM(cAlphaFields(11))//'. The fan inlet node name must be the same as the mixed'// &
' air node specified in the '//TRIM(cAlphaFields(9))//' = '//TRIM(CBVAV(CBVAVNum)%OAMixName)// &
' when blow through '//TRIM(cAlphaFields(12))//' is selected.')
ErrorsFound = .TRUE.
END IF
END IF
IF(CBVAV(CBVAVNum)%FanPlace == DrawThru) THEN
IF(CBVAV(CBVAVNum)%MixerMixedAirNode .NE. CBVAV(CBVAVNum)%DXCoilInletNode)THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//': '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('Illegal cooling coil placement. The cooling coil inlet node name must be the same as the mixed' &
//' air node specified in the '//TRIM(cAlphaFields(9))//' = '//TRIM(CBVAV(CBVAVNum)%OAMixName) &
//' when draw through '//TRIM(cAlphaFields(12))//' is selected.')
ErrorsFound = .TRUE.
END IF
END IF
IF(SameString(Alphas(18),'CoolingPriority'))THEN
CBVAV(CBVAVNum)%PriorityControl = CoolingPriority
ELSEIF(SameString(Alphas(18),'HeatingPriority'))THEN
CBVAV(CBVAVNum)%PriorityControl = HeatingPriority
ELSEIF(SameString(Alphas(18),'ZonePriority'))THEN
CBVAV(CBVAVNum)%PriorityControl = ZonePriority
ELSE
CALL ShowSevereError(TRIM(CurrentModuleObject)//' illegal '//TRIM(cAlphaFields(18))//' = '//TRIM(Alphas(18)))
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError('Valid choices are CoolingPriority, HeatingPriority, or ZonePriority.')
ErrorsFound = .TRUE.
END IF
IF(Numbers(7) .GT. 0.0d0)THEN
CBVAV(CBVAVNum)%MinLATCooling = Numbers(7)
ELSE
CBVAV(CBVAVNum)%MinLATCooling = 10.0d0
END IF
IF(Numbers(8) .GT. 0.0d0)THEN
CBVAV(CBVAVNum)%MaxLATHeating = Numbers(8)
ELSE
CBVAV(CBVAVNum)%MaxLATHeating = 50.0d0
END IF
IF (CBVAV(CBVAVNum)%MinLATCooling .GT. CBVAV(CBVAVNum)%MaxLATHeating) THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//': illegal leaving air temperature specified.')
CALL ShowContinueError('Resetting '//TRIM(cNumericFields(7))//' equal to '// &
TRIM(cNumericFields(8))//' and the simulation continues.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
CBVAV(CBVAVNum)%MinLATCooling = CBVAV(CBVAVNum)%MaxLATHeating
END IF
! Dehumidification control mode
IF (SameString(Alphas(19),'None')) THEN
CBVAV(CBVAVNum)%DehumidControlType=DehumidControl_None
ELSEIF (SameString(Alphas(19),' ')) THEN
CBVAV(CBVAVNum)%DehumidControlType=DehumidControl_None
ELSEIF (SameString(Alphas(19),'Multimode')) THEN
IF (CBVAV(CBVAVNum)%DXCoolCoilType_Num == CoilDX_CoolingTwoStageWHumControl) THEN
CBVAV(CBVAVNum)%DehumidControlType=DehumidControl_Multimode
ELSE
CALL ShowWarningError('Invalid '//TRIM(cAlphaFields(19))//' = '//TRIM(Alphas(19)))
CALL ShowContinueError('In '//TRIM(CurrentModuleObject)//' "'//TRIM(CBVAV(CBVAVNum)%Name)//'".')
CALL ShowContinueError('Valid only with '//TRIM(cAlphaFields(14))//' = Coil:Cooling:DX:TwoStageWithHumidityControlMode.')
CALL ShowContinueError('Setting '//TRIM(cAlphaFields(19))//' to "None" and the simulation continues.')
CBVAV(CBVAVNum)%DehumidControlType=DehumidControl_None
END IF
ELSEIF (SameString(Alphas(19),'CoolReheat')) THEN
IF (CBVAV(CBVAVNum)%DXCoolCoilType_Num == CoilDX_CoolingTwoStageWHumControl) THEN
CBVAV(CBVAVNum)%DehumidControlType=DehumidControl_CoolReheat
ELSE
CALL ShowWarningError('Invalid '//TRIM(cAlphaFields(19))//' = '//TRIM(Alphas(19)))
CALL ShowContinueError('In '//TRIM(CurrentModuleObject)//' "'//TRIM(CBVAV(CBVAVNum)%Name)//'".')
CALL ShowContinueError('Valid only with '//TRIM(cAlphaFields(14))//' = Coil:Cooling:DX:TwoStageWithHumidityControlMode.')
CALL ShowContinueError('Setting '//TRIM(cAlphaFields(19))//' to "None" and the simulation continues.')
CBVAV(CBVAVNum)%DehumidControlType=DehumidControl_None
END IF
ELSE
CALL ShowSevereError('Invalid '//TRIM(cAlphaFields(19))//' ='//TRIM(Alphas(19)))
CALL ShowContinueError('In '//TRIM(CurrentModuleObject)//' "'//TRIM(CBVAV(CBVAVNum)%Name)//'".')
END IF
IF (CBVAV(CBVAVNum)%DXCoolCoilType_Num .GT. 0)THEN
ControlNodeNum = GetOnlySingleNode(Alphas(7),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Sensor,1,ObjectIsParent)
END IF
! Initialize last mode of compressor operation
CBVAV(CBVAVNum)%LastMode = HeatingMode
IF(CBVAV(CBVAVNum)%FanType_Num .NE. FanType_SimpleOnOff .AND. CBVAV(CBVAVNum)%FanType_Num .NE. FanType_SimpleConstVolume)THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' illegal '//TRIM(cAlphaFields(10))//' in fan object = '// &
TRIM(CBVAV(CBVAVNum)%FanName))
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError(' The fan object type must be Fan:OnOff or Fan:ConstantVolume.')
ErrorsFound = .TRUE.
ELSE IF(CBVAV(CBVAVNum)%FanType_Num == FanType_SimpleOnOff .OR. CBVAV(CBVAVNum)%FanType_Num == FanType_SimpleConstVolume)THEN
IF(CBVAV(CBVAVNum)%FanType_Num.EQ.FanType_SimpleOnOff .AND. &
.NOT. SameString(CBVAV(CBVAVNum)%FanType,'Fan:OnOff'))THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//' has '//TRIM(cAlphaFields(10))//' = '// &
TRIM(CBVAV(CBVAVNum)%FanType)//' which is inconsistent with the fan object.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError(' The fan object ('//TRIM(CBVAV(CBVAVNum)%FanName)// &
') is actually a valid fan type and the simulation continues.')
CALL ShowContinueError(' Node connections errors may result due to the inconsistent fan type.')
END IF
IF(CBVAV(CBVAVNum)%FanType_Num.EQ.FanType_SimpleConstVolume .AND. &
.NOT. SameString(CBVAV(CBVAVNum)%FanType,'Fan:ConstantVolume'))THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//' has '//TRIM(cAlphaFields(10))//' = '// &
TRIM(CBVAV(CBVAVNum)%FanType)//' which is inconsistent with fan object.')
CALL ShowContinueError('Occurs in '//TRIM(CurrentModuleObject)//' = '//TRIM(CBVAV(CBVAVNum)%Name))
CALL ShowContinueError(' The fan object ('//TRIM(CBVAV(CBVAVNum)%FanName)// &
') is actually a valid fan type and the simulation continues.')
CALL ShowContinueError(' Node connections errors may result due to the inconsistent fan type.')
END IF
END IF
! Add fan to component sets array
IF (CBVAV(CBVAVNum)%FanPlace == BlowThru) THEN
CompSetFanInlet = NodeID(CBVAV(CBVAVNum)%MixerMixedAirNode)
CompSetFanOutlet = NodeID(CBVAV(CBVAVNum)%DXCoilInletNode)
ELSE
CompSetFanInlet = NodeID(CBVAV(CBVAVNum)%HeatingCoilOutletNode)
CompSetFanOutlet = SplitterOutletNodeName
END IF
CompSetCoolInlet = NodeID(CBVAV(CBVAVNum)%DXCoilInletNode)
CompSetCoolOutlet = NodeID(CBVAV(CBVAVNum)%DXCoilOutletNode)
! Add fan to component sets array
CALL SetUpCompSets(CBVAV(CBVAVNum)%UnitType, CBVAV(CBVAVNum)%Name, &
CBVAV(CBVAVNum)%FanType,CBVAV(CBVAVNum)%FanName,CompSetFanInlet,CompSetFanOutlet)
! Add cooling coil to component sets array
CALL SetUpCompSets(CBVAV(CBVAVNum)%UnitType, CBVAV(CBVAVNum)%Name, &
CBVAV(CBVAVNum)%DXCoolCoilType,CBVAV(CBVAVNum)%DXCoolCoilName,CompSetCoolInlet,CompSetCoolOutlet)
! Add heating coil to component sets array
CALL SetUpCompSets(CBVAV(CBVAVNum)%UnitType, CBVAV(CBVAVNum)%Name, &
CBVAV(CBVAVNum)%HeatCoilType,CBVAV(CBVAVNum)%HeatCoilName,NodeID(CBVAV(CBVAVNum)%HeatingCoilInletNode), &
NodeID(CBVAV(CBVAVNum)%HeatingCoilOutletNode))
! Set up component set for OA mixer - use OA node and Mixed air node
CALL SetUpCompSets(CBVAV(CBVAVNum)%UnitType, CBVAV(CBVAVNum)%Name, &
CBVAV(CBVAVNum)%OAMixType,CBVAV(CBVAVNum)%OAMixName,NodeID(CBVAV(CBVAVNum)%MixerOutsideAirNode), &
NodeID(CBVAV(CBVAVNum)%MixerMixedAirNode))
CALL TestCompSet(CBVAV(CBVAVNum)%UnitType,CBVAV(CBVAVNum)%Name,NodeID(CBVAV(CBVAVNum)%AirInNode), &
NodeID(CBVAV(CBVAVNum)%AirOutNode),'Air Nodes')
! Find air loop associated with CBVAV system
DO AirLoopNum = 1, NumPrimaryAirSys
DO BranchNum = 1, PrimaryAirSystem(AirLoopNum)%NumBranches
DO CompNum = 1, PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%TotalComponents
IF(.NOT. SameString(PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%Name, &
CBVAV(CBVAVNum)%Name) .OR. &
.NOT. SameString(PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%TypeOf, &
CBVAV(CBVAVNum)%UnitType))CYCLE
CBVAV(CBVAVNum)%AirLoopNumber = AirLoopNum
! Should EXIT here or do other checking?
EXIT
END DO
END DO
END DO
IF(CBVAV(CBVAVNum)%AirLoopNumber .GT. 0)THEN
CBVAV(CBVAVNum)%NumControlledZones = AirToZoneNodeInfo(CBVAV(CBVAVNum)%AirLoopNumber)%NumZonesCooled
ALLOCATE (CBVAV(CBVAVNum)%ControlledZoneNum(CBVAV(CBVAVNum)%NumControlledZones))
ALLOCATE (CBVAV(CBVAVNum)%ActualZoneNum(CBVAV(CBVAVNum)%NumControlledZones))
ALLOCATE (CBVAV(CBVAVNum)%ActualZoneNodeNum(CBVAV(CBVAVNum)%NumControlledZones))
ALLOCATE (CBVAV(CBVAVNum)%CBVAVBoxOutletNode(CBVAV(CBVAVNum)%NumControlledZones))
ALLOCATE (CBVAV(CBVAVNum)%ZoneSequenceCoolingNum(CBVAV(CBVAVNum)%NumControlledZones))
ALLOCATE (CBVAV(CBVAVNum)%ZoneSequenceHeatingNum(CBVAV(CBVAVNum)%NumControlledZones))
CBVAV(CBVAVNum)%ControlledZoneNum = 0
CBVAV(CBVAVNum)%ActualZoneNum = 0
DO AirLoopZoneNum = 1, AirToZoneNodeInfo(CBVAV(CBVAVNum)%AirLoopNumber)%NumZonesCooled
CBVAV(CBVAVNum)%ControlledZoneNum(AirLoopZoneNum) = &
AirToZoneNodeInfo(CBVAV(CBVAVNum)%AirLoopNumber)%CoolCtrlZoneNums(AirLoopZoneNum)
IF(CBVAV(CBVAVNum)%ControlledZoneNum(AirLoopZoneNum) .GT. 0)THEN
CBVAV(CBVAVNum)%ActualZoneNodeNum(AirLoopZoneNum) = &
ZoneEquipConfig(CBVAV(CBVAVNum)%ControlledZoneNum(AirLoopZoneNum))%ZoneNode
CBVAV(CBVAVNum)%ActualZoneNum(AirLoopZoneNum) = &
ZoneEquipConfig(CBVAV(CBVAVNum)%ControlledZoneNum(AirLoopZoneNum))%ActualZoneNum
CBVAV(CBVAVNum)%CBVAVBoxOutletNode(AirLoopZoneNum) = &
AirToZoneNodeInfo(CBVAV(CBVAVNum)%AirLoopNumber)%CoolZoneInletNodes(AirLoopZoneNum)
! check for thermostat in controlled zone
FoundTstatZone = .FALSE.
DO TstatZoneNum = 1, NumTempControlledZones
IF(TempControlledZone(TstatZoneNum)%ActualZoneNum .NE. CBVAV(CBVAVNum)%ControlledZoneNum(AirLoopZoneNum))CYCLE
FoundTstatZone = .TRUE.
END DO
IF(.NOT. FoundTstatZone)THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//' "'//TRIM(CBVAV(CBVAVNum)%Name)//'"')
CALL ShowContinueError('Thermostat not found in zone = ' &
//TRIM(ZoneEquipConfig(CBVAV(CBVAVNum)%ControlledZoneNum(AirLoopZoneNum))%ZoneName)// &
' and the simulation continues.')
CALL ShowContinueError('This zone will not be controlled to a temperature setpoint.')
END IF
ELSE
CALL ShowSevereError('Controlled Zone node not found.')
ErrorsFound = .TRUE.
END IF
IF (ZoneEquipConfig(CBVAV(CBVAVNum)%ActualZoneNum(AirLoopZoneNum))%EquipListIndex > 0) THEN
DO EquipNum = 1, ZoneEquipList(ZoneEquipConfig(CBVAV(CBVAVNum)%ActualZoneNum(AirLoopZoneNum))%EquipListIndex) &
%NumOfEquipTypes
IF ((ZoneEquipList(ZoneEquipConfig(CBVAV(CBVAVNum)%ActualZoneNum(AirLoopZoneNum))%EquipListIndex)% &
EquipType_Num(EquipNum) == AirDistUnit_Num) &
.OR. (ZoneEquipList(ZoneEquipConfig(CBVAV(CBVAVNum)%ActualZoneNum(AirLoopZoneNum))%EquipListIndex)% &
EquipType_Num(EquipNum) == DirectAir_Num) ) THEN
CBVAV(CBVAVNum)%ZoneSequenceCoolingNum(AirLoopZoneNum) = &
ZoneEquipList(ZoneEquipConfig(CBVAV(CBVAVNum)%ActualZoneNum(AirLoopZoneNum))% &
EquipListIndex)%CoolingPriority(EquipNum)
CBVAV(CBVAVNum)%ZoneSequenceHeatingNum(AirLoopZoneNum) = &
ZoneEquipList(ZoneEquipConfig(CBVAV(CBVAVNum)%ActualZoneNum(AirLoopZoneNum))% &
EquipListIndex)%HeatingPriority(EquipNum)
ENDIF
ENDDO
ENDIF
END DO
ELSE
END IF
END DO ! CBVAVIndex = 1,NumCBVAV
IF (ErrorsFound) THEN
CALL ShowFatalError('GetCBVAV: Errors found in getting '//TRIM(CurrentModuleObject)//' input.')
CALL ShowContinueError('... Preceding condition causes termination.')
END IF
DO CBVAVNum=1,NumCBVAV
! Setup Report variables for the Fan Coils
CALL SetupOutputVariable('Unitary System Total Heating Rate [W]',CBVAV(CBVAVNum)%TotHeatEnergyRate,&
'System','Average',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Total Heating Energy [J]',CBVAV(CBVAVNum)%TotHeatEnergy,&
'System','Sum',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Total Cooling Rate [W]',CBVAV(CBVAVNum)%TotCoolEnergyRate,&
'System','Average',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Total Cooling Energy [J]',CBVAV(CBVAVNum)%TotCoolEnergy,&
'System','Sum',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Sensible Heating Rate [W]',CBVAV(CBVAVNum)%SensHeatEnergyRate,&
'System','Average',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Sensible Heating Energy [J]',CBVAV(CBVAVNum)%SensHeatEnergy,&
'System','Sum',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Sensible Cooling Rate [W]',CBVAV(CBVAVNum)%SensCoolEnergyRate,&
'System','Average',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Sensible Cooling Energy [J]',CBVAV(CBVAVNum)%SensCoolEnergy,&
'System','Sum',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Latent Heating Rate [W]',CBVAV(CBVAVNum)%LatHeatEnergyRate,&
'System','Average',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Latent Heating Energy [J]',CBVAV(CBVAVNum)%LatHeatEnergy,&
'System','Sum',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Latent Cooling Rate [W]',CBVAV(CBVAVNum)%LatCoolEnergyRate,&
'System','Average',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Latent Cooling Energy [J]',CBVAV(CBVAVNum)%LatCoolEnergy,&
'System','Sum',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Electric Power [W]',CBVAV(CBVAVNum)%ElecPower,&
'System','Average',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Electric Energy [J]',CBVAV(CBVAVNum)%ElecConsumption,&
'System','Sum',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Fan Part Load Ratio []',CBVAV(CBVAVNum)%FanPartLoadRatio,&
'System','Average',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Compressor Part Load Ratio []',CBVAV(CBVAVNum)%CompPartLoadRatio,&
'System','Average',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Bypass Air Mass Flow Rate [kg/s]',CBVAV(CBVAVNum)%BypassMassFlowRate,&
'System','Average',CBVAV(CBVAVNum)%Name)
CALL SetupOutputVariable('Unitary System Air Outlet Setpoint Temperature [C]',CBVAV(CBVAVNum)%OutletTempSetpoint,&
'System','Average',CBVAV(CBVAVNum)%Name)
END DO
RETURN
END SUBROUTINE GetCBVAV