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 |
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 SizeTankForDemandSide(WaterThermalTankNum)
! SUBROUTINE INFORMATION:
! AUTHOR Brent Griffith
! DATE WRITTEN February 2008
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for sizing water heater tank volume and heater
! as best we can at this point in simulation. (prior to demand side
! sizing that needs volume).
! METHODOLOGY EMPLOYED:
! depending on the sizing design mode...
!
! REFERENCES:
! BA benchmark report for residential design mode
! USE STATEMENTS:
USE InputProcessor, ONLY: SameString
USE DataHeatBalance, ONLY: zone
USE DataSizing
USE DataPlant, ONLY : PlantLoop
USE DataGlobals, ONLY: PI
USE DataInterfaces, ONLY: ShowFatalError, ShowSevereError, ShowContinueError, ShowWarningError
USE DataHVACGlobals, ONLY: SmallWaterVolFlow, NumPlantLoops
USE FluidProperties, ONLY: GetDensityGLycol, GetSpecificHeatGlycol
USE OutputReportPredefined
USE SolarCollectors, ONLY: Collector, NumOfCollectors
USE DataSurfaces, ONLY: Surface
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: WaterThermalTankNum
! SUBROUTINE PARAMETER DEFINITIONS:
! na
Real(r64), PARAMETER :: GalTocubicMeters = 0.0037854D0
Real(r64), PARAMETER :: kBtuPerHrToWatts = 293.1D0
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: Tstart ! initial tank temp for sizing.
REAL(r64) :: Tfinish ! final target temp for sizing
Real(r64) :: SumPeopleAllZones
Real(r64) :: SumFloorAreaAllZones
!unused INTEGER :: CollectorNum ! do loop index
Logical :: SizeVolume = .FALSE.
LOGICAL :: SizeMaxCapacity = .FALSE.
REAL(r64) :: rho
REAL(r64) :: Cp
INTEGER :: DummyWaterIndex = 1
REAL(r64) :: tmpTankVolume ! local temporary for tank volume m3
REAL(r64) :: tmpMaxCapacity ! local temporary for heating capacity W
LOGICAL :: FuelTypeIsLikeGas = .FALSE.
! local inits
Tstart = 14.44d0
TFinish = 57.22d0
SizeVolume = .FALSE.
SizeMaxCapacity = .FALSE.
tmpTankVolume = WaterThermalTank(WaterThermalTankNum)%Volume
tmpMaxCapacity = WaterThermalTank(WaterThermalTankNum)%MaxCapacity
IF (tmpTankVolume == Autosize) SizeVolume = .TRUE.
IF (tmpMaxCapacity == Autosize) SizeMaxCapacity = .TRUE.
SELECT CASE (WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode)
CASE (SizeNotSet)
CASE (SizePeakDraw)
CASE (SizeResidentialMin)
! assume can propagate rules for gas to other fuels.
FuelTypeIsLikeGas = .FALSE.
IF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Gas')) THEN
FuelTypeIsLikeGas = .TRUE.
ELSEIF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Diesel')) THEN
FuelTypeIsLikeGas = .TRUE.
ELSEIF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Gasoline')) THEN
FuelTypeIsLikeGas = .TRUE.
ELSEIF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Coal')) THEN
FuelTypeIsLikeGas = .TRUE.
ELSEIF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'FuelOil#1')) THEN
FuelTypeIsLikeGas = .TRUE.
ELSEIF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'FuelOil#2')) THEN
FuelTypeIsLikeGas = .TRUE.
ELSEIF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Propane')) THEN
FuelTypeIsLikeGas = .TRUE.
ELSEIF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Steam')) THEN
FuelTypeIsLikeGas = .TRUE.
ELSEIF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'OtherFuel1')) THEN
FuelTypeIsLikeGas = .TRUE.
ELSEIF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'OtherFuel2')) THEN
FuelTypeIsLikeGas = .TRUE.
ELSEIF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'DistrictHeating')) THEN
FuelTypeIsLikeGas = .TRUE.
ENDIF
If (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBedrooms == 1 ) then
If (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Electric') ) then
If (SizeVolume) tmpTankVolume = 20.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 2.5D0 * 1000.0D0 !2.5 kW
else if (FuelTypeIsLikeGas) then
If (SizeVolume) tmpTankVolume = 20.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 27.0D0 * kBtuPerHrToWatts !27kBtu/hr
endif
Else If (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBedrooms == 2 ) THEN
If (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms <= 1.5D0) THEN
IF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Electric') ) THEN
If (SizeVolume) tmpTankVolume = 30.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 3.5D0 * 1000.0D0 !3.5 kW
ELSE IF (FuelTypeIsLikeGas) THEN
If (SizeVolume) tmpTankVolume = 30.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 36.0D0 * kBtuPerHrToWatts !36 kBtu/hr
ENDIF
ELSE IF ((WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms > 1.5D0) &
.and. (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms < 3.0D0)) then
IF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Electric') ) THEN
If (SizeVolume) tmpTankVolume = 40.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 4.5D0 * 1000.0D0 !4.5 kW
ELSE IF (FuelTypeIsLikeGas ) THEN
If (SizeVolume) tmpTankVolume = 30.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 36.0D0 * kBtuPerHrToWatts !36 kBtu/hr
ENDIF
ELSE IF (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms >= 3.0D0) then
IF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Electric') ) THEN
If (SizeVolume) tmpTankVolume = 50.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 5.5D0 * 1000.0D0 !5.5 kW
ELSE IF (FuelTypeIsLikeGas ) THEN
If (SizeVolume) tmpTankVolume = 40.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 36.0D0 * kBtuPerHrToWatts !36 kBtu/hr
ENDIF
ENDIF
else if (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBedrooms == 3 ) then
If (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms <= 1.5D0) THEN
IF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Electric') ) THEN
If (SizeVolume) tmpTankVolume = 40.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 4.5D0 * 1000.0D0 !4.5 kW
ELSE IF (FuelTypeIsLikeGas ) THEN
If (SizeVolume) tmpTankVolume = 30.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 36.0D0 * kBtuPerHrToWatts !36 kBtu/hr
ENDIF
ELSE IF ((WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms > 1.5D0) &
.and. (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms < 3.0D0)) then
IF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Electric') ) THEN
If (SizeVolume) tmpTankVolume = 50.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 5.5D0 * 1000.0D0 !5.5 kW
ELSE IF (FuelTypeIsLikeGas ) THEN
If (SizeVolume) tmpTankVolume = 40.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 36.0D0 * kBtuPerHrToWatts !36 kBtu/hr
ENDIF
ELSE IF (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms >= 3.0D0) then
IF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Electric') ) THEN
If (SizeVolume) tmpTankVolume = 50.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 5.5D0 * 1000.0D0 !5.5 kW
ELSE IF (FuelTypeIsLikeGas ) THEN
If (SizeVolume) tmpTankVolume = 40.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 38.0D0 * kBtuPerHrToWatts !38 kBtu/hr
ENDIF
ENDIF
else if (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBedrooms == 4 ) then
If (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms <= 1.5D0) THEN
IF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Electric') ) THEN
If (SizeVolume) tmpTankVolume = 50.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 5.5D0 * 1000.0D0 !5.5 kW
ELSE IF (FuelTypeIsLikeGas) THEN
If (SizeVolume) tmpTankVolume = 40.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 36.0D0 * kBtuPerHrToWatts !36 kBtu/hr
ENDIF
ELSE IF ((WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms > 1.5D0) &
.and. (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms < 3.0D0)) then
IF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Electric') ) THEN
If (SizeVolume) tmpTankVolume = 50.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 5.5D0 * 1000.0D0 !5.5 kW
ELSE IF (FuelTypeIsLikeGas ) THEN
If (SizeVolume) tmpTankVolume = 40.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 38.0D0 * kBtuPerHrToWatts !38 kBtu/hr
ENDIF
ELSE IF (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms >= 3.0D0) then
IF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Electric') ) THEN
If (SizeVolume) tmpTankVolume = 66.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 5.5D0 * 1000.0D0 !5.5 kW
ELSE IF (FuelTypeIsLikeGas ) THEN
If (SizeVolume) tmpTankVolume = 50.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 38.0D0 * kBtuPerHrToWatts !38 kBtu/hr
ENDIF
ENDIF
else if (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBedrooms == 5 ) then
If (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Electric') ) then
If (SizeVolume) tmpTankVolume = 66.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 5.5D0 * 1000.0D0 !5.5 kW
else if (FuelTypeIsLikeGas ) then
If (SizeVolume) tmpTankVolume = 50.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 47.0D0 * kBtuPerHrToWatts !47 kBtu/hr
endif
else if (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBedrooms >= 6 ) then
If (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType , 'Electric') ) then
If (SizeVolume) tmpTankVolume = 66.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 5.5D0 * 1000.0D0 !5.5 kW
else if (FuelTypeIsLikeGas ) then
If (SizeVolume) tmpTankVolume = 50.0D0 * GalTocubicMeters
If (SizeMaxCapacity) tmpMaxCapacity = 50.0D0 * kBtuPerHrToWatts !50 kBtu/hr
endif
ENDIF
IF (SizeVolume .AND. PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%Volume = tmpTankVolume
CALL ReportSizingOutput(WaterThermalTank(WaterThermalTankNum)%Type, &
WaterThermalTank(WaterThermalTankNum)%Name, &
'Tank Volume [m3]', WaterThermalTank(WaterThermalTankNum)%Volume )
ENDIF
IF (SizeMaxCapacity .AND. PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%MaxCapacity = tmpMaxCapacity
CALL ReportSizingOutput(WaterThermalTank(WaterThermalTankNum)%Type, &
WaterThermalTank(WaterThermalTankNum)%Name, &
'Maximum Heater Capacity [W]', WaterThermalTank(WaterThermalTankNum)%MaxCapacity )
ENDIF
CASE (SizePerPerson)
! how to get number of people?
SumPeopleAllZones = SUM(Zone%TotOccupants)
If (SizeVolume) tmpTankVolume = &
WaterThermalTank(WaterThermalTankNum)%sizing%TankCapacityPerPerson &
* SumPeopleAllZones
IF (WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum > 0) THEN
rho = GetDensityGlycol(PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidName, &
((Tfinish + Tstart)/2.0D0), &
PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidIndex, &
'SizeTankForDemandSide')
Cp = GetSpecificHeatGlycol(PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidName, &
((Tfinish + Tstart)/2.0D0), &
PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidIndex, &
'SizeTankForDemandSide')
ELSE
rho = GetDensityGlycol('WATER', ((Tfinish + Tstart)/2.0D0), DummyWaterIndex, 'SizeTankForDemandSide')
Cp = GetSpecificHeatGlycol('WATER', ((Tfinish + Tstart)/2.0D0), DummyWaterIndex, 'SizeTankForDemandSide')
ENDIF
IF (SizeMaxCapacity) tmpMaxCapacity = SumPeopleAllZones &
* WaterThermalTank(WaterThermalTankNum)%sizing%RecoveryCapacityPerPerson & !m3/hr/person
* (Tfinish - Tstart) & ! delta T in K
* (1.0D0 / SecInHour) & ! 1 hr/ 3600 s
* rho & ! kg/m3
* Cp ! J/Kg/k
IF (SizeVolume .AND. PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%Volume = tmpTankVolume
CALL ReportSizingOutput(WaterThermalTank(WaterThermalTankNum)%Type, &
WaterThermalTank(WaterThermalTankNum)%Name, &
'Tank Volume [m3]', WaterThermalTank(WaterThermalTankNum)%Volume )
ENDIF
IF (SizeMaxCapacity .AND. PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%MaxCapacity = tmpMaxCapacity
CALL ReportSizingOutput(WaterThermalTank(WaterThermalTankNum)%Type, &
WaterThermalTank(WaterThermalTankNum)%Name, &
'Maximum Heater Capacity [W]', WaterThermalTank(WaterThermalTankNum)%MaxCapacity )
ENDIF
CASE (SizePerFloorArea)
SumFloorAreaAllZones = SUM(Zone%FloorArea)
If (SizeVolume) tmpTankVolume = &
WaterThermalTank(WaterThermalTankNum)%sizing%TankCapacityPerArea &
* SumFloorAreaAllZones
IF (WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum > 0) THEN
rho = GetDensityGlycol(PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidName, &
((Tfinish + Tstart)/2.0D0), &
PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidIndex, &
'SizeTankForDemandSide')
Cp = GetSpecificHeatGlycol(PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidName, &
((Tfinish + Tstart)/2.0D0), &
PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidIndex, &
'SizeTankForDemandSide')
ELSE
rho = GetDensityGlycol('WATER', ((Tfinish + Tstart)/2.0D0), DummyWaterIndex, 'SizeTankForDemandSide')
Cp = GetSpecificHeatGlycol('WATER', ((Tfinish + Tstart)/2.0D0), DummyWaterIndex, 'SizeTankForDemandSide')
ENDIF
If (SizeMaxCapacity) tmpMaxCapacity = SumFloorAreaAllZones & ! m2
* WaterThermalTank(WaterThermalTankNum)%sizing%RecoveryCapacityPerArea & !m3/hr/m2
* (Tfinish - Tstart) & ! delta T in K
* (1.0D0 / SecInHour) & ! 1 hr/ 3600 s
* rho & ! kg/m3
* Cp ! J/Kg/k
IF (SizeVolume .AND. PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%Volume = tmpTankVolume
CALL ReportSizingOutput(WaterThermalTank(WaterThermalTankNum)%Type, &
WaterThermalTank(WaterThermalTankNum)%Name, &
'Tank Volume [m3]', WaterThermalTank(WaterThermalTankNum)%Volume )
ENDIF
IF (SizeMaxCapacity .AND. PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%MaxCapacity = tmpMaxCapacity
CALL ReportSizingOutput(WaterThermalTank(WaterThermalTankNum)%Type, &
WaterThermalTank(WaterThermalTankNum)%Name, &
'Maximum Heater Capacity [W]', WaterThermalTank(WaterThermalTankNum)%MaxCapacity )
ENDIF
CASE (SizePerUnit)
If (SizeVolume) tmpTankVolume = &
WaterThermalTank(WaterThermalTankNum)%sizing%TankCapacityPerUnit &
* WaterThermalTank(WaterThermalTankNum)%sizing%NumberOfUnits
IF (WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum > 0) THEN
rho = GetDensityGlycol(PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidName, &
((Tfinish + Tstart)/2.0D0), &
PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidIndex, &
'SizeTankForDemandSide')
Cp = GetSpecificHeatGlycol(PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidName, &
((Tfinish + Tstart)/2.0D0), &
PlantLoop(WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopNum)%FluidIndex, &
'SizeTankForDemandSide')
ELSE
rho = GetDensityGlycol('WATER', ((Tfinish + Tstart)/2.0D0), DummyWaterIndex, 'SizeTankForDemandSide')
Cp = GetSpecificHeatGlycol('WATER', ((Tfinish + Tstart)/2.0D0), DummyWaterIndex, 'SizeTankForDemandSide')
ENDIF
If (SizeMaxCapacity) tmpMaxCapacity = &
WaterThermalTank(WaterThermalTankNum)%sizing%NumberOfUnits &
* WaterThermalTank(WaterThermalTankNum)%sizing%RecoveryCapacityPerUnit & !m3/hr/ea
* (Tfinish - Tstart) & ! delta T in K
* (1.0D0 / SecInHour) & ! 1 hr/ 3600 s
* rho & ! kg/m3
* Cp ! J/Kg/k
IF (SizeVolume .AND. PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%Volume = tmpTankVolume
CALL ReportSizingOutput(WaterThermalTank(WaterThermalTankNum)%Type, &
WaterThermalTank(WaterThermalTankNum)%Name, &
'Tank Volume [m3]', WaterThermalTank(WaterThermalTankNum)%Volume )
ENDIF
IF (SizeMaxCapacity .AND. PlantSizesOkayToFinalize) THEN
WaterThermalTank(WaterThermalTankNum)%MaxCapacity = tmpMaxCapacity
CALL ReportSizingOutput(WaterThermalTank(WaterThermalTankNum)%Type, &
WaterThermalTank(WaterThermalTankNum)%Name, &
'Maximum Heater Capacity [W]', WaterThermalTank(WaterThermalTankNum)%MaxCapacity )
ENDIF
CASE (SizePerSolarColArea)
END SELECT
! if stratified, might set height.
IF ((SizeVolume) .AND. (WaterThermalTank(WaterThermalTankNum)%TypeNum == StratifiedWaterHeater) &
.AND. PlantSizesOkayToFinalize ) THEN ! might set height
IF ((WaterThermalTank(WaterThermalTankNum)%Height == Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%Volume /= autosize )) THEN
WaterThermalTank(WaterThermalTankNum)%Height = ( ( 4.0D0 * WaterThermalTank(WaterThermalTankNum)%Volume &
* (WaterThermalTank(WaterThermalTankNum)%sizing%HeightAspectRatio**2) ) &
/ Pi)** 0.33333333333333D0
CALL ReportSizingOutput(WaterThermalTank(WaterThermalTankNum)%Type, WaterThermalTank(WaterThermalTankNum)%Name, &
'Tank Height [m]', WaterThermalTank(WaterThermalTankNum)%Height )
! check if autocalculate Use outlet and source inlet are still set to autosize by earlier
IF (WaterThermalTank(WaterThermalTankNum)%UseOutletHeight == Autosize) THEN
WaterThermalTank(WaterThermalTankNum)%UseOutletHeight = WaterThermalTank(WaterThermalTankNum)%Height
ENDIF
IF (WaterThermalTank(WaterThermalTankNum)%SourceInletHeight == Autosize) THEN
WaterThermalTank(WaterThermalTankNum)%SourceInletHeight = WaterThermalTank(WaterThermalTankNum)%Height
ENDIF
ENDIF
ENDIF
RETURN
END SUBROUTINE SizeTankForDemandSide