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) | :: | FluidCoolerNum | |||
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 InitFluidCooler(FluidCoolerNum, RunFlag)
! SUBROUTINE INFORMATION:
! AUTHOR Chandan Sharma
! DATE WRITTEN August 2008
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for initializations of the fluid cooler components and for
! final checking of 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 FluidProperties, ONLY : GetDensityGlycol
USE InputProcessor, ONLY : SameString
USE DataPlant, ONLY : TypeOf_FluidCooler_SingleSpd, TypeOf_FluidCooler_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) :: FluidCoolerNum ! Number of the current fluid cooler being simulated
LOGICAL, INTENT (IN) :: RunFlag ! TRUE if fluid cooler is ON
! 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(:) :: OneTimeFlagForEachFluidCooler
LOGICAL :: FatalError
INTEGER :: TypeOf_Num
INTEGER :: LoopNum
INTEGER :: LoopSideNum
INTEGER :: BranchIndex
INTEGER :: CompIndex
REAL(r64) :: rho ! local density of fluid
! Do the one time initializations
IF (MyOneTimeFlag) THEN
ALLOCATE(MyEnvrnFlag(NumSimpleFluidCoolers))
ALLOCATE(OneTimeFlagForEachFluidCooler(NumSimpleFluidCoolers))
OneTimeFlagForEachFluidCooler = .TRUE.
MyEnvrnFlag = .TRUE.
MyOneTimeFlag = .false.
END IF
IF (OneTimeFlagForEachFluidCooler(FluidCoolerNum)) THEN
IF (SimpleFluidCooler(FluidCoolerNum)%FluidCoolerType_Num == FluidCooler_SingleSpeed) THEN
TypeOf_Num = TypeOf_FluidCooler_SingleSpd
ELSEIF (SimpleFluidCooler(FluidCoolerNum)%FluidCoolerType_Num == FluidCooler_TwoSpeed) THEN
TypeOf_Num = TypeOf_FluidCooler_TwoSpd
ENDIF
! Locate the tower on the plant loops for later usage
CALL ScanPlantLoopsForObject(SimpleFluidCooler(FluidCoolerNum)%Name, &
TypeOf_Num, &
SimpleFluidCooler(FluidCoolerNum)%LoopNum, &
SimpleFluidCooler(FluidCoolerNum)%LoopSideNum, &
SimpleFluidCooler(FluidCoolerNum)%BranchNum, &
SimpleFluidCooler(FluidCoolerNum)%CompNum, &
errFlag=ErrorsFound)
IF (ErrorsFound) THEN
CALL ShowFatalError('InitFluidCooler: Program terminated due to previous condition(s).')
ENDIF
OneTimeFlagForEachFluidCooler(FluidCoolerNum) = .FALSE.
END IF
! Begin environment initializations
IF(MyEnvrnFlag(FluidCoolerNum) .AND. BeginEnvrnFlag .AND. (PlantSizesOkayToFinalize))Then
IF (PlantSizeNotComplete) CALL SizeFluidCooler(FluidCoolerNum)
rho = GetDensityGlycol(PlantLoop(SimpleFluidCooler(FluidCoolerNum)%LoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(SimpleFluidCooler(FluidCoolerNum)%LoopNum)%FluidIndex,&
'InitFluidCooler')
SimpleFluidCooler(FluidCoolerNum)%DesWaterMassFlowRate = SimpleFluidCooler(FluidCoolerNum)%DesignWaterFlowRate * rho
CALL InitComponentNodes(0.0D0, SimpleFluidCooler(FluidCoolerNum)%DesWaterMassFlowRate , &
SimpleFluidCooler(FluidCoolerNum)%WaterInletNodeNum, &
SimpleFluidCooler(FluidCoolerNum)%WaterOutletNodeNum, &
SimpleFluidCooler(FluidCoolerNum)%LoopNum, &
SimpleFluidCooler(FluidCoolerNum)%LoopSideNum, &
SimpleFluidCooler(FluidCoolerNum)%BranchNum, &
SimpleFluidCooler(FluidCoolerNum)%CompNum)
MyEnvrnFlag(FluidCoolerNum) = .false.
END IF
IF (.not. BeginEnvrnFlag) THEN
MyEnvrnFlag(FluidCoolerNum)=.true.
ENDIF
! Each time initializations
WaterInletNode = SimpleFluidCooler(FluidCoolerNum)%WaterInletNodeNum
SimpleFluidCoolerInlet(FluidCoolerNum)%WaterTemp = Node(WaterInletNode)%Temp
IF (SimpleFluidCooler(FluidCoolerNum)%OutdoorAirInletNodeNum /= 0) THEN
SimpleFluidCoolerInlet(FluidCoolerNum)%AirTemp = Node(SimpleFluidCooler(FluidCoolerNum)%OutdoorAirInletNodeNum)%Temp
SimpleFluidCoolerInlet(FluidCoolerNum)%AirHumRat = Node(SimpleFluidCooler(FluidCoolerNum)%OutdoorAirInletNodeNum)%HumRat
SimpleFluidCoolerInlet(FluidCoolerNum)%AirPress = Node(SimpleFluidCooler(FluidCoolerNum)%OutdoorAirInletNodeNum)%Press
SimpleFluidCoolerInlet(FluidCoolerNum)%AirWetBulb = &
Node(SimpleFluidCooler(FluidCoolerNum)%OutdoorAirInletNodeNum)%OutAirWetBulb
ELSE
SimpleFluidCoolerInlet(FluidCoolerNum)%AirTemp = OutDryBulbTemp
SimpleFluidCoolerInlet(FluidCoolerNum)%AirHumRat = OutHumRat
SimpleFluidCoolerInlet(FluidCoolerNum)%AirPress = OutBaroPress
SimpleFluidCoolerInlet(FluidCoolerNum)%AirWetBulb = OutWetBulbTemp
ENDIF
LoopNum = SimpleFluidCooler(FluidCoolerNum)%LoopNum
LoopSideNum = SimpleFluidCooler(FluidCoolerNum)%LoopSideNum
BranchIndex = SimpleFluidCooler(FluidCoolerNum)%BranchNum
CompIndex = SimpleFluidCooler(FluidCoolerNum)%CompNum
WaterMassFlowRate = RegulateCondenserCompFlowReqOp(SimpleFluidCooler(FluidCoolerNum)%LoopNum, &
SimpleFluidCooler(FluidCoolerNum)%LoopSideNum, &
SimpleFluidCooler(FluidCoolerNum)%BranchNum, &
SimpleFluidCooler(FluidCoolerNum)%CompNum, &
SimpleFluidCooler(FluidCoolerNum)%DesWaterMassFlowRate * &
SimpleFluidCooler(FluidCoolerNum)%FluidCoolerMassFlowRateMultiplier)
CALL SetComponentFlowRate(WaterMassFlowRate, &
SimpleFluidCooler(FluidCoolerNum)%WaterInletNodeNum, &
SimpleFluidCooler(FluidCoolerNum)%WaterOutletNodeNum, &
SimpleFluidCooler(FluidCoolerNum)%LoopNum, &
SimpleFluidCooler(FluidCoolerNum)%LoopSideNum, &
SimpleFluidCooler(FluidCoolerNum)%BranchNum, &
SimpleFluidCooler(FluidCoolerNum)%CompNum)
RETURN
END SUBROUTINE InitFluidCooler