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) | :: | BoilerNum |
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 InitBoiler(BoilerNum)
! SUBROUTINE INFORMATION:
! AUTHOR Rahul Chillar
! DATE WRITTEN Dec 2004
! MODIFIED na
! RE-ENGINEERED D. Shirey, rework for plant upgrade
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for initializations of the Boiler components
! METHODOLOGY EMPLOYED:
! Uses the status flags to trigger initializations.
! REFERENCES:
! Na
! USE STATEMENTS:
USE FluidProperties, ONLY : GetSatDensityRefrig, GetSatEnthalpyRefrig, GetSatSpecificHeatRefrig
USE DataPlant, ONLY : TypeOf_Boiler_Steam, ScanPlantLoopsForObject, PlantLoop, &
PlantSizesOkayToFinalize, PlantSizeNotComplete, &
SingleSetpoint, DualSetpointDeadband
USE PlantUtilities, ONLY : InitComponentNodes
USE EMSManager, ONLY : iTemperatureSetpoint, CheckIfNodeSetpointManagedByEMS
USE DataGlobals, ONLY : AnyEnergyManagementSystemInModel
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: BoilerNum ! number of the current electric chiller being simulated
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL,SAVE :: MyOneTimeFlag = .true.
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MyFlag
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MyEnvrnFlag
LOGICAL :: FatalError
REAL(r64) :: TempUpLimitBoilerOut ! C - Boiler outlet maximum temperature limit
REAL(r64) :: EnthSteamOutWet
REAL(r64) :: EnthSteamOutDry
REAL(r64) :: LatentEnthSteam
REAL(r64) :: CpWater ! Heat capacity of condensed steam (liquid)
INTEGER :: BoilerInletNode ! Boiler inlet node number
INTEGER :: BoilerOutletNode ! Boiler outlet node number
LOGICAL :: errFlag
! Do the one time initializations
IF (MyOneTimeFlag) THEN
ALLOCATE(MyFlag(NumBoilers))
ALLOCATE(MyEnvrnFlag(NumBoilers))
MyFlag = .TRUE.
MyEnvrnFlag = .TRUE.
MyOneTimeFlag = .false.
END IF
! Init more variables
IF (MyFlag(BoilerNum)) THEN
! Locate the chillers on the plant loops for later usage
errFlag=.false.
CALL ScanPlantLoopsForObject(Boiler(BoilerNum)%Name, &
TypeOf_Boiler_Steam, &
Boiler(BoilerNum)%LoopNum, &
Boiler(BoilerNum)%LoopSideNum, &
Boiler(BoilerNum)%BranchNum, &
Boiler(BoilerNum)%CompNum, &
errFlag=errFlag)
IF (errFlag) THEN
CALL ShowFatalError('InitBoiler: Program terminated due to previous condition(s).')
ENDIF
MyFlag(BoilerNum)=.FALSE.
ENDIF
BoilerInletNode = Boiler(BoilerNum)%BoilerInletNodeNum
BoilerOutletNode = Boiler(BoilerNum)%BoilerOutletNodeNum
IF (BeginEnvrnFlag .and. MyEnvrnFlag(BoilerNum).AND. (PlantSizesOkayToFinalize)) THEN
IF (PlantSizeNotComplete) CALL SizeBoiler(BoilerNum)
!BoilerOutletTemp = Node(BoilerOutletNode)%TempSetPoint
!TempUpLimitBoilerOut =Boiler(BoilerNum)%TempUpLimitBoilerOut
! TempUpLimitBoilerOut = Node(BoilerOutletNode)%TempSetPoint
TempUpLimitBoilerOut = Boiler(BoilerNum)%TempUpLimitBoilerOut ! Design Outlet Steam Temperature
EnthSteamOutDry= GetSatEnthalpyRefrig('STEAM',TempUpLimitBoilerOut,1.0d0,Boiler(BoilerNum)%FluidIndex,'InitBoiler')
EnthSteamOutWet= GetSatEnthalpyRefrig('STEAM',TempUpLimitBoilerOut,0.0d0,Boiler(BoilerNum)%FluidIndex,'InitBoiler')
LatentEnthSteam= EnthSteamOutDry-EnthSteamOutWet
CpWater = GetSatSpecificHeatRefrig('STEAM',TempUpLimitBoilerOut,0.0d0,Boiler(BoilerNum)%FluidIndex,'InitBoiler')
Boiler(BoilerNum)%DesMassFlowRate = Boiler(BoilerNum)%NomCap/(LatentEnthSteam + &
CpWater * (TempUpLimitBoilerOut-Node(BoilerInletNode)%Temp))
CALL InitComponentNodes(0.d0,Boiler(BoilerNum)%DesMassFlowRate, &
Boiler(BoilerNum)%BoilerInletNodeNum, &
Boiler(BoilerNum)%BoilerOutletNodeNum, &
Boiler(BoilerNum)%LoopNum, &
Boiler(BoilerNum)%LoopSideNum, &
Boiler(BoilerNum)%BranchNum, &
Boiler(BoilerNum)%CompNum)
Boiler(BoilerNum)%BoilerPressCheck = 0.0d0
FuelUsed = 0.0d0
BoilerLoad = 0.0d0
! BoilerMassFlowRate = 0.0
BoilerOutletTemp = 0.0d0
BoilerMaxPress = 0.0d0
! BoilerMassFlowMaxAvail = 0.0
! BoilerMassFlowMinAvail = 0.0
IF ((Node(Boiler(BoilerNum)%BoilerOutletNodeNum)%TempSetPoint == SensedNodeFlagValue) .AND. &
(Node(Boiler(BoilerNum)%BoilerOutletNodeNum)%TempSetPointLo == SensedNodeFlagValue)) THEN
IF (.NOT. AnyEnergyManagementSystemInModel) THEN
IF (.NOT. Boiler(BoilerNum)%MissingSetpointErrDone) THEN
CALL ShowWarningError('Missing temperature setpoint for Boiler:Steam = ' // &
TRIM(Boiler(BoilerNum)%Name) )
CALL ShowContinueError(' A temperature setpoint is needed at the outlet node of the boiler,' // &
' use a SetpointManager')
CALL ShowContinueError(' The overall loop setpoint will be assumed for this boiler. The simulation continues ...')
Boiler(BoilerNum)%MissingSetpointErrDone = .TRUE.
ENDIF
ELSE
! need call to EMS to check node
FatalError = .FALSE. ! but not really fatal yet, but should be.
CALL CheckIfNodeSetpointManagedByEMS(Boiler(BoilerNum)%BoilerOutletNodeNum,iTemperatureSetpoint, FatalError)
IF (FatalError) THEN
IF (.NOT. Boiler(BoilerNum)%MissingSetpointErrDone) THEN
CALL ShowWarningError('Missing temperature setpoint for VariableFlow mode Boiler named ' // &
TRIM(Boiler(BoilerNum)%Name) )
CALL ShowContinueError(' A temperature setpoint is needed at the outlet node of the boiler.')
CALL ShowContinueError(' Use a Setpoint Manager to establish a setpoint at the boiler outlet node ')
CALL ShowContinueError(' or use an EMS actuator to establish a setpoint at the boiler outlet node.')
CALL ShowContinueError(' The overall loop setpoint will be assumed for this boiler. The simulation continues...')
Boiler(BoilerNum)%MissingSetpointErrDone = .TRUE.
ENDIF
ENDIF
ENDIF
Boiler(BoilerNum)%UseLoopSetpoint = .TRUE. ! this is for backward compatibility and could be removed
ENDIF
MyEnvrnFlag(BoilerNum) = .FALSE.
END IF ! End If for the Begin Environment initializations
IF (.not. BeginEnvrnFlag) THEN
MyEnvrnFlag(BoilerNum)=.true.
ENDIF
IF (Boiler(BoilerNum)%UseLoopSetpoint) THEN
! At some point, need to circle back and get from plant data structure instead of node
! fix for clumsy old input that worked because loop setpoint was spread.
! could be removed with transition, testing , model change, period of being obsolete.
SELECT CASE (PlantLoop(Boiler(BoilerNum)%LoopNum)%LoopDemandCalcScheme)
CASE (SingleSetPoint)
Node(BoilerOutletNode)%TempSetPoint = &
Node(PlantLoop(Boiler(BoilerNum)%LoopNum)%TempSetPointNodeNum)%TempSetPoint
CASE (DualSetPointDeadBand)
Node(BoilerOutletNode)%TempSetPointLo = &
Node(PlantLoop(Boiler(BoilerNum)%LoopNum)%TempSetPointNodeNum)%TempSetPointLo
END SELECT
END IF
RETURN
END SUBROUTINE InitBoiler