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 | ||
---|---|---|---|---|---|---|
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.
SUBROUTINE SimulateWaterUse(FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN August 2006
! MODIFIED Brent Griffith, March 2010, seperated plant connected to different sim routine
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine is called from non zone equipment manager and serves to call
! water use and connections that are not connected to a full plant loop
! METHODOLOGY EMPLOYED:
!
! USE STATEMENTS:
USE General, ONLY: RoundSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: MaxIterations = 100
REAL(r64), PARAMETER :: Tolerance = 0.1d0 ! Make input?
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(IN) :: FirstHVACIteration
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: WaterEquipNum
INTEGER :: WaterConnNum
INTEGER :: NumIteration
INTEGER, SAVE :: MaxIterationsErrorCount
LOGICAL, SAVE :: MyEnvrnFlag = .TRUE.
! FLOW:
IF (GetWaterUseInputFlag) THEN
CALL GetWaterUseInput
GetWaterUseInputFlag = .FALSE.
END IF
IF (BeginEnvrnFlag .and. MyEnvrnFlag) THEN
MaxIterationsErrorCount = 0
IF (NumWaterEquipment > 0) THEN
WaterEquipment%SensibleRate = 0.0d0
WaterEquipment%SensibleEnergy = 0.0d0
WaterEquipment%LatentRate = 0.0d0
WaterEquipment%LatentEnergy = 0.0d0
WaterEquipment%MixedTemp = 0.0d0
WaterEquipment%TotalMassFlowRate = 0.0d0
WaterEquipment%DrainTemp = 0.0d0
ENDIF
IF (NumWaterConnections > 0) THEN
WaterConnections%TotalMassFlowRate = 0.0d0
ENDIF
MyEnvrnFlag = .false.
END IF
If ( .NOT. BeginEnvrnFlag) MyEnvrnFlag = .TRUE.
! Simulate all unconnected WATER USE EQUIPMENT objects
DO WaterEquipNum = 1, NumWaterEquipment
IF (WaterEquipment(WaterEquipNum)%Connections == 0) THEN
CALL CalcEquipmentFlowRates(WaterEquipNum)
CALL CalcEquipmentDrainTemp(WaterEquipNum)
END IF
END DO ! WaterEquipNum
CALL ReportStandAloneWaterUse
! Simulate WATER USE CONNECTIONS objects and connected WATER USE EQUIPMENT objects
DO WaterConnNum = 1, NumWaterConnections
IF (.NOT. WaterConnections(WaterConnNum)%StandAlone ) CYCLE ! only model non plant connections here
CALL InitConnections(WaterConnNum)
NumIteration = 0
DO WHILE (.TRUE.)
NumIteration = NumIteration + 1
CALL CalcConnectionsFlowRates(WaterConnNum, FirstHVACIteration)
CALL CalcConnectionsDrainTemp(WaterConnNum)
CALL CalcConnectionsHeatRecovery(WaterConnNum)
IF (WaterConnections(WaterConnNum)%TempError < Tolerance) THEN
EXIT
ELSE IF (NumIteration > MaxIterations) THEN
IF (.NOT. WarmupFlag) THEN
IF (WaterConnections(WaterConnNum)%MaxIterationsErrorIndex == 0) THEN
CALL ShowWarningError('WaterUse:Connections = '//TRIM(WaterConnections(WaterConnNum)%Name)// &
': Heat recovery temperature did not converge')
CALL ShowContinueErrorTimeStamp(' ')
ENDIF
CALL ShowRecurringWarningErrorAtEnd('WaterUse:Connections = '//TRIM(WaterConnections(WaterConnNum)%Name)// &
': Heat recovery temperature did not converge', &
WaterConnections(WaterConnNum)%MaxIterationsErrorIndex)
END IF
EXIT
END IF
END DO ! WHILE
CALL UpdateWaterConnections(WaterConnNum)
CALL ReportWaterUse(WaterConnNum)
END DO ! WaterConnNum
RETURN
END SUBROUTINE SimulateWaterUse