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) | :: | EvapFluidCoolerNum | |||
logical, | intent(in) | :: | RunFlag |
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 InitEvapFluidCooler(EvapFluidCoolerNum, RunFlag)
! SUBROUTINE INFORMATION:
! AUTHOR Chandan Sharma
! DATE WRITTEN May 2009
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for initializations of the evaporative fluid cooler components and for
! final checking of evaporative fluid cooler inputs (post autosizing)
! METHODOLOGY EMPLOYED:
! Uses the status flags to trigger initializations.
! REFERENCES:
! Based on InitTower subroutine by Don Shirey Sept/Oct 2002, F Buhl Oct 2002
! USE STATEMENTS:
USE DataGlobals, ONLY: BeginEnvrnFlag
USE Psychrometrics, ONLY: PsyTwbFnTdbWPb
USE InputProcessor, ONLY: SameString
! USE FluidProperties, ONLY : GetDensityGlycol
USE DataPlant, ONLY: TypeOf_EvapFluidCooler_SingleSpd, TypeOf_EvapFluidCooler_TwoSpd, &
ScanPlantLoopsForObject, PlantSizeNotComplete, PlantSizesOkayToFinalize
USE PlantUtilities, ONLY: InitComponentNodes, SetComponentFlowRate, RegulateCondenserCompFlowReqOp
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: EvapFluidCoolerNum ! Number of the current evaporative fluid cooler being simulated
LOGICAL, INTENT (IN) :: RunFlag ! Indication of
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL, SAVE :: ErrorsFound=.false. ! Flag if input data errors are found
LOGICAL, SAVE :: MyOneTimeFlag = .true.
LOGICAL, ALLOCATABLE,SAVE, DIMENSION(:) :: MyEnvrnFlag
LOGICAL, ALLOCATABLE,SAVE, DIMENSION(:) :: OneTimeFlagForEachEvapFluidCooler
INTEGER :: TypeOf_Num
INTEGER :: LoopNum
INTEGER :: LoopSideNum
INTEGER :: BranchIndex
INTEGER :: CompIndex
REAL(r64) :: rho ! local density of fluid
! LOGICAL :: FatalError
! Do the one time initializations
IF (MyOneTimeFlag) THEN
ALLOCATE(MyEnvrnFlag(NumSimpleEvapFluidCoolers))
ALLOCATE(OneTimeFlagForEachEvapFluidCooler(NumSimpleEvapFluidCoolers))
OneTimeFlagForEachEvapFluidCooler = .TRUE.
MyEnvrnFlag = .TRUE.
MyOneTimeFlag = .false.
END IF
IF (OneTimeFlagForEachEvapFluidCooler(EvapFluidCoolerNum)) THEN
IF (SimpleEvapFluidCooler(EvapFluidCoolerNum)%EvapFluidCoolerType_Num == EvapFluidCooler_SingleSpeed) THEN
TypeOf_Num = TypeOf_EvapFluidCooler_SingleSpd
ELSEIF (SimpleEvapFluidCooler(EvapFluidCoolerNum)%EvapFluidCoolerType_Num == EvapFluidCooler_TwoSpeed) THEN
TypeOf_Num = TypeOf_EvapFluidCooler_TwoSpd
ENDIF
ErrorsFound = .false.
! Locate the tower on the plant loops for later usage
CALL ScanPlantLoopsForObject(SimpleEvapFluidCooler(EvapFluidCoolerNum)%Name, &
TypeOf_Num, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%LoopNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%LoopSideNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%BranchNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%CompNum, &
errFlag=ErrorsFound)
IF (ErrorsFound) THEN
CALL ShowFatalError('InitEvapFluidCooler: Program terminated due to previous condition(s).')
ENDIF
IF (SimpleEvapFluidCooler(EvapFluidCoolerNum)%EvapFluidCoolerType_Num == EvapFluidCooler_TwoSpeed) THEN
IF (SimpleEvapFluidCooler(EvapFluidCoolerNum)%DesignWaterFlowRate > 0.0d0) THEN
IF (SimpleEvapFluidCooler(EvapFluidCoolerNum)%HighSpeedAirFlowRate <= &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%LowSpeedAirFlowRate) THEN
CALL ShowSevereError('EvaporativeFluidCooler:TwoSpeed "'//TRIM(SimpleEvapFluidCooler(EvapFluidCoolerNum)%Name)//&
'". Low speed air flow rate must be less than the high speed air flow rate.')
ErrorsFound=.true.
ENDIF
IF (SimpleEvapFluidCooler(EvapFluidCoolerNum)%HighSpeedEvapFluidCoolerUA <= &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%LowSpeedEvapFluidCoolerUA) THEN
CALL ShowSevereError('EvaporativeFluidCooler:TwoSpeed "'//TRIM(SimpleEvapFluidCooler(EvapFluidCoolerNum)%Name)//&
'". Evaporative fluid cooler UA at low fan speed must be less than the evaporative fluid cooler'// &
' UA at high fan speed.')
ErrorsFound=.true.
ENDIF
END IF
END IF
IF (ErrorsFound) THEN
CALL ShowFatalError('InitEvapFluidCooler: Program terminated due to previous condition(s).')
ENDIF
OneTimeFlagForEachEvapFluidCooler(EvapFluidCoolerNum) = .FALSE.
END IF
! Begin environment initializations
IF(MyEnvrnFlag(EvapFluidCoolerNum) .and. BeginEnvrnFlag .AND. (PlantSizesOkayToFinalize) )Then
IF (PlantSizeNotComplete) CALL SizeEvapFluidCooler(EvapFluidCoolerNum)
rho = GetDensityGlycol(PlantLoop(SimpleEvapFluidCooler(EvapFluidCoolerNum)%LoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(SimpleEvapFluidCooler(EvapFluidCoolerNum)%LoopNum)%FluidIndex,&
'InitEvapFluidCooler')
SimpleEvapFluidCooler(EvapFluidCoolerNum)%DesWaterMassFlowRate = &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%DesignWaterFlowRate * rho
CALL InitComponentNodes(0.0D0, SimpleEvapFluidCooler(EvapFluidCoolerNum)%DesWaterMassFlowRate , &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%WaterInletNodeNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%WaterOutletNodeNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%LoopNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%LoopSideNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%BranchNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%CompNum)
MyEnvrnFlag(EvapFluidCoolerNum) = .false.
END IF
IF (.not. BeginEnvrnFlag) THEN
MyEnvrnFlag(EvapFluidCoolerNum)=.true.
ENDIF
! Each time initializations
WaterInletNode = SimpleEvapFluidCooler(EvapFluidCoolerNum)%WaterInletNodeNum
SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum)%WaterTemp = Node(WaterInletNode)%Temp
IF (SimpleEvapFluidCooler(EvapFluidCoolerNum)%OutdoorAirInletNodeNum /= 0) THEN
SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum)%AirTemp = &
Node(SimpleEvapFluidCooler(EvapFluidCoolerNum)%OutdoorAirInletNodeNum)%Temp
SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum)%AirHumRat = &
Node(SimpleEvapFluidCooler(EvapFluidCoolerNum)%OutdoorAirInletNodeNum)%HumRat
SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum)%AirPress = &
Node(SimpleEvapFluidCooler(EvapFluidCoolerNum)%OutdoorAirInletNodeNum)%Press
SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum)%AirWetBulb = &
Node(SimpleEvapFluidCooler(EvapFluidCoolerNum)%OutdoorAirInletNodeNum)%OutAirWetBulb
ELSE
SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum)%AirTemp = OutDryBulbTemp
SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum)%AirHumRat = OutHumRat
SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum)%AirPress = OutBaroPress
SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum)%AirWetBulb = OutWetBulbTemp
ENDIF
LoopNum = SimpleEvapFluidCooler(EvapFluidCoolerNum)%LoopNum
LoopSideNum = SimpleEvapFluidCooler(EvapFluidCoolerNum)%LoopSideNum
BranchIndex = SimpleEvapFluidCooler(EvapFluidCoolerNum)%BranchNum
CompIndex = SimpleEvapFluidCooler(EvapFluidCoolerNum)%CompNum
WaterMassFlowRate = RegulateCondenserCompFlowReqOp(SimpleEvapFluidCooler(EvapFluidCoolerNum)%LoopNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%LoopSideNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%BranchNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%CompNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%DesWaterMassFlowRate * &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%EvapFluidCoolerMassFlowRateMultiplier)
CALL SetComponentFlowRate(WaterMassFlowRate, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%WaterInletNodeNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%WaterOutletNodeNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%LoopNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%LoopSideNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%BranchNum, &
SimpleEvapFluidCooler(EvapFluidCoolerNum)%CompNum)
RETURN
END SUBROUTINE InitEvapFluidCooler