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) | :: | WaterThermalTankNum | |||
integer, | intent(in), | optional | :: | LoopNum | ||
integer, | intent(in), | optional | :: | 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.
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 SizeSupplySidePlantConnections(WaterThermalTankNum, LoopNum, LoopSideNum)
! SUBROUTINE INFORMATION:
! AUTHOR Brent Griffith
! DATE WRITTEN October 2007
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for sizing water heater plant connection flow rates
! on the supply that have not been specified in the input.
! METHODOLOGY EMPLOYED:
! This routine is called later in the simulation than the sizing routine for the demand side
! because the simulation needs to be further along before the needed data are available.
! For water heaters sides on Supply loopside, obtains hot water flow rate from the plant sizing array
! (adapted approach from boiler sizing routines)
! REFERENCES:
! na
! USE STATEMENTS:
USE DataSizing
USE DataPlant, ONLY : PlantLoop
USE DataInterfaces, ONLY: ShowFatalError, ShowSevereError, ShowContinueError, ShowWarningError
USE DataHVACGlobals, ONLY: SmallWaterVolFlow, NumPlantLoops
USE FluidProperties, ONLY: GetDensityGlycol
USE PlantUtilities, ONLY: RegisterPlantCompDesignFlow
USE ReportSizingManager, ONLY: ReportSizingOutput
USE OutputReportPredefined
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: WaterThermalTankNum
INTEGER, INTENT(IN), OPTIONAL :: LoopNum
INTEGER, INTENT(IN), OPTIONAL :: LoopSideNum
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: PltSizNum ! Plant Sizing index corresponding to CurLoopNum
LOGICAL :: ErrorsFound ! If errors detected in input
INTEGER :: DummyWaterIndex = 1
REAL(r64) :: rho !temporary fluid density
INTEGER :: tmpLoopNum
INTEGER :: tmpLoopSideNum
REAL(r64) :: tmpUseDesignVolFlowRate ! local use side design flow rate
REAL(r64) :: tmpSourceDesignVolFlowRate ! local source side design flow rate
PltSizNum = 0
ErrorsFound = .FALSE.
tmpUseDesignVolFlowRate = WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate
tmpSourceDesignVolFlowRate = WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate
IF (.NOT. PRESENT(LoopSideNum)) THEN
tmpLoopSideNum = SupplySide
ELSE
tmpLoopSideNum = LoopSideNum
ENDIF
IF (.NOT. PRESENT(LoopNum)) THEN
tmpLoopNum = WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopNum
ELSE
tmpLoopNum = LoopNum
ENDIF
IF ((WaterThermalTank(WaterThermalTankNum)%UseInletNode > 0) &
.AND. (tmpLoopNum == WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum )) THEN
IF (WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate == AutoSize) THEN
PltSizNum = WaterThermalTank(WaterThermalTankNum)%UseSidePlantSizNum
IF (PltSizNum > 0) THEN ! we have a Plant Sizing Object
IF (WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide == SupplySide) THEN
IF (PlantSizData(PltSizNum)%DesVolFlowRate >= SmallWaterVolFlow) THEN
IF (PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate = PlantSizData(PltSizNum)%DesVolFlowRate
ELSE
tmpUseDesignVolFlowRate = PlantSizData(PltSizNum)%DesVolFlowRate
ENDIF
ELSE
IF (PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate = 0.d0
ELSE
tmpUseDesignVolFlowRate = 0.d0
ENDIF
END IF
IF (PlantSizesOkayToFinalize) &
CALL ReportSizingOutput(WaterThermalTank(WaterThermalTankNum)%Type, WaterThermalTank(WaterThermalTankNum)%Name, &
'Use Side Design Flow Rate [m3/s]', &
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate)
IF (PlantSizesOkayToFinalize) THEN
CALL RegisterPlantCompDesignFlow( WaterThermalTank(WaterThermalTankNum)%UseInletNode, &
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate)
ELSE
CALL RegisterPlantCompDesignFlow( WaterThermalTank(WaterThermalTankNum)%UseInletNode, &
tmpUseDesignVolFlowRate)
ENDIF
rho = GetDensityGlycol(PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidIndex, &
'SizeSupplySidePlantConnections')
IF (PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%PlantUseMassFlowRateMax = &
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate * rho
ELSE
WaterThermalTank(WaterThermalTankNum)%PlantUseMassFlowRateMax = tmpUseDesignVolFlowRate * rho
ENDIF
END IF
ELSE
! do nothing
ENDIF !plant sizing object
ELSE
CALL RegisterPlantCompDesignFlow( WaterThermalTank(WaterThermalTankNum)%UseInletNode, &
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate)
IF (WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum > 0) THEN
rho = GetDensityGlycol(PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidIndex, &
'SizeSupplySidePlantConnections')
ELSE
rho = GetDensityGlycol('WATER', InitConvTemp, DummyWaterIndex, 'SizeSupplySidePlantConnections')
ENDIF
WaterThermalTank(WaterThermalTankNum)%PlantUseMassFlowRateMax = &
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate * rho
END IF !autosizing needed.
ENDIF ! connected to plant
IF ((WaterThermalTank(WaterThermalTankNum)%SourceInletNode > 0) &
.AND. (tmpLoopNum == WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopNum )) THEN
IF (WaterThermalTank(WaterThermalTankNum)%sourceDesignVolFlowRate == AutoSize) THEN
PltSizNum = WaterThermalTank(WaterThermalTankNum)%SourceSidePlantSizNum
IF (PltSizNum > 0) THEN
IF (WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopSide == SupplySide) THEN
IF (PlantSizData(PltSizNum)%DesVolFlowRate >= SmallWaterVolFlow) THEN
IF (PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = PlantSizData(PltSizNum)%DesVolFlowRate
ELSE
tmpSourceDesignVolFlowRate = PlantSizData(PltSizNum)%DesVolFlowRate
ENDIF
ELSE
IF (PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = 0.0d0
ELSE
tmpSourceDesignVolFlowRate = 0.d0
ENDIF
END IF
IF (PlantSizesOkayToFinalize) &
CALL ReportSizingOutput(WaterThermalTank(WaterThermalTankNum)%Type, WaterThermalTank(WaterThermalTankNum)%Name, &
'Source Side Design Flow Rate [m3/s]', &
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate)
IF (PlantSizesOkayToFinalize) THEN
CALL RegisterPlantCompDesignFlow( WaterThermalTank(WaterThermalTankNum)%SourceInletNode, &
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate)
ELSE
CALL RegisterPlantCompDesignFlow( WaterThermalTank(WaterThermalTankNum)%SourceInletNode, tmpSourceDesignVolFlowRate)
ENDIF
rho = GetDensityGlycol(PlantLoop(WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopNum)%FluidIndex, &
'SizeSupplySidePlantConnections')
IF (PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%PlantSourceMassFlowRateMax = &
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate * rho
ELSE
WaterThermalTank(WaterThermalTankNum)%PlantSourceMassFlowRateMax = tmpSourceDesignVolFlowRate * rho
ENDIF
END IF ! plant loop allocation
ELSE
! do nothing
ENDIF !plant sizing object
ELSE
IF (WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopSide == SupplySide) THEN
CALL RegisterPlantCompDesignFlow( WaterThermalTank(WaterThermalTankNum)%SourceInletNode, &
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate)
IF (WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopNum > 0) THEN
rho = GetDensityGlycol(PlantLoop(WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopNum)%FluidIndex, &
'SizeSupplySidePlantConnections')
ELSE
rho = GetDensityGlycol('WATER', InitConvTemp, DummyWaterIndex, 'SizeSupplySidePlantConnections')
ENDIF
WaterThermalTank(WaterThermalTankNum)%PlantSourceMassFlowRateMax = &
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate * rho
ENDIF
END IF !autosizing needed.
ENDIF ! connected to plant
IF (ErrorsFound) THEN
CALL ShowFatalError('Preceding sizing errors cause program termination')
END IF
RETURN
END SUBROUTINE SizeSupplySidePlantConnections