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 | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | CompName | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
integer | :: | CompIndex | ||||
real(kind=r64), | intent(in), | optional | :: | SpeedRatio | ||
logical, | intent(in), | optional | :: | ZoneCompTurnFansOn | ||
logical, | intent(in), | optional | :: | ZoneCompTurnFansOff | ||
real(kind=r64), | intent(in), | optional | :: | PressureRise |
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 SimulateFanComponents(CompName,FirstHVACIteration,CompIndex,SpeedRatio,ZoneCompTurnFansOn,ZoneCompTurnFansOff, &
PressureRise)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Liesen
! DATE WRITTEN February 1998
! MODIFIED Chandan Sharma, March 2011 - FSEC: Added logic for ZoneHVAC sys avail managers
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine manages Fan component simulation.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
USE General, ONLY: TrimSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT (IN):: FirstHVACIteration
CHARACTER(len=*), INTENT(IN) :: CompName
INTEGER :: CompIndex
REAL(r64), OPTIONAL, INTENT(IN) :: SpeedRatio
LOGICAL, OPTIONAL, INTENT(IN) :: ZoneCompTurnFansOn ! Turn fans ON signal from ZoneHVAC component
LOGICAL, OPTIONAL, INTENT(IN) :: ZoneCompTurnFansOff ! Turn Fans OFF signal from ZoneHVAC component
REAL(r64), OPTIONAL, INTENT(IN) :: PressureRise ! Pressure difference to use for DeltaPress
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: Blank = ' '
! INTERFACE BLOCK SPECIFICATIONS
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: FanNum ! current fan number
! FLOW:
! Obtains and Allocates fan related parameters from input file
IF (GetFanInputFlag) THEN !First time subroutine has been entered
CALL GetFanInput
GetFanInputFlag=.false.
End If
IF (CompIndex == 0) THEN
FanNum = FindItemInList(CompName,Fan%FanName,NumFans)
IF (FanNum == 0) THEN
CALL ShowFatalError('SimulateFanComponents: Fan not found='//TRIM(CompName))
ENDIF
CompIndex=FanNum
ELSE
FanNum=CompIndex
IF (FanNum > NumFans .or. FanNum < 1) THEN
CALL ShowFatalError('SimulateFanComponents: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(FanNum))// &
', Number of Fans='//TRIM(TrimSigDigits(NumFans))// &
', Fan name='//TRIM(CompName))
ENDIF
IF (CheckEquipName(FanNum)) THEN
IF (CompName /= Blank .AND. CompName /= Fan(FanNum)%FanName) THEN
CALL ShowFatalError('SimulateFanComponents: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(FanNum))// &
', Fan name='//TRIM(CompName)//', stored Fan Name for that index='// &
TRIM(Fan(FanNum)%FanName))
ENDIF
CheckEquipName(FanNum)=.false.
ENDIF
ENDIF
LocalTurnFansOn = .FALSE.
LocalTurnFansOff = .FALSE.
! With the correct FanNum Initialize
CALL InitFan(FanNum,FirstHVACIteration) ! Initialize all fan related parameters
IF (PRESENT(ZoneCompTurnFansOn) .AND. PRESENT(ZoneCompTurnFansOff)) THEN
! Set module-level logic flags equal to ZoneCompTurnFansOn and ZoneCompTurnFansOff values passed into this routine
! for ZoneHVAC components with system availability managers defined.
! The module-level flags get used in the other subroutines (e.g., SimSimpleFan,SimVariableVolumeFan and SimOnOffFan)
LocalTurnFansOn = ZoneCompTurnFansOn
LocalTurnFansOff = ZoneCompTurnFansOff
ELSE
! Set module-level logic flags equal to the global LocalTurnFansOn and LocalTurnFansOff variables for all other cases.
LocalTurnFansOn = TurnFansOn
LocalTurnFansOff = TurnFansOff
ENDIF
! Calculate the Correct Fan Model with the current FanNum
IF (Fan(FanNum)%FanType_Num == FanType_SimpleConstVolume) THEN
Call SimSimpleFan(FanNum)
ELSE IF (Fan(FanNum)%FanType_Num == FanType_SimpleVAV) THEN
IF (PRESENT(PressureRise)) THEN
Call SimVariableVolumeFan(FanNum, PressureRise)
ELSE
Call SimVariableVolumeFan(FanNum)
ENDIF
ELSE IF (Fan(FanNum)%FanType_Num == FanType_SimpleOnOff) THEN
Call SimOnOffFan(FanNum, SpeedRatio)
ELSE IF (Fan(FanNum)%FanType_Num == FanType_ZoneExhaust) THEN
Call SimZoneExhaustFan(FanNum)
! cpw22Aug2010 Add call for Component Model fan
ELSE IF (Fan(FanNum)%FanType_Num == FanType_ComponentModel) THEN
Call SimComponentModelFan(FanNum)
END IF
! Update the current fan to the outlet nodes
Call UpdateFan(FanNum)
! Report the current fan
Call ReportFan(FanNum)
RETURN
END SUBROUTINE SimulateFanComponents