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) | :: | ProfileNum |
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 InitPlantProfile(ProfileNum )
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN January 2004
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Initializes the plant load profile object during the plant simulation.
! METHODOLOGY EMPLOYED:
! Inlet and outlet nodes are initialized. The scheduled load and flow rate is obtained, flow is requested, and the
! actual available flow is set.
! USE STATEMENTS:
USE DataGlobals, ONLY: SysSizingCalc
USE PlantUtilities, ONLY: RegisterPlantCompDesignFlow
USE DataLoopNode, ONLY: Node
USE ScheduleManager, ONLY: GetCurrentScheduleValue, GetScheduleMaxValue
USE FluidProperties, ONLY: GetDensityGlycol
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: ProfileNum
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: InletNode
INTEGER :: OutletNode
REAL(r64) :: MaxFlowMultiplier
REAL(R64) :: FluidDensityInit
LOGICAL :: errFlag
! FLOW:
! Do the one time initializations
IF(PlantProfile(ProfileNum)%SetLoopIndexFlag)THEN
IF(ALLOCATED(PlantLoop))THEN
errFlag=.false.
CALL ScanPlantLoopsForObject(PlantProfile(ProfileNum)%Name, &
PlantProfile(ProfileNum)%TypeNum, &
PlantProfile(ProfileNum)%WLoopNum, &
PlantProfile(ProfileNum)%WLoopSideNum, &
PlantProfile(ProfileNum)%WLoopBranchNum, &
PlantProfile(ProfileNum)%WLoopCompNum, &
errFlag=errFlag)
IF (errFlag) THEN
CALL ShowFatalError('InitPlantProfile: Program terminated for previous conditions.')
ENDIF
PlantProfile(ProfileNum)%SetLoopIndexFlag = .FALSE.
ENDIF
ENDIF
! FLOW:
InletNode = PlantProfile(ProfileNum)%InletNode
OutletNode = PlantProfile(ProfileNum)%OutletNode
IF (.NOT. SysSizingCalc .AND. PlantProfile(ProfileNum)%InitSizing) THEN
CALL RegisterPlantCompDesignFlow(InletNode, PlantProfile(ProfileNum)%PeakVolFlowRate)
PlantProfile(ProfileNum)%InitSizing = .FALSE.
END IF
IF (BeginEnvrnFlag .AND. PlantProfile(ProfileNum)%Init) THEN
! Clear node initial conditions
!DSU? can we centralize these temperature inits
! Node(InletNode)%Temp = 0.0
Node(OutletNode)%Temp = 0.0d0
FluidDensityInit = GetDensityGlycol(PlantLoop(PlantProfile(ProfileNum)%WLoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(PlantProfile(ProfileNum)%WLoopNum)%FluidIndex,'InitPlantProfile')
MaxFlowMultiplier = GetScheduleMaxValue(PlantProfile(ProfileNum)%FlowRateFracSchedule)
CALL InitComponentNodes(0.d0, PlantProfile(ProfileNum)%PeakVolFlowRate*FluidDensityInit*MaxFlowMultiplier, &
InletNode,OutletNode, &
PlantProfile(ProfileNum)%WLoopNum,PlantProfile(ProfileNum)%WLoopSideNum, &
PlantProfile(ProfileNum)%WLoopBranchNum, PlantProfile(ProfileNum)%WLoopCompNum)
PlantProfile(ProfileNum)%EMSOverrideMassFlow = .FALSE.
PlantProfile(ProfileNum)%EMSMassFlowValue = 0.d0
PlantProfile(ProfileNum)%EMSOverridePower = .FALSE.
PlantProfile(ProfileNum)%EMSPowerValue = 0.d0
PlantProfile(ProfileNum)%Init = .FALSE.
END IF
IF (.NOT. BeginEnvrnFlag) PlantProfile(ProfileNum)%Init = .TRUE.
PlantProfile(ProfileNum)%InletTemp = Node(InletNode)%Temp
PlantProfile(ProfileNum)%Power = GetCurrentScheduleValue(PlantProfile(ProfileNum)%LoadSchedule)
IF (PlantProfile(ProfileNum)%EMSOverridePower) PlantProfile(ProfileNum)%Power = PlantProfile(ProfileNum)%EMSPowerValue
FluidDensityInit = GetDensityGlycol(PlantLoop(PlantProfile(ProfileNum)%WLoopNum)%FluidName, &
PlantProfile(ProfileNum)%InletTemp, &
PlantLoop(PlantProfile(ProfileNum)%WLoopNum)%FluidIndex,'InitPlantProfile')
! Get the scheduled mass flow rate
PlantProfile(ProfileNum)%VolFlowRate = PlantProfile(ProfileNum)%PeakVolFlowRate * &
GetCurrentScheduleValue(PlantProfile(ProfileNum)%FlowRateFracSchedule)
PlantProfile(ProfileNum)%MassFlowRate = PlantProfile(ProfileNum)%VolFlowRate * FluidDensityInit
IF (PlantProfile(ProfileNum)%EMSOverrideMassFlow) &
PlantProfile(ProfileNum)%MassFlowRate = PlantProfile(ProfileNum)%EMSMassFlowValue
! Request the mass flow rate from the plant component flow utility routine
CALL SetComponentFlowRate(PlantProfile(ProfileNum)%MassFlowRate,InletNode,OutletNode, &
PlantProfile(ProfileNum)%WLoopNum,PlantProfile(ProfileNum)%WLoopSideNum, &
PlantProfile(ProfileNum)%WLoopBranchNum, PlantProfile(ProfileNum)%WLoopCompNum)
PlantProfile(ProfileNum)%VolFlowRate = PlantProfile(ProfileNum)%MassFlowRate / FluidDensityInit
RETURN
END SUBROUTINE InitPlantProfile