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 InitRefrigerationPlantConnections
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith
! DATE WRITTEN Dec 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! do inits that should only occur when component model routines
! are entered from plant, for water cooled Condensers and Refrigeration Racks
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
USE DataPlant, ONLY:PlantLoop, ScanPlantLoopsForObject, TypeOf_RefrigSystemWaterCondenser, &
TypeOf_RefrigerationWaterCoolRack
USE PlantUtilities, ONLY: InitComponentNodes
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:
LOGICAL, SAVE :: MyBeginEnvrnFlag = .TRUE.
LOGICAL :: errFlag = .FALSE.
INTEGER :: RefCondLoop = 0 ! loop over Condenser
INTEGER :: RefCompRackLoop = 0 ! loop over RefrigRack
REAL(r64) :: rho ! local fluid property for cooling water
!initialize plant topology information, if applicable
IF (MyReferPlantScanFlag .AND. ALLOCATED(PlantLoop)) THEN
DO RefCondLoop = 1, NumRefrigCondensers
IF (.NOT. Condenser(RefCondLoop)%CondenserType == RefrigCondenserTypeWater) CYCLE
errFlag = .FALSE.
CALL ScanPlantLoopsForObject( Condenser(RefCondLoop)%Name, &
TypeOf_RefrigSystemWaterCondenser, &
Condenser(RefCondLoop)%PlantLoopNum, &
Condenser(RefCondLoop)%PlantLoopSideNum, &
Condenser(RefCondLoop)%PlantBranchNum, &
Condenser(RefCondLoop)%PlantCompNum, &
errFlag = errFlag )
IF (errFlag) THEN
CALL ShowFatalError('InitRefrigerationPlantConnections: Program terminated due to previous condition(s).')
ENDIF
rho = GetDensityGlycol( PlantLoop(Condenser(RefCondLoop)%PlantLoopNum)%FluidName, &
20.D0, &
PlantLoop(Condenser(RefCondLoop)%PlantLoopNum)%FluidIndex, &
'InitRefrigeration')
IF ( Condenser(RefCondLoop)%FlowType == ConstantFlow ) THEN
Condenser(RefCondLoop)%MassFlowRateMax = Condenser(RefCondLoop)%DesVolFlowRate * rho
ELSEIF (Condenser(RefCondLoop)%FlowType == VariableFlow) THEN
Condenser(RefCondLoop)%MassFlowRateMax = Condenser(RefCondLoop)%VolFlowRateMax * rho
ENDIF
ENDDO
DO RefCompRackLoop = 1, NumRefrigeratedRacks
IF (.NOT. RefrigRack(RefCompRackLoop)%CondenserType == RefrigCondenserTypeWater) CYCLE
errFlag = .FALSE.
CALL ScanPlantLoopsForObject( RefrigRack(RefCompRackLoop)%Name, &
TypeOf_RefrigerationWaterCoolRack, &
RefrigRack(RefCompRackLoop)%PlantLoopNum, &
RefrigRack(RefCompRackLoop)%PlantLoopSideNum, &
RefrigRack(RefCompRackLoop)%PlantBranchNum, &
RefrigRack(RefCompRackLoop)%PlantCompNum, &
errFlag = errFlag )
IF (errFlag) THEN
CALL ShowFatalError('InitRefrigerationPlantConnections: Program terminated due to previous condition(s).')
ENDIF
rho = GetDensityGlycol( PlantLoop(RefrigRack(RefCompRackLoop)%PlantLoopNum)%FluidName, &
20.D0, &
PlantLoop(RefrigRack(RefCompRackLoop)%PlantLoopNum)%FluidIndex, &
'InitRefrigeration')
IF ( RefrigRack(RefCompRackLoop)%FlowType == ConstantFlow ) THEN
RefrigRack(RefCompRackLoop)%MassFlowRateMax = RefrigRack(RefCompRackLoop)%DesVolFlowRate * rho
ELSEIF ( RefrigRack(RefCompRackLoop)%FlowType == VariableFlow) THEN
RefrigRack(RefCompRackLoop)%MassFlowRateMax = RefrigRack(RefCompRackLoop)%VolFlowRateMax * rho
ENDIF
ENDDO
MyReferPlantScanFlag = .FALSE.
ELSEIF (MyReferPlantScanFlag .AND. .NOT. AnyPlantInModel) THEN
MyReferPlantScanFlag = .FALSE.
ENDIF
IF(BeginEnvrnFlag .AND. MyBeginEnvrnFlag)THEN
! do plant inits, if applicable
IF (.NOT. MyReferPlantScanFlag) THEN
DO RefCondLoop = 1, NumRefrigCondensers
IF (.NOT. Condenser(RefCondLoop)%CondenserType == RefrigCondenserTypeWater) CYCLE
rho = GetDensityGlycol(PlantLoop(Condenser(RefCondLoop)%PlantLoopNum)%FluidName, &
20.d0, &
PlantLoop(Condenser(RefCondLoop)%PlantLoopNum)%FluidIndex, &
'InitRefrigeration')
IF ( Condenser(RefCondLoop)%FlowType == ConstantFlow ) THEN
Condenser(RefCondLoop)%MassFlowRateMax = Condenser(RefCondLoop)%DesVolFlowRate * rho
ELSEIF (Condenser(RefCondLoop)%FlowType == VariableFlow) THEN
Condenser(RefCondLoop)%MassFlowRateMax = Condenser(RefCondLoop)%VolFlowRateMax * rho
ENDIF
CALL InitComponentNodes(0.d0, Condenser(RefCondLoop)%MassFlowRateMax, &
Condenser(RefCondLoop)%InletNode, &
Condenser(RefCondLoop)%OutletNode, &
Condenser(RefCondLoop)%PlantLoopNum, &
Condenser(RefCondLoop)%PlantLoopSideNum, &
Condenser(RefCondLoop)%PlantBranchNum, &
Condenser(RefCondLoop)%PlantCompNum)
ENDDO
DO RefCompRackLoop = 1, NumRefrigeratedRacks
IF (.NOT. RefrigRack(RefCompRackLoop)%CondenserType == RefrigCondenserTypeWater) CYCLE
rho = GetDensityGlycol(PlantLoop(RefrigRack(RefCompRackLoop)%PlantLoopNum)%FluidName, &
20.d0, &
PlantLoop(RefrigRack(RefCompRackLoop)%PlantLoopNum)%FluidIndex, &
'InitRefrigeration')
IF ( RefrigRack(RefCompRackLoop)%FlowType == ConstantFlow ) THEN
RefrigRack(RefCompRackLoop)%MassFlowRateMax = RefrigRack(RefCompRackLoop)%DesVolFlowRate * rho
ELSEIF ( RefrigRack(RefCompRackLoop)%FlowType == VariableFlow) THEN
RefrigRack(RefCompRackLoop)%MassFlowRateMax = RefrigRack(RefCompRackLoop)%VolFlowRateMax * rho
ENDIF
CALL InitComponentNodes(0.d0, RefrigRack(RefCompRackLoop)%MassFlowRateMax, &
RefrigRack(RefCompRackLoop)%InletNode, &
RefrigRack(RefCompRackLoop)%OutletNode, &
RefrigRack(RefCompRackLoop)%PlantLoopNum, &
RefrigRack(RefCompRackLoop)%PlantLoopSideNum, &
RefrigRack(RefCompRackLoop)%PlantBranchNum, &
RefrigRack(RefCompRackLoop)%PlantCompNum)
ENDDO
ENDIF
MyBeginEnvrnFlag = .FALSE.
END IF !(BeginEnvrnFlag .AND. MyBeginEnvrnFlag)
IF(.NOT. BeginEnvrnFlag)MyBeginEnvrnFlag = .TRUE.
RETURN
END SUBROUTINE InitRefrigerationPlantConnections