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 GetFanCoilUnits
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN March 2000
! MODIFIED Bereket Nigusse, FSEC, April 2011: eliminated input node names
! added OA Mixer object type
! and fan object type
! Chandan Sharma, FSEC, July 2012: Added zone sys avail managers
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Obtains input data for fan coil units and stores it in fan coil data structures
! METHODOLOGY EMPLOYED:
! Uses "Get" routines to read in data.
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: GetNumObjectsFound, GetObjectItem, VerifyName, SameString, GetObjectDefMaxArgs, FindItemInList
USE NodeInputManager, ONLY: GetOnlySingleNode
USE BranchNodeConnections, ONLY: TestCompSet, SetUpCompSets
USE Fans, ONLY: GetFanDesignVolumeFlowRate, GetFanType
USE General, ONLY: TrimSigDigits
USE DataIPShortCuts
USE WaterCoils, ONLY: GetCoilWaterInletNode
USE HVACHXAssistedCoolingCoil, ONLY: GetHXCoilWaterInletNode=>GetCoilWaterInletNode,GetHXCoilTypeAndName
USE DataHvacGlobals, ONLY: FanType_SimpleConstVolume, FanType_SimpleVAV, FanType_SimpleOnOff, ZoneComp
USE DataPlant, ONLY: TypeOf_CoilWaterSimpleHeating, TypeOf_CoilWaterDetailedFlatCooling, &
TypeOf_CoilWaterCooling
USE MixedAir, ONLY: GetOAMixerIndex, GetOAMixerNodeNumbers
USE DataZoneEquipment, ONLY: ZoneEquipConfig, FanCoil4Pipe_Num
USE DataGlobals, ONLY: NumOfZones, ScheduleAlwaysOn
USE SingleDuct, ONLY: GetATMixer
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), PARAMETER :: RoutineName='GetFanCoilUnits: ' ! include trailing blank space
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: FanCoilIndex ! loop index
INTEGER :: FanCoilNum ! current fan coil number
INTEGER :: NumAlphas ! Number of Alphas for each GetObjectItem call
INTEGER :: NumNumbers ! Number of Numbers for each GetObjectItem call
INTEGER, DIMENSION(4) :: OANodeNums ! Node numbers of Outdoor air mixer (OA, EA, RA, MA)
INTEGER :: IOStatus ! Used in GetObjectItem
LOGICAL :: ErrorsFound=.false. ! Set to true if errors in input, fatal at end of routine
LOGICAL :: ErrFlag=.false. ! Local error flag for GetOAMixerNodeNums
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), ALLOCATABLE, DIMENSION(:) :: Alphas ! Alpha input items for object
CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: cAlphaFields ! Alpha field names
CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: cNumericFields ! Numeric field names
REAL(r64), ALLOCATABLE, DIMENSION(:) :: Numbers ! Numeric input items for object
LOGICAL, ALLOCATABLE, DIMENSION(:) :: lAlphaBlanks ! Logical array, alpha field input BLANK = .true.
LOGICAL, ALLOCATABLE, DIMENSION(:) :: lNumericBlanks ! Logical array, numeric field input BLANK = .true.
INTEGER :: TotalArgs=0 ! Total number of alpha and numeric arguments (max) for a
INTEGER :: CtrlZone ! index to loop counter
INTEGER :: NodeNum ! index to loop counter
LOGICAL :: ZoneExNodeNotFound = .FALSE. ! used in error checking
LOGICAL :: ZoneInNodeNotFound = .FALSE. ! used in error checking
INTEGER :: ATMixerNum=0 ! index of air terminal mixer in the air terminal mixer data array
INTEGER :: ATMixerType=0 ! type of air terminal mixer (1=inlet side; 2=supply side)
INTEGER :: ATMixerPriNode=0 ! node number of the air terminal mixer primary air inlet
INTEGER :: ATMixerSecNode=0 ! node number of the air terminal mixer secondary air inlet
INTEGER :: ATMixerOutNode=0 ! node number of the air terminal mixer secondary air inlet
CHARACTER(len=MaxNameLength) :: ATMixerName
! FLOW
! find the number of each type of fan coil unit
CurrentModuleObject = cMO_FanCoil
Num4PipeFanCoils = GetNumObjectsFound(CurrentModuleObject)
NumFanCoils = Num4PipeFanCoils
! allocate the data structures
ALLOCATE(FanCoil(NumFanCoils))
ALLOCATE(CheckEquipName(NumFanCoils))
CheckEquipName=.true.
CALL GetObjectDefMaxArgs(CurrentModuleObject,TotalArgs,NumAlphas,NumNumbers)
ALLOCATE(Alphas(NumAlphas))
Alphas=' '
ALLOCATE(cAlphaFields(NumAlphas))
cAlphaFields=' '
ALLOCATE(cNumericFields(NumNumbers))
cNumericFields=' '
ALLOCATE(Numbers(NumNumbers))
Numbers=0.0d0
ALLOCATE(lAlphaBlanks(NumAlphas))
lAlphaBlanks=.TRUE.
ALLOCATE(lNumericBlanks(NumNumbers))
lNumericBlanks=.TRUE.
! loop over 4 pipe fan coil units; get and load the input data
DO FanCoilIndex = 1,Num4PipeFanCoils
CALL GetObjectItem(CurrentModuleObject,FanCoilIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
NumBlank=lNumericBlanks,AlphaBlank=lAlphaBlanks, &
AlphaFieldNames=cAlphaFields,NumericFieldNames=cNumericFields)
FanCoilNum = FanCoilIndex
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(Alphas(1),FanCoil%Name,FanCoilNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
FanCoil(FanCoilNum)%Name = Alphas(1)
FanCoil(FanCoilNum)%UnitType = TRIM(CurrentModuleObject)
FanCoil(FanCoilNum)%UnitType_Num = FanCoilUnit_4Pipe
FanCoil(FanCoilNum)%Sched = Alphas(2)
IF (lAlphaBlanks(2)) THEN
FanCoil(FanCoilNum)%SchedPtr = ScheduleAlwaysOn
ELSE
FanCoil(FanCoilNum)%SchedPtr = GetScheduleIndex(Alphas(2)) ! convert schedule name to pointer
IF (FanCoil(FanCoilNum)%SchedPtr .EQ. 0) THEN
CALL ShowSevereError(RoutineName//trim(CurrentModuleObject)//'="'//trim(Alphas(1))//'", invalid')
CALL ShowContinueError('invalid-not found: '//TRIM(cAlphaFields(2))//'="'//TRIM(Alphas(2))//'".')
ErrorsFound=.TRUE.
END IF
END IF
IF (SameString(Alphas(3),'ConstantFanVariableFlow') .OR. &
SameString(Alphas(3),'CyclingFan') .OR. &
SameString(Alphas(3),'VariableFanVariableFlow') .OR. &
SameString(Alphas(3),'VariableFanConstantFlow') ) THEN
FanCoil(FanCoilNum)%CapCtrlMeth= Alphas(3)
IF (SameString(Alphas(3),'ConstantFanVariableFlow')) &
FanCoil(FanCoilNum)%CapCtrlMeth_Num=CCM_ConsFanVarFlow
IF (SameString(Alphas(3),'CyclingFan')) &
FanCoil(FanCoilNum)%CapCtrlMeth_Num=CCM_CycFan
IF (SameString(Alphas(3),'VariableFanVariableFlow')) &
FanCoil(FanCoilNum)%CapCtrlMeth_Num=CCM_VarFanVarFlow
IF (SameString(Alphas(3),'VariableFanConstantFlow')) &
FanCoil(FanCoilNum)%CapCtrlMeth_Num=CCM_VarFanConsFlow
ELSE
CALL ShowSevereError(RoutineName//trim(CurrentModuleObject)//'="'//trim(FanCoil(FanCoilNum)%Name)//'", invalid')
CALL ShowContinueError('illegal value: '//TRIM(cAlphaFields(3))//'="'//TRIM(Alphas(3))//'".')
ErrorsFound=.TRUE.
END IF
FanCoil(FanCoilNum)%SchedOutAir = Alphas(4)
FanCoil(FanCoilNum)%SchedOutAirPtr = GetScheduleIndex(Alphas(4)) ! convert schedule name to pointer
IF (FanCoil(FanCoilNum)%SchedOutAirPtr .EQ. 0 .AND. (.NOT. lAlphaBlanks(4))) THEN
CALL ShowSevereError(RoutineName//trim(CurrentModuleObject)//'="'//trim(FanCoil(FanCoilNum)%Name)//'", invalid')
CALL ShowContinueError('illegal value: '//TRIM(cAlphaFields(4))//'="'//TRIM(Alphas(4))//'".')
ErrorsFound=.TRUE.
END IF
FanCoil(FanCoilNum)%MaxAirVolFlow = Numbers(1)
FanCoil(FanCoilNum)%LowSpeedRatio = Numbers(2)
FanCoil(FanCoilNum)%MedSpeedRatio = Numbers(3)
! check if low speed ratio < medium speed ratio, if not : warning & set to default values
IF(FanCoil(FanCoilNum)%LowSpeedRatio .GT. FanCoil(FanCoilNum)%MedSpeedRatio)THEN
CALL ShowWarningError(RoutineName//trim(CurrentModuleObject)//'="'//trim(FanCoil(FanCoilNum)%Name)//'",')
CALL ShowContinueError('... '//TRIM(cNumericFields(2))//' is greater than the medium speed supply air flow ratio.')
CALL ShowContinueError('... Fan Coil Unit low speed supply air flow ratio = '// &
TRIM(TrimSigDigits(FanCoil(FanCoilNum)%LowSpeedRatio,5))//' ')
CALL ShowContinueError('... Fan Coit Unit medium speed supply air flow ratio = '// &
TRIM(TrimSigDigits(FanCoil(FanCoilNum)%MedSpeedRatio,5))//' ')
CALL ShowContinueError('... Fan Coil Unit low speed supply air flow ratio and medium speed '// &
'supply air flow ratio set to default values')
FanCoil(FanCoilNum)%LowSpeedRatio = 1.d0/3.d0
FanCoil(FanCoilNum)%MedSpeedRatio = 2.d0/3.d0
END IF
FanCoil(FanCoilNum)%OutAirVolFlow = Numbers(4)
FanCoil(FanCoilNum)%AirInNode = & ! air input node
GetOnlySingleNode(Alphas(5),ErrorsFound,FanCoil(FanCoilNum)%UnitType,Alphas(1),NodeType_Air, &
NodeConnectionType_Inlet, 1, ObjectIsParent)
FanCoil(FanCoilNum)%AirOutNode = & ! air outlet node
GetOnlySingleNode(Alphas(6),ErrorsFound,FanCoil(FanCoilNum)%UnitType,Alphas(1),NodeType_Air, &
NodeConnectionType_Outlet, 1, ObjectIsParent)
FanCoil(FanCoilNum)%OAMixType = Alphas(7)
FanCoil(FanCoilNum)%OAMixName = Alphas(8)
! check to see if local OA mixer specified
IF (.NOT. lAlphaBlanks(8)) THEN
ErrFlag = .false.
CALL ValidateComponent(FanCoil(FanCoilNum)%OAMixType,FanCoil(FanCoilNum)%OAMixName,ErrFlag,TRIM(CurrentModuleObject))
IF (ErrFlag) THEN
CALL ShowContinueError('specified in '//TRIM(CurrentModuleObject)//' = "'//TRIM(FanCoil(FanCoilNum)%Name)//'".')
ErrorsFound = .TRUE.
ELSE
! Get outdoor air mixer node numbers
OANodeNums = GetOAMixerNodeNumbers(FanCoil(FanCoilNum)%OAMixName, ErrFlag)
IF (ErrFlag) THEN
CALL ShowContinueError('that was specified in '//TRIM(CurrentModuleObject)//' = '//TRIM(FanCoil(FanCoilNum)%Name))
CALL ShowContinueError('..OutdoorAir:Mixer is required. Enter an OutdoorAir:Mixer object with this name.')
ErrorsFound=.true.
ELSE
FanCoil(FanCoilNum)%OutsideAirNode = OANodeNums(1)
FanCoil(FanCoilNum)%AirReliefNode = OANodeNums(2)
FanCoil(FanCoilNum)%MixedAirNode = OANodeNums(4)
ENDIF
ENDIF
ENDIF
FanCoil(FanCoilNum)%CCoilName = Alphas(12)
FanCoil(FanCoilNum)%MaxColdWaterVolFlow = Numbers(5)
FanCoil(FanCoilNum)%MinColdWaterVolFlow = Numbers(6)
FanCoil(FanCoilNum)%ColdControlOffset = Numbers(7)
FanCoil(FanCoilNum)%HCoilName = Alphas(14)
FanCoil(FanCoilNum)%HCoilType = Alphas(13)
FanCoil(FanCoilNum)%MaxHotWaterVolFlow = Numbers(8)
FanCoil(FanCoilNum)%MinHotWaterVolFlow = Numbers(9)
FanCoil(FanCoilNum)%HotControlOffset = Numbers(10)
IF (SameString(Alphas(11),'Coil:Cooling:Water') .OR. &
SameString(Alphas(11),'Coil:Cooling:Water:DetailedGeometry') .OR. &
SameString(Alphas(11),'CoilSystem:Cooling:Water:HeatExchangerAssisted') ) THEN
FanCoil(FanCoilNum)%CCoilType = Alphas(11)
IF (SameString(Alphas(11),'Coil:Cooling:Water')) THEN
FanCoil(FanCoilNum)%CCoilType_Num=CCoil_Water
FanCoil(FanCoilNum)%CCoilPlantName=FanCoil(FanCoilNum)%CCoilName
FanCoil(FanCoilNum)%CCoilPlantTypeOfNum=TypeOf_CoilWaterCooling
ENDIF
IF (SameString(Alphas(11),'Coil:Cooling:Water:DetailedGeometry')) THEN
FanCoil(FanCoilNum)%CCoilType_Num=CCoil_Detailed
FanCoil(FanCoilNum)%CCoilPlantName=FanCoil(FanCoilNum)%CCoilName
FanCoil(FanCoilNum)%CCoilPlantTypeOfNum=TypeOf_CoilWaterDetailedFlatCooling
ENDIF
IF (SameString(Alphas(11),'CoilSystem:Cooling:Water:HeatExchangerAssisted')) THEN
FanCoil(FanCoilNum)%CCoilType_Num=CCoil_HXAssist
CALL GetHXCoilTypeAndName(FanCoil(FanCoilNum)%CCoilType,FanCoil(FanCoilNum)%CCoilName,ErrorsFound, &
FanCoil(FanCoilNum)%CCoilPlantType,FanCoil(FanCoilNum)%CCoilPlantName)
IF (SameString(FanCoil(FanCoilNum)%CCoilPlantType,'Coil:Cooling:Water')) THEN
FanCoil(FanCoilNum)%CCoilPlantTypeOfNum=TypeOf_CoilWaterCooling
ELSEIF (SameString(FanCoil(FanCoilNum)%CCoilPlantType,'Coil:Cooling:Water:DetailedGeometry')) THEN
FanCoil(FanCoilNum)%CCoilPlantTypeOfNum=TypeOf_CoilWaterDetailedFlatCooling
ELSE
CALL ShowSevereError(RoutineName//trim(CurrentModuleObject)//'="'//trim(FanCoil(FanCoilNum)%Name)//'", invalid')
CALL ShowContinueError('For: '//TRIM(cAlphaFields(11))//'="'//TRIM(Alphas(11))//'".')
CALL ShowContinueError('Invalid Coil Type='//trim(FanCoil(FanCoilNum)%CCoilPlantType)// &
', Name='//trim(FanCoil(FanCoilNum)%CCoilPlantName))
CALL ShowContinueError('must be "Coil:Cooling:Water" or "Coil:Cooling:Water:DetailedGeometry"')
ErrorsFound=.true.
ENDIF
ENDIF
IsNotOK=.FALSE.
CALL ValidateComponent(FanCoil(FanCoilNum)%CCoilType,FanCoil(FanCoilNum)%CCoilName,IsNotOK,FanCoil(FanCoilNum)%UnitType)
IF (IsNotOK) THEN
CALL ShowContinueError('...specified in '//TRIM(CurrentModuleObject)//'="'// &
TRIM(FanCoil(FanCoilNum)%Name)//'".')
ErrorsFound=.true.
ELSE
IF (FanCoil(FanCoilNum)%CCoilType_Num /= CCoil_HXAssist) THEN
! mine the cold water node from the coil object
FanCoil(FanCoilNum)%ColdControlNode = GetCoilWaterInletNode(FanCoil(FanCoilNum)%CCoilType, &
FanCoil(FanCoilNum)%CCoilName,IsNotOK)
ELSE
FanCoil(FanCoilNum)%ColdControlNode = GetHXCoilWaterInletNode(FanCoil(FanCoilNum)%CCoilType, &
FanCoil(FanCoilNum)%CCoilName,IsNotOK)
ENDIF
! Other error checks should trap before it gets to this point in the code, but including just in case.
IF (IsNotOK) THEN
CALL ShowContinueError('...specified in '//TRIM(CurrentModuleObject)//'="'//TRIM(FanCoil(FanCoilNum)%Name)//'".')
ErrorsFound=.true.
ENDIF
ENDIF
ELSE
CALL ShowSevereError(RoutineName//trim(CurrentModuleObject)//'="'//trim(FanCoil(FanCoilNum)%Name)//'", invalid')
CALL ShowContinueError('illegal value: '//TRIM(cAlphaFields(11))//'="'//TRIM(Alphas(11))//'".')
ErrorsFound=.TRUE.
END IF
IF (SameString(Alphas(13),'Coil:Heating:Water')) THEN
FanCoil(FanCoilNum)%HCoilType_Num=HCoil_Water
FanCoil(FanCoilNum)%HCoilPlantTypeOfNum=TypeOf_CoilWaterSimpleHeating
IsNotOK=.FALSE.
CALL ValidateComponent(FanCoil(FanCoilNum)%HCoilType,FanCoil(FanCoilNum)%HCoilName,IsNotOK,TRIM(CurrentModuleObject))
IF (IsNotOK) THEN
CALL ShowContinueError('...specified in '//TRIM(CurrentModuleObject)//'="'//TRIM(FanCoil(FanCoilNum)%Name)//'".')
ErrorsFound = .TRUE.
ELSE
! mine the hot water node from the coil object
FanCoil(FanCoilNum)%HotControlNode = GetCoilWaterInletNode(FanCoil(FanCoilNum)%HCoilType, &
FanCoil(FanCoilNum)%HCoilName,IsNotOK)
IF (IsNotOK) THEN
CALL ShowContinueError('...specified in '//TRIM(CurrentModuleObject)//'="'// &
TRIM(FanCoil(FanCoilNum)%Name)//'".')
ErrorsFound=.true.
ENDIF
ENDIF
ELSE
CALL ShowSevereError(RoutineName//trim(CurrentModuleObject)//'="'//trim(FanCoil(FanCoilNum)%Name)//'", invalid')
CALL ShowContinueError('illegal value: '//TRIM(cAlphaFields(13))//'="'//TRIM(Alphas(13))//'".')
ErrorsFound=.TRUE.
END IF
FanCoil(FanCoilNum)%FanType = Alphas(9)
FanCoil(FanCoilNum)%FanName = Alphas(10)
IF (.NOT. lAlphaBlanks(15)) THEN
FanCoil(FanCoilNum)%AvailManagerListName = Alphas(15)
ZoneComp(FanCoil4Pipe_Num)%ZoneCompAvailMgrs(FanCoilNum)%AvailManagerListName = Alphas(15)
ENDIF
ErrFlag = .FALSE.
CALL ValidateComponent(FanCoil(FanCoilNum)%FanType,FanCoil(FanCoilNum)%FanName,ErrFlag,TRIM(CurrentModuleObject))
IF (ErrFlag) THEN
CALL ShowContinueError('specified in '//TRIM(CurrentModuleObject)//' = "'//TRIM(FanCoil(FanCoilNum)%Name)//'".')
ErrorsFound=.TRUE.
ELSE
CALL GetFanType(FanCoil(FanCoilNum)%FanName,FanCoil(FanCoilNum)%FanType_Num, &
ErrFlag,CurrentModuleObject,FanCoil(FanCoilNum)%Name)
SELECT CASE (FanCoil(FanCoilNum)%FanType_Num)
CASE (FanType_SimpleConstVolume, FanType_SimpleVAV, FanType_SimpleOnOff)
! Get fan air volume flow rate
FanCoil(FanCoilNum)%FanAirVolFlow = GetFanDesignVolumeFlowRate(FanCoil(FanCoilNum)%FanType, &
FanCoil(FanCoilNum)%FanName,IsNotOK)
! Check that the fan volumetric flow rate is greater than or equal to the FCU volumetric flow rate
IF(FanCoil(FanCoilNum)%MaxAirVolFlow .GT. FanCoil(FanCoilNum)%FanAirVolFlow .AND. &
FanCoil(FanCoilNum)%FanAirVolFlow .NE. AutoSize)THEN
CALL ShowWarningError(RoutineName//TRIM(FanCoil(FanCoilNum)%UnitType)//': '//TRIM(FanCoil(FanCoilNum)%Name))
CALL ShowContinueError('... '//TRIM(cNumericFields(1))//' is greater than the maximum fan flow rate.')
CALL ShowContinueError('... Fan Coil Unit flow = '//TRIM(TrimSigDigits(FanCoil(FanCoilNum)%MaxAirVolFlow,5))//' m3/s.')
CALL ShowContinueError('... Fan = '//TRIM(cFanTypes(FanCoil(FanCoilNum)%FanType_Num))//': '// &
TRIM(FanCoil(FanCoilNum)%FanName))
CALL ShowContinueError('... Fan flow = '//TRIM(TrimSigDigits(FanCoil(FanCoilNum)%FanAirVolFlow,5))//' m3/s.')
CALL ShowContinueError('... Fan Coil Unit flow rate reduced to match the fan flow rate and the simulation continues.')
FanCoil(FanCoilNum)%MaxAirVolFlow = FanCoil(FanCoilNum)%FanAirVolFlow
END IF
! Check that the fan type match with the capacity control method selected
IF((FanCoil(FanCoilNum)%CapCtrlMeth_Num == CCM_ConsFanVarFlow &
.and. (FanCoil(FanCoilNum)%FanType_Num==FanType_SimpleVAV)) &
.OR.(FanCoil(FanCoilNum)%CapCtrlMeth_Num == CCM_CycFan &
.and. FanCoil(FanCoilNum)%FanType_Num.ne.FanType_SimpleOnOff) &
.OR. (FanCoil(FanCoilNum)%CapCtrlMeth_Num == CCM_VarFanVarFlow &
.and. FanCoil(FanCoilNum)%FanType_Num.ne.FanType_SimpleVAV) &
.OR. (FanCoil(FanCoilNum)%CapCtrlMeth_Num == CCM_VarFanConsFlow &
.and. FanCoil(FanCoilNum)%FanType_Num.ne.FanType_SimpleVAV)) THEN
CALL ShowSevereError(RoutineName//TRIM(FanCoil(FanCoilNum)%UnitType)//': '//TRIM(FanCoil(FanCoilNum)%Name))
CALL ShowContinueError('...the fan type of the object : '//TRIM(FanCoil(FanCoilNum)%FanName)// &
' does not match with the capacity control method selected : '// &
TRIM(FanCoil(FanCoilNum)%CapCtrlMeth)//' please see I/O reference')
CALL ShowContinueError('...for ConstantFanVariableFlow a Fan:OnOff or Fan:ConstantVolume is valid.')
CALL ShowContinueError('...for CyclingFan a Fan:OnOff is valid.')
CALL ShowContinueError('...for VariableFanVariableFlow or VariableFanConstantFlow a Fan:VariableVolume is valid.')
ErrorsFound=.TRUE.
END IF
CASE DEFAULT
CALL ShowSevereError(TRIM(CurrentModuleObject)//' = "'//TRIM(Alphas(1))//'"')
CALL ShowContinueError('Fan Type must be Fan:OnOff, Fan:ConstantVolume or Fan:VariableVolume.')
ErrorsFound=.TRUE.
END SELECT
ENDIF
! Set defaults for convergence tolerance
IF (FanCoil(FanCoilNum)%ColdControlOffset .LE. 0.0d0) THEN
FanCoil(FanCoilNum)%ColdControlOffset = 0.001d0
END IF
IF (FanCoil(FanCoilNum)%HotControlOffset .LE. 0.0d0) THEN
FanCoil(FanCoilNum)%HotControlOffset = 0.001d0
END IF
!check for inlet side air mixer
CALL GetATMixer(FanCoil(FanCoilNum)%Name,ATMixerName,ATMixerNum,ATMixerType,ATMixerPriNode,AtmixerSecNode,ATMixerOutNode)
IF (ATMixerType == ATMixer_InletSide) THEN
! save the air terminal mixer data in the fan coil data array
FanCoil(FanCoilNum)%ATMixerExists = .TRUE.
FanCoil(FanCoilNum)%ATMixerIndex = ATMixerNum
FanCoil(FanCoilNum)%ATMixerName = ATMixerName
FanCoil(FanCoilNum)%ATMixerType = ATMixer_InletSide
FanCoil(FanCoilNum)%ATMixerPriNode = ATMixerPriNode
FanCoil(FanCoilNum)%ATMixerSecNode = ATMixerSecNode
FanCoil(FanCoilNum)%ATMixerOutNode = ATMixerOutNode
! check that fan coil doesn' have local outside air
IF (.NOT. lAlphaBlanks(8)) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' = "'//TRIM(FanCoil(FanCoilNum)%Name)//'".'// &
' Fan coil unit has local as well as central outdoor air specified')
END IF
! check that the air teminal mixer out node is the fan coil inlet node
IF (FanCoil(FanCoilNum)%AirInNode .NE. ATMixerOutNode) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' = "'//TRIM(FanCoil(FanCoilNum)%Name)//'".'// &
' Fan coil unit air inlet node name must be the same as an air terminal mixer outlet node name.')
CALL ShowContinueError('..Air terminal mixer outlet node name is specified in AirTerminal:SingleDuct:InletSideMixer object.')
CALL ShowContinueError('..Fan coil unit air inlet node name = '//TRIM(NodeID(FanCoil(FanCoilNum)%AirInNode)))
ErrorsFound=.TRUE.
END IF
! check for supply side air terminal mixer
ELSE IF (ATMixerType == ATMixer_SupplySide) THEN
! save the air terminal mixer data in the fan coil data array
FanCoil(FanCoilNum)%ATMixerExists = .TRUE.
FanCoil(FanCoilNum)%ATMixerIndex = ATMixerNum
FanCoil(FanCoilNum)%ATMixerName = ATMixerName
FanCoil(FanCoilNum)%ATMixerType = ATMixer_SupplySide
FanCoil(FanCoilNum)%ATMixerPriNode = ATMixerPriNode
FanCoil(FanCoilNum)%ATMixerSecNode = ATMixerSecNode
FanCoil(FanCoilNum)%ATMixerOutNode = ATMixerOutNode
! check that fan coil doesn' have local outside air
IF (.NOT. lAlphaBlanks(8)) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' = "'//TRIM(FanCoil(FanCoilNum)%Name)//'".'// &
' Fan coil unit has local as well as central outdoor air specified')
END IF
! check that the air teminal mixer secondary air inlet node is the fan coil outlet node
IF (FanCoil(FanCoilNum)%AirOutNode .NE. ATMixerSecNode) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' = "'//TRIM(FanCoil(FanCoilNum)%Name)//'".'// &
' Fan coil unit air outlet node name must be the same as the air terminal mixer secondary air inlet node name.')
CALL ShowContinueError('..Air terminal mixer secondary inlet node name is specified in '// &
'AirTerminal:SingleDuct:SupplySideMixer object.')
CALL ShowContinueError('..Fan coil unit air outlet node name = '//TRIM(NodeID(FanCoil(FanCoilNum)%AirOutNode)))
ErrorsFound = .TRUE.
END IF
! no air terminal mixer; do the normal connectivity checks
ELSE
! check that the fan coil inlet node is the same as one of the zone exhaust nodes
ZoneExNodeNotFound = .TRUE.
DO CtrlZone = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZone)%IsControlled) CYCLE
DO NodeNum = 1,ZoneEquipConfig(CtrlZone)%NumExhaustNodes
IF (FanCoil(FanCoilNum)%AirInNode .EQ. ZoneEquipConfig(CtrlZone)%ExhaustNode(NodeNum)) THEN
ZoneExNodeNotFound = .FALSE.
END IF
END DO
END DO
IF (ZoneExNodeNotFound) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' = "'//TRIM(FanCoil(FanCoilNum)%Name)//'".'// &
' Fan coil unit air inlet node name must be the same as a zone exhaust node name.')
CALL ShowContinueError('..Zone exhaust node name is specified in ZoneHVAC:EquipmentConnections object.')
CALL ShowContinueError('..Fan coil unit air inlet node name = '//TRIM(NodeID(FanCoil(FanCoilNum)%AirInNode)))
ErrorsFound=.TRUE.
END IF
! check that the fan coil outlet node is the same as one of the zone inlet nodes
ZoneInNodeNotFound = .TRUE.
DO CtrlZone = 1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZone)%IsControlled) CYCLE
DO NodeNum = 1,ZoneEquipConfig(CtrlZone)%NumInletNodes
IF (FanCoil(FanCoilNum)%AirOutNode .EQ. ZoneEquipConfig(CtrlZone)%InletNode(NodeNum)) THEN
ZoneInNodeNotFound = .FALSE.
END IF
END DO
END DO
IF (ZoneInNodeNotFound) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' = "'//TRIM(FanCoil(FanCoilNum)%Name)//'".'// &
' Fan coil unit air outlet node name must be the same as a zone inlet node name.')
CALL ShowContinueError('..Zone inlet node name is specified in ZoneHVAC:EquipmentConnections object.')
CALL ShowContinueError('..Fan coil unit air outlet node name = '//TRIM(NodeID(FanCoil(FanCoilNum)%AirOutNode)))
ErrorsFound=.TRUE.
END IF
END IF
! Set up component set for supply fan
IF (FanCoil(FanCoilNum)%OutsideAirNode > 0) THEN
CALL SetUpCompSets(FanCoil(FanCoilNum)%UnitType, FanCoil(FanCoilNum)%Name, &
FanCoil(FanCoilNum)%FanType,FanCoil(FanCoilNum)%FanName, &
NodeID(FanCoil(FanCoilNum)%MixedAirNode),'UNDEFINED')
ELSE
CALL SetUpCompSets(FanCoil(FanCoilNum)%UnitType, FanCoil(FanCoilNum)%Name, &
FanCoil(FanCoilNum)%FanType,FanCoil(FanCoilNum)%FanName, &
NodeID(FanCoil(FanCoilNum)%AirInNode),'UNDEFINED')
END IF
! Set up component set for cooling coil
CALL SetUpCompSets(FanCoil(FanCoilNum)%UnitType, FanCoil(FanCoilNum)%Name, &
FanCoil(FanCoilNum)%CCoilType,FanCoil(FanCoilNum)%CCoilName,'UNDEFINED','UNDEFINED')
! Set up component set for heating coil
CALL SetUpCompSets(FanCoil(FanCoilNum)%UnitType, FanCoil(FanCoilNum)%Name, &
FanCoil(FanCoilNum)%HCoilType,FanCoil(FanCoilNum)%HCoilName, &
'UNDEFINED',NodeID(FanCoil(FanCoilNum)%AirOutNode))
! Set up component set for OA mixer - use OA node and Mixed air node
IF (FanCoil(FanCoilNum)%OutsideAirNode > 0) THEN
CALL SetUpCompSets(FanCoil(FanCoilNum)%UnitType, FanCoil(FanCoilNum)%Name, &
FanCoil(FanCoilNum)%OAMixType, FanCoil(FanCoilNum)%OAMixName, &
NodeID(FanCoil(FanCoilNum)%OutsideAirNode),NodeID(FanCoil(FanCoilNum)%MixedAirNode))
END IF
END DO
DEALLOCATE(Alphas)
DEALLOCATE(cAlphaFields)
DEALLOCATE(cNumericFields)
DEALLOCATE(Numbers)
DEALLOCATE(lAlphaBlanks)
DEALLOCATE(lNumericBlanks)
IF (ErrorsFound) THEN
CALL ShowFatalError(RoutineName//'Errors found in input. Preceding condition(s) cause termination.')
END IF
Do FanCoilNum=1,NumFanCoils
! Setup Report variables for the Fan Coils
! CurrentModuleObject='ZoneHVAC:FourPipeFanCoil'
CALL SetupOutputVariable('Fan Coil Heating Rate [W]',FanCoil(FanCoilNum)%HeatPower,'System','Average',&
FanCoil(FanCoilNum)%Name)
CALL SetupOutputVariable('Fan Coil Heating Energy [J]',FanCoil(FanCoilNum)%HeatEnergy,'System','Sum',&
FanCoil(FanCoilNum)%Name)
CALL SetupOutputVariable('Fan Coil Total Cooling Rate [W]',FanCoil(FanCoilNum)%TotCoolPower,'System','Average',&
FanCoil(FanCoilNum)%Name)
CALL SetupOutputVariable('Fan Coil Total Cooling Energy [J]',FanCoil(FanCoilNum)%TotCoolEnergy,'System','Sum',&
FanCoil(FanCoilNum)%Name)
CALL SetupOutputVariable('Fan Coil Sensible Cooling Rate [W]',FanCoil(FanCoilNum)%SensCoolPower,'System','Average',&
FanCoil(FanCoilNum)%Name)
CALL SetupOutputVariable('Fan Coil Sensible Cooling Energy [J]',FanCoil(FanCoilNum)%SensCoolEnergy,'System','Sum',&
FanCoil(FanCoilNum)%Name)
CALL SetupOutputVariable('Fan Coil Fan Electric Power [W]',FanCoil(FanCoilNum)%ElecPower,'System','Average',&
FanCoil(FanCoilNum)%Name)
CALL SetupOutputVariable('Fan Coil Fan Electric Energy [J]',FanCoil(FanCoilNum)%ElecEnergy,'System','Sum',&
FanCoil(FanCoilNum)%Name)
IF (FanCoil(FanCoilNum)%CapCtrlMeth_Num == CCM_CycFan) THEN
CALL SetupOutputVariable('Fan Coil Runtime Fraction []',FanCoil(FanCoilNum)%PLR,'System','Average',&
FanCoil(FanCoilNum)%Name)
CALL SetupOutputVariable('Fan Coil Fan Speed Level []',FanCoil(FanCoilNum)%SpeedFanSel,'System','Average',&
FanCoil(FanCoilNum)%Name)
END IF
IF (FanCoil(FanCoilNum)%CapCtrlMeth_Num == CCM_VarFanVarFlow .or. FanCoil(FanCoilNum)%CapCtrlMeth_Num == CCM_VarFanConsFlow) THEN
CALL SetupOutputVariable('Fan Coil Part Load Ratio []',FanCoil(FanCoilNum)%PLR,'System','Average',&
FanCoil(FanCoilNum)%Name)
END IF
CALL SetupOutputVariable('Fan Coil Availability Status []',FanCoil(FanCoilNum)%AvailStatus,&
'System','Average',FanCoil(FanCoilNum)%Name)
END DO
RETURN
END SUBROUTINE GetFanCoilUnits