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) | :: | LoopNum | |||
integer, | intent(in) | :: | LoopSideNum |
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 CheckForRunawayPlantTemps(LoopNum,LoopSideNum)
! SUBROUTINE INFORMATION:
! AUTHOR Brent Griffith
! DATE WRITTEN Sept 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Check for plant control errors revealed as run away fluid temps
! halt program so it won't siliently run in out of control state
! METHODOLOGY EMPLOYED:
! compare plant temps to plant min and max and halt if things run away
! sensitivity can be adjusted with parameters, picked somewhat arbitrary
! REFERENCES:
! na
! USE STATEMENTS:
USE DataLoopNode, ONLY : Node, NodeID
USE DataPlant, ONLY : PlantLoop, SupplySide, DemandSide, PlantReport, ShowBranchesOnLoop
USE DataInterfaces, ONLY : ShowFatalError, ShowSevereError, ShowContinueError, ShowContinueErrorTimeStamp, &
ShowRecurringWarningErrorAtEnd
USE DataGlobals, ONLY : WarmupFlag, DoingSizing
USE General, ONLY : RoundSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: LoopNum
INTEGER, INTENT(IN) :: LoopSideNum
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64) , PARAMETER :: OverShootOffset = 5.d0
REAL(r64) , PARAMETER :: UnderShootOffset = 5.d0
REAL(r64) , PARAMETER :: FatalOverShootOffset = 200.d0
REAL(r64) , PARAMETER :: FatalUnderShootOffset = 100.d0
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=4) :: hotcold
LOGICAL :: makefatalerror
CHARACTER(len=10) :: DemandSupply
INTEGER :: LSN
INTEGER :: BrN
INTEGER :: CpN
REAL(r64) :: LoopCapacity
REAL(r64) :: LoopDemandSideCapacity
REAL(r64) :: LoopSupplySideCapacity
REAL(r64) :: DispatchedCapacity
REAL(r64) :: LoopDemandSideDispatchedCapacity
REAL(r64) :: LoopSupplySideDispatchedCapacity
makefatalerror=.false.
IF (Node(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%NodeNumOut)%Temp > (PlantLoop(LoopNum)%MaxTemp + OverShootOffset )) THEN
! first stage, throw recurring warning that plant loop is getting out of control
CALL ShowRecurringWarningErrorAtEnd('Plant loop exceeding upper temperature limit, PlantLoop="' // &
TRIM(PlantLoop(LoopNum)%Name)//'"' , PlantLoop(LoopNum)%MaxTempErrIndex, &
ReportMaxOf=Node(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%NodeNumOut)%Temp )
IF (Node(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%NodeNumOut)%Temp &
> (PlantLoop(LoopNum)%MaxTemp + FatalOverShootOffset )) THEN
hotcold='hot'
makefatalerror=.true.
ENDIF
ENDIF
IF (Node(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%NodeNumOut)%Temp < (PlantLoop(LoopNum)%MinTemp - UnderShootOffset )) THEN
! first stage, throw recurring warning that plant loop is getting out of control
CALL ShowRecurringWarningErrorAtEnd('Plant loop falling below lower temperature limit, PlantLoop="' // &
TRIM(PlantLoop(LoopNum)%Name)//'"' , PlantLoop(LoopNum)%MinTempErrIndex, &
ReportMinOf=Node(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%NodeNumOut)%Temp )
IF (Node(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%NodeNumOut)%Temp &
< (PlantLoop(LoopNum)%MinTemp - FatalUnderShootOffset )) THEN
hotcold='cold'
makefatalerror=.true.
ENDIF
ENDIF
IF (makefatalerror) THEN
CALL ShowSevereError('Plant temperatures are getting far too '//trim(hotcold)// &
', check controls and relative loads and capacities')
CALL ShowContinueErrorTimeStamp('')
IF (LoopSideNum == DemandSide) THEN
DemandSupply='Demand'
ELSEIF (LoopSideNum == SupplySide) THEN
DemandSupply='Supply'
ELSE
DemandSupply='Unknown'
ENDIF
CALL ShowContinueError('PlantLoop Name ('//trim(DemandSupply)//'Side)= '//TRIM(PlantLoop(LoopNum)%Name) )
CALL ShowContinueError('PlantLoop Setpoint Temperature='// &
TRIM(RoundSigDigits(Node(PlantLoop(LoopNum)%TempSetPointNodeNum)%TempSetPoint,1))//' {C}')
IF (PlantLoop(LoopNum)%LoopSide(SupplySide)%InletNodeSetPt) THEN
CALL ShowContinueError('PlantLoop Inlet Node (SupplySide) has a Setpoint.')
ELSE
CALL ShowContinueError('PlantLoop Inlet Node (SupplySide) does not have a Setpoint.')
ENDIF
IF (PlantLoop(LoopNum)%LoopSide(DemandSide)%InletNodeSetPt) THEN
CALL ShowContinueError('PlantLoop Inlet Node (DemandSide) has a Setpoint.')
ELSE
CALL ShowContinueError('PlantLoop Inlet Node (DemandSide) does not have a Setpoint.')
ENDIF
IF (PlantLoop(LoopNum)%LoopSide(SupplySide)%OutletNodeSetPt) THEN
CALL ShowContinueError('PlantLoop Outlet Node (SupplySide) has a Setpoint.')
ELSE
CALL ShowContinueError('PlantLoop Outlet Node (SupplySide) does not have a Setpoint.')
ENDIF
IF (PlantLoop(LoopNum)%LoopSide(DemandSide)%OutletNodeSetPt) THEN
CALL ShowContinueError('PlantLoop Outlet Node (DemandSide) has a Setpoint.')
ELSE
CALL ShowContinueError('PlantLoop Outlet Node (DemandSide) does not have a Setpoint.')
ENDIF
CALL ShowContinueError('PlantLoop Outlet Node ('//trim(DemandSupply)//'Side) "'// &
TRIM(NodeID(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%NodeNumOut))// &
'" has temperature='// &
TRIM(RoundSigDigits(Node(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%NodeNumOut)%Temp,1))//' {C}')
CALL ShowContinueError('PlantLoop Inlet Node ('//trim(DemandSupply)//'Side) "'// &
TRIM(NodeID(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%NodeNumIn))// &
'" has temperature='// &
TRIM(RoundSigDigits(Node(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%NodeNumIn)%Temp,1))//' {C}')
CALL ShowContinueError('PlantLoop Minimum Temperature='// &
trim(RoundSigDigits(PlantLoop(LoopNum)%MinTemp,1))//' {C}')
CALL ShowContinueError('PlantLoop Maximum Temperature='// &
trim(RoundSigDigits(PlantLoop(LoopNum)%MaxTemp,1))//' {C}')
CALL ShowContinueError('PlantLoop Flow Request (SupplySide)='// &
trim(RoundSigDigits(PlantLoop(LoopNum)%LoopSide(SupplySide)%FlowRequest,1))// ' {kg/s}')
CALL ShowContinueError('PlantLoop Flow Request (DemandSide)='// &
trim(RoundSigDigits(PlantLoop(LoopNum)%LoopSide(DemandSide)%FlowRequest,1))// ' {kg/s}')
CALL ShowContinueError('PlantLoop Node ('//trim(DemandSupply)//'Side) "'// &
TRIM(NodeID(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%NodeNumOut))// &
'" has mass flow rate ='// &
TRIM(RoundSigDigits(Node(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%NodeNumOut)%MassFlowRate,1))//' {kg/s}')
CALL ShowContinueError('PlantLoop PumpHeat (SupplySide)='// &
trim(RoundSigDigits(PlantLoop(LoopNum)%LoopSide(SupplySide)%TotalPumpHeat,1))//' {W}')
CALL ShowContinueError('PlantLoop PumpHeat (DemandSide)='// &
trim(RoundSigDigits(PlantLoop(LoopNum)%LoopSide(DemandSide)%TotalPumpHeat,1))//' {W}')
CALL ShowContinueError('PlantLoop Cooling Demand='//trim(RoundSigDigits(PlantReport(LoopNum)%CoolingDemand,1))//' {W}')
CALL ShowContinueError('PlantLoop Heating Demand='//trim(RoundSigDigits(PlantReport(LoopNum)%HeatingDemand,1))//' {W}')
CALL ShowContinueError('PlantLoop Demand not Dispatched='// &
trim(RoundSigDigits(PlantReport(LoopNum)%DemandNotDispatched,1))//' {W}')
CALL ShowContinueError('PlantLoop Unmet Demand='//trim(RoundSigDigits(PlantReport(LoopNum)%UnMetDemand,1))//' {W}')
LoopCapacity=0.0d0
DispatchedCapacity = 0.d0
DO LSN=DemandSide,SupplySide
DO BrN=1,PlantLoop(LoopNum)%LoopSide(LSN)%TotalBranches
DO CpN=1,PlantLoop(LoopNum)%LoopSide(LSN)%Branch(BrN)%TotalComponents
LoopCapacity=LoopCapacity+PlantLoop(LoopNum)%LoopSide(LSN)%Branch(BrN)%Comp(CpN)%MaxLoad
DispatchedCapacity = DispatchedCapacity + ABS(PlantLoop(LoopNum)%LoopSide(LSN)%Branch(BrN)%Comp(CpN)%MyLoad)
ENDDO
ENDDO
IF (LSN == DemandSide) THEN
LoopDemandSideCapacity=LoopCapacity
LoopDemandSideDispatchedCapacity = DispatchedCapacity
ELSE
LoopSupplySideCapacity=LoopCapacity-LoopDemandSideCapacity
LoopSupplySideDispatchedCapacity = DispatchedCapacity-LoopDemandSideDispatchedCapacity
ENDIF
ENDDO
CALL ShowContinueError('PlantLoop Capacity='//trim(RoundSigDigits(LoopCapacity,1))//' {W}')
CALL ShowContinueError('PlantLoop Capacity (SupplySide)='//trim(RoundSigDigits(LoopSupplySideCapacity,1))//' {W}')
CALL ShowContinueError('PlantLoop Capacity (DemandSide)='//trim(RoundSigDigits(LoopDemandSideCapacity,1))//' {W}')
CALL ShowContinueError('PlantLoop Operation Scheme='//trim(PlantLoop(LoopNum)%OperationScheme))
CALL ShowContinueError('PlantLoop Operation Dispatched Load = '//trim(RoundSigDigits(DispatchedCapacity, 1))// ' {W}')
CALL ShowContinueError('PlantLoop Operation Dispatched Load (SupplySide)= ' &
//trim(RoundSigDigits(LoopSupplySideDispatchedCapacity, 1))// ' {W}')
CALL ShowContinueError('PlantLoop Operation Dispatched Load (DemandSide)= ' &
//trim(RoundSigDigits(LoopDemandSideDispatchedCapacity, 1))// ' {W}')
CALL ShowContinueError('Branches on the Loop.')
CALL ShowBranchesOnLoop(LoopNum)
CALL ShowContinueError('*************************')
CALL ShowContinueError('Possible things to look for to correct this problem are:')
CALL ShowContinueError(' Capacity, Operation Scheme, Mass flow problems, Pump Heat building up over time.')
CALL ShowContinueError(' Try a shorter runperiod to stop before it fatals and look at')
CALL ShowContinueError(' lots of node time series data to see what is going wrong.')
CALL ShowContinueError(' If this is happening during Warmup, you can use Output:Diagnostics,ReportDuringWarmup;')
CALL ShowContinueError(' This is detected at the loop level, but the typical problems are in the components.')
CALL ShowFatalError('CheckForRunawayPlantTemps: Simulation terminated because of run away plant temperatures, too '// &
trim(hotcold))
ENDIF
RETURN
END SUBROUTINE CheckForRunawayPlantTemps