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) | :: | TowerNum |
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 UpdateTowers(TowerNum)
! SUBROUTINE INFORMATION:
! AUTHOR: Dan Fisher
! DATE WRITTEN: October 1998
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for passing results to the outlet water node.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataEnvironment, ONLY: EnvironmentName, CurMnDy
USE General, ONLY: TrimSigDigits
USE DataPlant, ONLY: PlantLoop
USE DataBranchAirLoopPlant, ONLY: MassFlowTolerance
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: TowerNum
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: LowTempFmt="(' ',F6.2)"
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=25) :: CharErrOut
CHARACTER(len=25) :: CharLowOutletTemp
INTEGER :: LoopNum
INTEGER :: LoopSideNum
REAL(r64) :: LoopMinTemp
! set node information
Node(WaterOutletNode)%Temp = OutletWaterTemp
LoopNum = SimpleTower(TowerNum)%LoopNum
LoopSideNum = SimpleTower(TowerNum)%LoopSideNum
IF(PlantLoop(LoopNum)%Loopside(LoopSideNum)%FlowLock.EQ.0 .OR. WarmupFlag) RETURN
!Check flow rate through tower and compare to design flow rate, show warning if greater than Design * Mulitplier
IF (Node(WaterOutletNode)%MassFlowRate .GT. SimpleTower(TowerNum)%DesWaterMassFlowRate * &
SimpleTower(TowerNum)%TowerMassFlowRateMultiplier) THEN
SimpleTower(TowerNum)%HighMassFlowErrorCount=SimpleTower(TowerNum)%HighMassFlowErrorCount+1
IF (SimpleTower(TowerNum)%HighMassFlowErrorCount < 2) THEN
CALL ShowWarningError (TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//'"')
CALL ShowContinueError (' Condenser Loop Mass Flow Rate is much greater than the towers design mass flow rate.')
CALL ShowContinueError (' Condenser Loop Mass Flow Rate = '//TrimSigDigits(Node(WaterOutletNode)%MassFlowRate,6))
CALL ShowContinueError (' Tower Design Mass Flow Rate = '//TrimSigDigits(SimpleTower(TowerNum)%DesWaterMassFlowRate,6))
CALL ShowContinueErrorTimeStamp(' ')
ELSE
CALL ShowRecurringWarningErrorAtEnd(TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//&
'" Condenser Loop Mass Flow Rate is much greater than the towers design mass flow rate error continues...' &
, SimpleTower(TowerNum)%HighMassFlowErrorIndex, Node(WaterOutletNode)%MassFlowRate, Node(WaterOutletNode)%MassFlowRate)
ENDIF
END IF
! Check if OutletWaterTemp is below the minimum condenser loop temp and warn user
LoopMinTemp = PlantLoop(LoopNum)%MinTemp
IF(OutletWaterTemp.LT.LoopMinTemp .AND. WaterMassFlowRate > 0.0d0) THEN
SimpleTower(TowerNum)%OutletWaterTempErrorCount = SimpleTower(TowerNum)%OutletWaterTempErrorCount + 1
WRITE(CharLowOutletTemp,LowTempFmt) LoopMinTemp
WRITE(CharErrOut,LowTempFmt) OutletWaterTemp
CharErrOut=ADJUSTL(CharErrOut)
IF (SimpleTower(TowerNum)%OutletWaterTempErrorCount < 2) THEN
CALL ShowWarningError (TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//'"')
CALL ShowContinueError ('Cooling tower water outlet temperature ('//TRIM(CharErrOut)//' C) is '// &
'below the specified minimum condenser loop temp of '//TRIM(ADJUSTL(CharLowOutletTemp))//' C')
CALL ShowContinueErrorTimeStamp(' ')
ELSE
CALL ShowRecurringWarningErrorAtEnd(TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//&
'" Cooling tower water outlet temperature is below the specified minimum condenser loop temp error continues...' &
, SimpleTower(TowerNum)%OutletWaterTempErrorIndex, OutletWaterTemp, OutletWaterTemp)
END IF
END IF
! Check if water mass flow rate is small (e.g. no flow) and warn user
IF(WaterMassFlowRate .GT. 0.0d0 .AND. WaterMassFlowRate .LE. MassFlowTolerance)THEN
SimpleTower(TowerNum)%SmallWaterMassFlowErrorCount = SimpleTower(TowerNum)%SmallWaterMassFlowErrorCount + 1
IF (SimpleTower(TowerNum)%SmallWaterMassFlowErrorCount < 2) THEN
CALL ShowWarningError (TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//'"')
CALL ShowContinueError ('Cooling tower water mass flow rate near zero.')
CALL ShowContinueErrorTimeStamp(' ')
CALL ShowContinueError('Actual Mass flow = '//TRIM(TrimSigDigits(WaterMassFlowRate,2)))
ELSE
CALL ShowRecurringWarningErrorAtEnd(TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//&
'" Cooling tower water mass flow rate near zero error continues...' &
, SimpleTower(TowerNum)%SmallWaterMassFlowErrorIndex, WaterMassFlowRate, WaterMassFlowRate)
ENDIF
END IF
! Check if water mass flow rate is lower than loop minimum and warn user
! IF(WaterMassFlowRate .LT. LoopMassFlowRateMinAvail)THEN
! SimpleTower(TowerNum)%WMFRLessThanMinAvailErrCount = SimpleTower(TowerNum)%WMFRLessThanMinAvailErrCount + 1
! IF (SimpleTower(TowerNum)%WMFRLessThanMinAvailErrCount < 2) THEN
! CALL ShowWarningError (TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//'"')
! CALL ShowContinueError ('Cooling tower water mass flow below loop minimum.')
! CALL ShowContinueErrorTimeStamp(' ')
! CALL ShowContinueError('Actual Mass flow = '//TRIM(TrimSigDigits(WaterMassFlowRate,2)))
! CALL ShowContinueError('Loop Minimum flow = '//TRIM(TrimSigDigits(LoopMassFlowRateMinAvail,2)))
! ELSE
! CALL ShowRecurringWarningErrorAtEnd(TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//&
! '" Cooling tower water mass flow rate below loop minimum error continues...' &
! , SimpleTower(TowerNum)%WMFRLessThanMinAvailErrIndex, WaterMassFlowRate, WaterMassFlowRate)
! ENDIF
! END IF
! Check if water mass flow rate is greater than loop maximum and warn user
! IF(WaterMassFlowRate .GT. LoopMassFlowRateMaxAvail)THEN
! SimpleTower(TowerNum)%WMFRGreaterThanMaxAvailErrCount = SimpleTower(TowerNum)%WMFRGreaterThanMaxAvailErrCount + 1
! IF (SimpleTower(TowerNum)%WMFRGreaterThanMaxAvailErrCount < 2) THEN
! CALL ShowWarningError (TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//'"')
! CALL ShowContinueError ('Cooling Tower water mass flow above loop maximum.')
! CALL ShowContinueErrorTimeStamp(' ')
! CALL ShowContinueError('Actual Mass flow='//TRIM(TrimSigDigits(WaterMassFlowRate,2)))
! CALL ShowContinueError('Loop Maximum flow = '//TRIM(TrimSigDigits(LoopMassFlowRateMaxAvail,2)))
! ELSE
! CALL ShowRecurringWarningErrorAtEnd(TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//&
! '" Cooling tower water mass flow rate above loop maximum error continues...' &
! , SimpleTower(TowerNum)%WMFRGreaterThanMaxAvailErrIndex, WaterMassFlowRate, WaterMassFlowRate)
! ENDIF
! END IF
RETURN
END SUBROUTINE UpdateTowers