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) | :: | GeneratorNum | |||
logical, | intent(in) | :: | RunFlag | |||
real(kind=r64), | intent(in) | :: | MyLoad | |||
logical, | intent(in) | :: | FirstHVACIteration |
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 InitICEngineGenerators(GeneratorNum,RunFlag,MyLoad,FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Dan Fisher
! DATE WRITTEN Oct 2000
! MODIFIED na
! RE-ENGINEERED Brent Griffith, Sept 2010, plant upgrades, generalize fluid props
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for initializations of the IC ENGINE generators.
! METHODOLOGY EMPLOYED:
! Uses the status flags to trigger initializations.
! REFERENCES:
! na
! USE STATEMENTS:
USE FluidProperties, ONLY: GetDensityGlycol
USE DataPlant, ONLY: PlantLoop, ScanPlantLoopsForObject, TypeOf_Generator_ICEngine
USE PlantUtilities, ONLY: SetComponentFlowRate, InitComponentNodes
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: GeneratorNum ! Generator number
LOGICAL, INTENT(IN) :: RunFlag ! TRUE when Generator operating
REAL(r64) , INTENT(IN) :: MyLoad ! Generator demand
LOGICAL, INTENT(IN) :: FirstHVACIteration
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: HeatRecInletNode ! inlet node number in heat recovery loop
INTEGER :: HeatRecOutletNode ! outlet node number in heat recovery loop
LOGICAL,SAVE :: MyOneTimeFlag = .TRUE. ! Initialization flag
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MyEnvrnFlag ! Used for initializations each begin environment flag
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MyPlantScanFlag
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MySizeAndNodeInitFlag
REAL(r64) :: mdot
REAL(r64) :: rho
LOGICAL :: errFlag
! FLOW:
! Do the one time initializations
IF (MyOneTimeFlag) THEN
ALLOCATE(MyEnvrnFlag(NumICEngineGenerators))
ALLOCATE(MyPlantScanFlag(NumICEngineGenerators))
ALLOCATE(MySizeAndNodeInitFlag(NumICEngineGenerators))
MyEnvrnFlag = .TRUE.
MyPlantScanFlag = .TRUE.
MyOneTimeFlag = .FALSE.
MySizeAndNodeInitFlag = .TRUE.
END IF
IF (MyPlantScanFlag(GeneratorNum) .AND. ALLOCATED(PlantLoop) &
.AND. ICEngineGenerator(GeneratorNum)%HeatRecActive) THEN
errFlag = .FALSE.
CALL ScanPlantLoopsForObject(ICEngineGenerator(GeneratorNum)%Name, &
TypeOf_Generator_ICEngine, &
ICEngineGenerator(GeneratorNum)%HRLoopNum, &
ICEngineGenerator(GeneratorNum)%HRLoopSideNum, &
ICEngineGenerator(GeneratorNum)%HRBranchNum, &
ICEngineGenerator(GeneratorNum)%HRCompNum , &
errFlag = errFlag )
IF (errFlag) THEN
CALL ShowFatalError('InitICEngineGenerators: Program terminated due to previous condition(s).')
ENDIF
MyPlantScanFlag(GeneratorNum) = .FALSE.
ENDIF
IF (MySizeAndNodeInitFlag(GeneratorNum) .AND. (.NOT. MyPlantScanFlag(GeneratorNum)) &
.AND. ICEngineGenerator(GeneratorNum)%HeatRecActive ) THEN
HeatRecInletNode = ICEngineGenerator(GeneratorNum)%HeatRecInletNodeNum
HeatRecOutletNode = ICEngineGenerator(GeneratorNum)%HeatRecOutletNodeNum
!size mass flow rate
rho = GetDensityGlycol(PlantLoop(ICEngineGenerator(GeneratorNum)%HRLoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(ICEngineGenerator(GeneratorNum)%HRLoopNum)%FluidIndex, &
'InitICEngineGenerators')
ICEngineGenerator(GeneratorNum)%DesignHeatRecMassFlowRate = rho * ICEngineGenerator(GeneratorNum)%DesignHeatRecVolFlowRate
ICEngineGenerator(GeneratorNum)%HeatRecMdotDesign = ICEngineGenerator(GeneratorNum)%DesignHeatRecMassFlowRate
CALL InitComponentNodes(0.0D0, ICEngineGenerator(GeneratorNum)%DesignHeatRecMassFlowRate, &
HeatRecInletNode, &
HeatRecOutletNode, &
ICEngineGenerator(GeneratorNum)%HRLoopNum, &
ICEngineGenerator(GeneratorNum)%HRLoopSideNum, &
ICEngineGenerator(GeneratorNum)%HRBranchNum, &
ICEngineGenerator(GeneratorNum)%HRCompNum )
MySizeAndNodeInitFlag(GeneratorNum) = .FALSE.
END IF ! end one time inits
! Do the Begin Environment initializations
IF (BeginEnvrnFlag .and. MyEnvrnFlag(GeneratorNum) .AND. ICEngineGenerator(GeneratorNum)%HeatRecActive) THEN
HeatRecInletNode = ICEngineGenerator(GeneratorNum)%HeatRecInletNodeNum
HeatRecOutletNode = ICEngineGenerator(GeneratorNum)%HeatRecOutletNodeNum
! set the node Temperature, assuming freeze control
Node(HeatRecInletNode)%Temp = 20.0d0
Node(HeatRecOutletNode)%Temp = 20.0d0
! set the node max and min mass flow rates
Call InitComponentNodes(0.0D0, ICEngineGenerator(GeneratorNum)%DesignHeatRecMassFlowRate, &
HeatRecInletNode, &
HeatRecOutletNode, &
ICEngineGenerator(GeneratorNum)%HRLoopNum, &
ICEngineGenerator(GeneratorNum)%HRLoopSideNum, &
ICEngineGenerator(GeneratorNum)%HRBranchNum, &
ICEngineGenerator(GeneratorNum)%HRCompNum )
MyEnvrnFlag(GeneratorNum) = .FALSE.
END IF ! end environmental inits
IF (.not. BeginEnvrnFlag) THEN
MyEnvrnFlag(GeneratorNum) = .TRUE.
ENDIF
IF (ICEngineGenerator(GeneratorNum)%HeatRecActive) THEN
IF ( FirstHVACIteration) Then
IF (RunFlag) THEN
mdot = ICEngineGenerator(GeneratorNum)%DesignHeatRecMassFlowRate
ELSE
mdot = 0.d0
ENDIF
CALL SetComponentFlowRate(mdot, &
ICEngineGenerator(GeneratorNum)%HeatRecInletNodeNum, &
ICEngineGenerator(GeneratorNum)%HeatRecOutletNodeNum, &
ICEngineGenerator(GeneratorNum)%HRLoopNum, &
ICEngineGenerator(GeneratorNum)%HRLoopSideNum, &
ICEngineGenerator(GeneratorNum)%HRBranchNum, &
ICEngineGenerator(GeneratorNum)%HRCompNum )
ELSE
CALL SetComponentFlowRate( ICEngineGenerator(GeneratorNum)%HeatRecMdotActual, &
ICEngineGenerator(GeneratorNum)%HeatRecInletNodeNum, &
ICEngineGenerator(GeneratorNum)%HeatRecOutletNodeNum, &
ICEngineGenerator(GeneratorNum)%HRLoopNum, &
ICEngineGenerator(GeneratorNum)%HRLoopSideNum, &
ICEngineGenerator(GeneratorNum)%HRBranchNum, &
ICEngineGenerator(GeneratorNum)%HRCompNum )
ENDIF
ENDIF
RETURN
END SUBROUTINE InitICEngineGenerators