SUBROUTINE SizeTower(TowerNum)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN May 2002
! MODIFIED Don Shirey, Sept/Oct 2002; Richard Raustad, Feb 2005
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for sizing Cooling Tower Components for which capacities and flow rates
! have not been specified in the input. This subroutine also calculates tower UA if the user
! has specified tower performance via the "Nominal Capacity" method.
! METHODOLOGY EMPLOYED:
! Obtains condenser flow rate from the plant sizing array. If tower performance is specified
! via the "Nominal Capacity" method, the water flow rate is directly proportional to capacity.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataSizing
USE DataPlant, ONLY: PlantLoop, PlantSizesOkayToFinalize
USE DataInterfaces, ONLY: ShowFatalError, ShowContinueError
USE General, ONLY: SolveRegulaFalsi
USE PlantUtilities, ONLY: RegisterPlantCompDesignFlow
USE ReportSizingManager, ONLY: ReportSizingOutput
USE OutputReportPredefined
USE InputProcessor, ONLY: SameString
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: TowerNum
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: OutputFormat ='(F6.2)'
CHARACTER(len=*), PARAMETER :: OutputFormat2 ='(F9.6)'
INTEGER, PARAMETER :: MaxIte = 500 ! Maximum number of iterations
REAL(r64), PARAMETER :: Acc = 0.0001d0 ! Accuracy of result
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: PltSizCondNum ! Plant Sizing index for condenser loop
INTEGER :: SolFla ! Flag of solver
REAL(r64) :: DesTowerLoad ! Design tower load [W]
REAL(r64) :: UA0 ! Lower bound for UA [W/C]
REAL(r64) :: UA1 ! Upper bound for UA [W/C]
REAL(r64) :: UA ! Calculated UA value
REAL(r64) :: Twb ! tower inlet air wet-bulb temperature [C]
REAL(r64) :: Tr ! tower range temperature [C]
REAL(r64) :: Ta ! tower approach temperature [C]
REAL(r64) :: WaterFlowRatio ! tower water flow rate ratio found during model calibration
REAL(r64) :: MaxWaterFlowRateRatio ! maximum water flow rate ratio which yields desired approach temp
REAL(r64) :: WaterFlowRateRatio ! tower water flow rate ratio
REAL(r64) :: Tapproach ! temporary tower approach temp variable [C]
REAL(r64) :: ModelWaterFlowRatioMax ! maximum water flow rate ratio used for model calibration
REAL(r64) :: FlowRateRatioStep ! flow rate ratio to determine maximum water flow rate ratio during calibration
REAL(r64), DIMENSION(6) :: Par ! Parameter array need for RegulaFalsi routine
LOGICAL :: ModelCalibrated ! TRUE if water flow rate ratio is with the specified range
CHARACTER(len=6) :: OutputChar ! report variable for warning messages
CHARACTER(len=9) :: OutputChar2 ! report variable for warning messages
CHARACTER(len=6) :: OutputCharLo ! report variable for warning messages
CHARACTER(len=6) :: OutputCharHi ! report variable for warning messages
CHARACTER(len=MaxNameLength) :: equipName
REAL(r64) :: Cp ! local specific heat for fluid
REAL(r64) :: rho ! local density for fluid
REAL(r64) :: tmpDesignWaterFlowRate ! local temporary for water volume flow rate
REAL(r64) :: tmpHighSpeedFanPower !local temporary for high speed fan power
REAL(r64) :: tmpHighSpeedAirFlowRate ! local temporary for high speed air flow rate
REAL(r64) :: tmpHighSpeedTowerUA ! local temporary for high speed tower UA
REAL(r64) :: tmpLowSpeedAirFlowRate !local temporary for low speed air flow rate
REAL(r64) :: AssumedDeltaT ! default delta T for nominal capacity of hard sized with UA method
REAL(r64) :: AssumedExitTemp ! default for cp fo nominal capacity of hard sized with UA method
LOGICAL :: ErrorsFound
PltSizCondNum = 0
DesTowerLoad = 0.0d0
tmpDesignWaterFlowRate = SimpleTower(TowerNum)%DesignWaterFlowRate
tmpHighSpeedFanPower = SimpleTower(TowerNum)%HighSpeedFanPower
tmpHighSpeedAirFlowRate = SimpleTower(TowerNum)%HighSpeedAirFlowRate
tmpHighSpeedTowerUA = SimpleTower(TowerNum)%HighSpeedTowerUA
tmpLowSpeedAirFlowRate = SimpleTower(TowerNum)%LowSpeedAirFlowRate
! Find the appropriate Plant Sizing object
PltSizCondNum = PlantLoop(SimpleTower(TowerNum)%LoopNum)%PlantSizNum
IF (SimpleTower(TowerNum)%PerformanceInputMethod_Num == PIM_UFactor .and. &
SimpleTower(TowerNum)%HighSpeedTowerUA /= AutoSize) THEN
IF (PltSizCondNum > 0) THEN
rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
PlantSizData(PltSizCondNum)%ExitTemp, &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex,&
'SizeTower')
Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
PlantSizData(PltSizCondNum)%ExitTemp, &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex, &
'SizeTower')
DesTowerLoad = rho * Cp &
* SimpleTower(TowerNum)%DesignWaterFlowRate * PlantSizData(PltSizCondNum)%DeltaT
SimpleTower(TowerNum)%TowerNominalCapacity=DesTowerLoad/SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
ELSE
AssumedDeltaT = 11.d0
AssumedExitTemp = 21.d0
rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
AssumedExitTemp, &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex,&
'SizeTower')
Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
AssumedExitTemp, &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex, &
'SizeTower')
DesTowerLoad = rho * Cp &
* SimpleTower(TowerNum)%DesignWaterFlowRate * AssumedDeltaT
SimpleTower(TowerNum)%TowerNominalCapacity=DesTowerLoad/SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
ENDIF
END IF
IF (SimpleTower(TowerNum)%DesignWaterFlowRate == AutoSize) THEN
IF (PltSizCondNum > 0) THEN
IF (PlantSizData(PltSizCondNum)%DesVolFlowRate >= SmallWaterVolFlow) THEN
tmpDesignWaterFlowRate = PlantSizData(PltSizCondNum)%DesVolFlowRate * SimpleTower(TowerNum)%SizFac
IF (PlantSizesOkayToFinalize) SimpleTower(TowerNum)%DesignWaterFlowRate = tmpDesignWaterFlowRate
ELSE
tmpDesignWaterFlowRate = 0.d0
IF (PlantSizesOkayToFinalize) SimpleTower(TowerNum)%DesignWaterFlowRate = tmpDesignWaterFlowRate
ENDIF
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Design Water Flow Rate [m3/s]', SimpleTower(TowerNum)%DesignWaterFlowRate)
ELSE
CALL ShowSevereError('Autosizing error for cooling tower object = '//TRIM(SimpleTower(TowerNum)%Name))
CALL ShowFatalError('Autosizing of cooling tower condenser flow rate requires a loop Sizing:Plant object.')
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%PerformanceInputMethod_Num == PIM_NominalCapacity) THEN
! Design water flow rate is assumed to be 3 gpm per ton (SI equivalent 5.382E-8 m3/s per watt)
SimpleTower(TowerNum)%DesignWaterFlowRate = 5.382d-8 * SimpleTower(TowerNum)%TowerNominalCapacity
tmpDesignWaterFlowRate = SimpleTower(TowerNum)%DesignWaterFlowRate
IF (SameString(SimpleTower(TowerNum)%TowerType , 'CoolingTower:SingleSpeed')) THEN
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Design water flow rate based on tower nominal capacity [m3/s]', &
SimpleTower(TowerNum)%DesignWaterFlowRate)
ELSEIF (SameString(SimpleTower(TowerNum)%TowerType , 'CoolingTower:TwoSpeed')) THEN
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Design water flow rate based on tower high-speed nominal capacity [m3/s]', &
SimpleTower(TowerNum)%DesignWaterFlowRate)
ENDIF
ENDIF
CALL RegisterPlantCompDesignFlow(SimpleTower(TowerNum)%WaterInletNodeNum,tmpDesignWaterFlowRate)
IF (SimpleTower(TowerNum)%HighSpeedFanPower == AutoSize) THEN
! We assume the nominal fan power is 0.0105 times the design load
IF (SimpleTower(TowerNum)%PerformanceInputMethod_Num == PIM_NominalCapacity) THEN
SimpleTower(TowerNum)%HighSpeedFanPower = 0.0105d0 * SimpleTower(TowerNum)%TowerNominalCapacity
ELSE
IF (PltSizCondNum > 0) THEN
IF (PlantSizData(PltSizCondNum)%DesVolFlowRate >= SmallWaterVolFlow) THEN
rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex,&
'SizeTower')
Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
PlantSizData(PltSizCondNum)%ExitTemp, &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex, &
'SizeTower')
DesTowerLoad = rho * Cp * tmpDesignWaterFlowRate * PlantSizData(PltSizCondNum)%DeltaT
tmpHighSpeedFanPower = 0.0105d0 * DesTowerLoad
IF (PlantSizesOkayToFinalize) SimpleTower(TowerNum)%HighSpeedFanPower = tmpHighSpeedFanPower
ELSE
tmpHighSpeedFanPower = 0.d0
IF (PlantSizesOkayToFinalize) SimpleTower(TowerNum)%HighSpeedFanPower = tmpHighSpeedFanPower
ENDIF
ELSE
CALL ShowSevereError('Autosizing of cooling tower fan power requires a loop Sizing:Plant object.')
CALL ShowFatalError(' Occurs in cooling tower object= '//TRIM(SimpleTower(TowerNum)%Name))
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%TowerType_Num == CoolingTower_SingleSpeed .OR. &
SimpleTower(TowerNum)%TowerType_Num == CoolingTower_VariableSpeed) THEN
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Fan Power at Design Air Flow Rate [W]', SimpleTower(TowerNum)%HighSpeedFanPower)
ELSEIF (SimpleTower(TowerNum)%TowerType_Num == CoolingTower_TwoSpeed) THEN
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Fan Power at High Fan Speed [W]', SimpleTower(TowerNum)%HighSpeedFanPower)
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%HighSpeedAirFlowRate == AutoSize) THEN
! Plant Sizing Object is not required to AUTOSIZE this field since its simply a multiple of another field.
tmpHighSpeedAirFlowRate = tmpHighSpeedFanPower * 0.5d0 &
* (101325.d0/StdBaroPress) / 190.d0
IF (PlantSizesOkayToFinalize) SimpleTower(TowerNum)%HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate
IF (SimpleTower(TowerNum)%TowerType_Num == CoolingTower_SingleSpeed .OR. &
SimpleTower(TowerNum)%TowerType_Num == CoolingTower_VariableSpeed) THEN
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Design Air Flow Rate [m3/s]', SimpleTower(TowerNum)%HighSpeedAirFlowRate)
ELSEIF (SimpleTower(TowerNum)%TowerType_Num == CoolingTower_TwoSpeed) THEN
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Air Flow Rate at High Fan Speed [m3/s]', SimpleTower(TowerNum)%HighSpeedAirFlowRate)
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%HighSpeedTowerUA == AutoSize) THEN
IF (PltSizCondNum > 0) THEN
IF (PlantSizData(PltSizCondNum)%DesVolFlowRate >= SmallWaterVolFlow) THEN
rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex,&
'SizeTower')
Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
PlantSizData(PltSizCondNum)%ExitTemp, &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex, &
'SizeTower')
DesTowerLoad = rho * Cp * tmpDesignWaterFlowRate * PlantSizData(PltSizCondNum)%DeltaT
! This conditional statement is to trap when the user specified condenser/tower water design setpoint
! temperature is less than design inlet air wet bulb temperature of 25.6 C
IF ( PlantSizData(PltSizCondNum)%ExitTemp <= 25.6d0 ) THEN
CALL ShowSevereError('Error when autosizing the UA value for cooling tower = '//TRIM(SimpleTower(TowerNum)%Name)// &
'.'//' Design Loop Exit Temperature must be greater than 25.6 C when autosizing the tower UA.')
CALL ShowContinueError('The Design Loop Exit Temperature specified in Sizing:Plant object = '// &
TRIM(PlantSizData(PltSizCondNum)%PlantLoopName))
CALL ShowContinueError('is less than or equal to the design inlet air wet-bulb temperature of 25.6 C.')
CALL ShowContinueError('It is recommended that the Design Loop Exit Temperature = 25.6 C plus '// &
'the cooling tower design approach temperature (e.g., 4 C).')
CALL ShowContinueError('If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field ' // &
'Condenser Water Design Setpoint must be > 25.6 C if autosizing the cooling tower.')
CALL ShowFatalError('Autosizing of cooling tower fails for tower = '//TRIM(SimpleTower(TowerNum)%Name)//'.')
ENDIF
Par(1) = DesTowerLoad
Par(2) = REAL(TowerNum,r64)
Par(3) = rho * tmpDesignWaterFlowRate ! design water mass flow rate
Par(4) = tmpHighSpeedAirFlowRate ! design air volume flow rate
Par(5) = Cp
UA0 = 0.0001d0 * DesTowerLoad ! Assume deltaT = 10000K (limit)
UA1 = DesTowerLoad ! Assume deltaT = 1K
SimpleTowerInlet(TowerNum)%WaterTemp = PlantSizData(PltSizCondNum)%ExitTemp + PlantSizData(PltSizCondNum)%DeltaT
SimpleTowerInlet(TowerNum)%AirTemp = 35.d0
SimpleTowerInlet(TowerNum)%AirWetBulb = 25.6d0
SimpleTowerInlet(TowerNum)%AirPress = StdBaroPress
SimpleTowerInlet(TowerNum)%AirHumRat = &
PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum)%AirTemp, &
SimpleTowerInlet(TowerNum)%AirWetBulb, &
SimpleTowerInlet(TowerNum)%AirPress)
! SimpleTowerInlet(TowerNum)%AirHumRat = PsyWFnTdbTwbPb(35.,25.6,StdBaroPress)
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par)
IF (SolFla == -1) THEN
CALL ShowSevereError('Iteration limit exceeded in calculating tower UA')
CALL ShowFatalError('Autosizing of cooling tower UA failed for tower '//TRIM(SimpleTower(TowerNum)%Name))
ELSE IF (SolFla == -2) THEN
CALL ShowSevereError('Bad starting values for UA')
CALL ShowFatalError('Autosizing of cooling tower UA failed for tower '//TRIM(SimpleTower(TowerNum)%Name))
ENDIF
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%HighSpeedTowerUA = UA
ELSE
tmpHighSpeedTowerUA = UA
ENDIF
SimpleTower(TowerNum)%TowerNominalCapacity=DesTowerLoad/SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
ELSE
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%HighSpeedTowerUA = 0.d0
ELSE
tmpHighSpeedTowerUA = 0.d0
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%TowerType_Num == CoolingTower_SingleSpeed) THEN
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'U-Factor Times Area Value at Design Air Flow Rate [W/C]', &
SimpleTower(TowerNum)%HighSpeedTowerUA)
ELSEIF (SimpleTower(TowerNum)%TowerType_Num == CoolingTower_TwoSpeed) THEN
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'U-Factor Times Area Value at High Fan Speed [W/C]', &
SimpleTower(TowerNum)%HighSpeedTowerUA)
ENDIF
ELSE
CALL ShowSevereError('Autosizing error for cooling tower object= '//TRIM(SimpleTower(TowerNum)%Name))
CALL ShowFatalError('Autosizing of cooling tower UA requires a loop Sizing:Plant object.')
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%PerformanceInputMethod_Num == PIM_NominalCapacity) THEN
IF (SimpleTower(TowerNum)%DesignWaterFlowRate >= SmallWaterVolFlow) THEN
! nominal capacity doesn't include compressor heat; predefined factor was 1.25 W heat rejection per W of delivered cooling
! but now is a user input
rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
29.44d0, & ! 85F design exiting water temp
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex,&
'SizeTower')
Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
29.44d0, & ! 85F design exiting water temp
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex, &
'SizeTower')
DesTowerLoad = SimpleTower(TowerNum)%TowerNominalCapacity * SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
Par(1) = DesTowerLoad
Par(2) = REAL(TowerNum,r64)
Par(3) = rho * tmpDesignWaterFlowRate ! design water mass flow rate
Par(4) = tmpHighSpeedAirFlowRate ! design air volume flow rate
Par(5) = Cp ! 85F design exiting water temp
UA0 = 0.0001d0 * DesTowerLoad ! Assume deltaT = 10000K (limit)
UA1 = DesTowerLoad ! Assume deltaT = 1K
SimpleTowerInlet(TowerNum)%WaterTemp = 35.d0 ! 95F design inlet water temperature
SimpleTowerInlet(TowerNum)%AirTemp = 35.d0 ! 95F design inlet air dry-bulb temp
SimpleTowerInlet(TowerNum)%AirWetBulb = 25.6d0 ! 78F design inlet air wet-bulb temp
SimpleTowerInlet(TowerNum)%AirPress = StdBaroPress
SimpleTowerInlet(TowerNum)%AirHumRat = &
PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum)%AirTemp, &
SimpleTowerInlet(TowerNum)%AirWetBulb, &
SimpleTowerInlet(TowerNum)%AirPress)
! SimpleTowerInlet(TowerNum)%AirHumRat = PsyWFnTdbTwbPb(35.,25.6,StdBaroPress)
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par)
IF (SolFla == -1) THEN
CALL ShowSevereError('Iteration limit exceeded in calculating tower UA')
CALL ShowFatalError('Autosizing of cooling tower UA failed for tower '//TRIM(SimpleTower(TowerNum)%Name))
ELSE IF (SolFla == -2) THEN
CALL ShowSevereError('Bad starting values for UA')
CALL ShowFatalError('Autosizing of cooling tower UA failed for tower '//TRIM(SimpleTower(TowerNum)%Name))
ENDIF
SimpleTower(TowerNum)%HighSpeedTowerUA = UA
ELSE
SimpleTower(TowerNum)%HighSpeedTowerUA = 0.0d0
ENDIF
IF (SimpleTower(TowerNum)%TowerType_Num == CoolingTower_SingleSpeed) THEN
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'U-Factor Times Area Value at Design Air Flow Rate [W/C]', &
SimpleTower(TowerNum)%HighSpeedTowerUA)
ELSEIF (SimpleTower(TowerNum)%TowerType_Num == CoolingTower_TwoSpeed) THEN
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'U-Factor Times Area Value at High Fan Speed [W/C]', &
SimpleTower(TowerNum)%HighSpeedTowerUA)
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%LowSpeedAirFlowRate == AutoSize ) THEN
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%LowSpeedAirFlowRate = SimpleTower(TowerNum)%LowSpeedAirFlowRateSizingFactor &
* SimpleTower(TowerNum)%HighSpeedAirFlowRate
tmpLowSpeedAirFlowRate = SimpleTower(TowerNum)%LowSpeedAirFlowRate
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Low Fan Speed Air Flow Rate [m3/s]', SimpleTower(TowerNum)%LowSpeedAirFlowRate)
ELSE
tmpLowSpeedAirFlowRate = SimpleTower(TowerNum)%LowSpeedAirFlowRateSizingFactor * tmpHighSpeedAirFlowRate
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%LowSpeedFanPower == AutoSize ) THEN
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%LowSpeedFanPower = SimpleTower(TowerNum)%LowSpeedFanPowerSizingFactor &
* SimpleTower(TowerNum)%HighSpeedFanPower
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Fan Power at Low Fan Speed [W]', SimpleTower(TowerNum)%LowSpeedFanPower)
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%LowSpeedTowerUA == AutoSize .AND. PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%LowSpeedTowerUA = SimpleTower(TowerNum)%LowSpeedTowerUASizingFactor &
* SimpleTower(TowerNum)%HighSpeedTowerUA
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'U-Factor Times Area Value at Low Fan Speed [W/K]', SimpleTower(TowerNum)%LowSpeedTowerUA)
ENDIF
IF (SimpleTower(TowerNum)%PerformanceInputMethod_Num == PIM_NominalCapacity) THEN
IF (SimpleTower(TowerNum)%TowerLowSpeedNomCap == AutoSize) THEN
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%TowerLowSpeedNomCap = SimpleTower(TowerNum)%TowerLowSpeedNomCapSizingFactor &
* SimpleTower(TowerNum)%TowerNominalCapacity
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Low Speed Nominal Capacity [W]', &
SimpleTower(TowerNum)%TowerLowSpeedNomCap)
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%TowerFreeConvNomCap == AutoSize) THEN
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%TowerFreeConvNomCap = SimpleTower(TowerNum)%TowerFreeConvNomCapSizingFactor &
* SimpleTower(TowerNum)%TowerNominalCapacity
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Free Convection Nominal Capacity [W]', &
SimpleTower(TowerNum)%TowerFreeConvNomCap)
ENDIF
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%PerformanceInputMethod_Num == PIM_NominalCapacity .AND. &
SameString(SimpleTower(TowerNum)%TowerType , 'CoolingTower:TwoSpeed')) THEN
IF (SimpleTower(TowerNum)%DesignWaterFlowRate >= SmallWaterVolFlow.AND.SimpleTower(TowerNum)%TowerLowSpeedNomCap > 0.0d0) THEN
! nominal capacity doesn't include compressor heat; predefined factor wass 1.25 W heat rejection per W of evap cooling
! but now is a user input
rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
29.44d0, & ! 85F design exiting water temp
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex,&
'SizeTower')
Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
29.44d0, & ! 85F design exiting water temp
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex, &
'SizeTower')
DesTowerLoad = SimpleTower(TowerNum)%TowerLowSpeedNomCap * SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
Par(1) = DesTowerLoad
Par(2) = REAL(TowerNum,r64)
Par(3) = rho * tmpDesignWaterFlowRate ! design water mass flow rate
Par(4) = tmpLowSpeedAirFlowRate ! Air volume flow rate at low fan speed
Par(5) = Cp ! 85F design exiting water temp
UA0 = 0.0001d0 * DesTowerLoad ! Assume deltaT = 10000K (limit)
UA1 = DesTowerLoad ! Assume deltaT = 1K
SimpleTowerInlet(TowerNum)%WaterTemp = 35.d0 ! 95F design inlet water temperature
SimpleTowerInlet(TowerNum)%AirTemp = 35.d0 ! 95F design inlet air dry-bulb temp
SimpleTowerInlet(TowerNum)%AirWetBulb = 25.6d0 ! 78F design inlet air wet-bulb temp
SimpleTowerInlet(TowerNum)%AirPress = StdBaroPress
SimpleTowerInlet(TowerNum)%AirHumRat = &
PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum)%AirTemp, &
SimpleTowerInlet(TowerNum)%AirWetBulb, &
SimpleTowerInlet(TowerNum)%AirPress)
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par)
IF (SolFla == -1) THEN
CALL ShowSevereError('Iteration limit exceeded in calculating tower UA')
CALL ShowFatalError('Autosizing of cooling tower UA failed for tower '//TRIM(SimpleTower(TowerNum)%Name))
ELSE IF (SolFla == -2) THEN
CALL ShowSevereError('Bad starting values for UA')
CALL ShowFatalError('Autosizing of cooling tower UA failed for tower '//TRIM(SimpleTower(TowerNum)%Name))
ENDIF
SimpleTower(TowerNum)%LowSpeedTowerUA = UA
ELSE
SimpleTower(TowerNum)%LowSpeedTowerUA = 0.0d0
ENDIF
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Low Fan Speed U-Factor Times Area Value [W/K]', &
SimpleTower(TowerNum)%LowSpeedTowerUA)
ENDIF
IF (SimpleTower(TowerNum)%FreeConvAirFlowRate == AutoSize) THEN
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%FreeConvAirFlowRate = SimpleTower(TowerNum)%FreeConvAirFlowRateSizingFactor &
* SimpleTower(TowerNum)%HighSpeedAirFlowRate
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Free Convection Regime Air Flow Rate [m3/s]', SimpleTower(TowerNum)%FreeConvAirFlowRate)
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%FreeConvTowerUA == AutoSize) THEN
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%FreeConvTowerUA = SimpleTower(TowerNum)%FreeConvTowerUASizingFactor &
* SimpleTower(TowerNum)%HighSpeedTowerUA
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Free Convection U-Factor Times Area Value [W/K]', &
SimpleTower(TowerNum)%FreeConvTowerUA)
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%PerformanceInputMethod_Num == PIM_NominalCapacity) THEN
IF (SimpleTower(TowerNum)%DesignWaterFlowRate >= SmallWaterVolFlow.AND.SimpleTower(TowerNum)%TowerFreeConvNomCap > 0.0d0) THEN
! nominal capacity doesn't include compressor heat; predefined factor was 1.25 W heat rejection per W of evap cooling,
! but now user input
rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
29.44d0, & ! 85F design exiting water temp
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex,&
'SizeTower')
Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
29.44d0, & ! 85F design exiting water temp
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex, &
'SizeTower')
DesTowerLoad = SimpleTower(TowerNum)%TowerFreeConvNomCap * SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
Par(1) = DesTowerLoad
Par(2) = REAL(TowerNum,r64)
Par(3) = rho * SimpleTower(TowerNum)%DesignWaterFlowRate ! design water mass flow rate
Par(4) = SimpleTower(TowerNum)%FreeConvAirFlowRate ! free convection air volume flow rate
Par(5) = Cp ! 85F design exiting water temp
UA0 = 0.0001d0 * DesTowerLoad ! Assume deltaT = 10000K (limit)
UA1 = DesTowerLoad ! Assume deltaT = 1K
SimpleTowerInlet(TowerNum)%WaterTemp = 35.d0 ! 95F design inlet water temperature
SimpleTowerInlet(TowerNum)%AirTemp = 35.d0 ! 95F design inlet air dry-bulb temp
SimpleTowerInlet(TowerNum)%AirWetBulb = 25.6d0 ! 78F design inlet air wet-bulb temp
SimpleTowerInlet(TowerNum)%AirPress = StdBaroPress
SimpleTowerInlet(TowerNum)%AirHumRat = &
PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum)%AirTemp, &
SimpleTowerInlet(TowerNum)%AirWetBulb, &
SimpleTowerInlet(TowerNum)%AirPress)
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par)
IF (SolFla == -1) THEN
CALL ShowSevereError('Iteration limit exceeded in calculating tower UA')
CALL ShowFatalError('Autosizing of cooling tower UA failed for tower '//TRIM(SimpleTower(TowerNum)%Name))
ELSE IF (SolFla == -2) THEN
CALL ShowSevereError('Bad starting values for UA')
CALL ShowFatalError('Autosizing of cooling tower UA failed for tower '//TRIM(SimpleTower(TowerNum)%Name))
ENDIF
SimpleTower(TowerNum)%FreeConvTowerUA = UA
ELSE
SimpleTower(TowerNum)%FreeConvTowerUA = 0.0d0
ENDIF
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]', &
SimpleTower(TowerNum)%FreeConvTowerUA)
ENDIF
! calibrate variable speed tower model based on user input by finding calibration water flow rate ratio that
! yields an approach temperature that matches user input
IF(SameString(SimpleTower(TowerNum)%TowerType , 'CoolingTower:VariableSpeed')) THEN
Twb = SimpleTower(TowerNum)%DesignInletWB
Tr = SimpleTower(TowerNum)%DesignRange
Ta = SimpleTower(TowerNum)%DesignApproach
Par(1) = TowerNum ! Index to cooling tower
Par(2) = 1.0d0 ! air flow rate ratio
Par(3) = Twb ! inlet air wet-bulb temperature [C]
Par(4) = Tr ! tower range temperature [C]
Par(5) = Ta ! design approach temperature [C]
Par(6) = 0.0d0 ! Calculation FLAG, 0.0 = calc water flow ratio, 1.0 calc air flow ratio
! check range for water flow rate ratio (make sure RegulaFalsi converges)
MaxWaterFlowRateRatio = 0.5d0
Tapproach = 0.0d0
FlowRateRatioStep = (VSTower(SimpleTower(TowerNum)%VSTower)%MaxWaterFlowRatio - &
VSTower(SimpleTower(TowerNum)%VSTower)%MinWaterFlowRatio)/10.0d0
ModelCalibrated = .TRUE.
ModelWaterFlowRatioMax = VSTower(SimpleTower(TowerNum)%VSTower)%MaxWaterFlowRatio * 4.0d0
! find a flow rate large enough to provide an approach temperature > than the user defined approach
DO WHILE (Tapproach < Ta .AND. MaxWaterFlowRateRatio .LE. ModelWaterFlowRatioMax)
WaterFlowRateRatio = MaxWaterFlowRateRatio
CALL CalcVSTowerApproach(TowerNum,WaterFlowRateRatio,1.0d0,Twb,Tr,Tapproach)
IF(Tapproach < Ta)THEN
MaxWaterFlowRateRatio = MaxWaterFlowRateRatio + FlowRateRatioStep
END IF
! a water flow rate large enough to provide an approach temperature > than the user defined approach does not exist
! within the tolerances specified by the user
IF((MaxWaterFlowRateRatio .EQ. 0.5d0 .AND. Tapproach .GT. Ta) .OR. MaxWaterFlowRateRatio .GE. ModelWaterFlowRatioMax) THEN
ModelCalibrated = .FALSE.
EXIT
END IF
END DO
IF(ModelCalibrated)THEN
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, WaterFlowRatio, SimpleTowerApproachResidual, &
constant_pointfive, MaxWaterFlowRateRatio, Par)
IF (SolFla == -1) THEN
CALL ShowSevereError('Iteration limit exceeded in calculating tower water flow ratio during calibration')
CALL ShowContinueError('Inlet air wet-bulb, range, and/or approach temperature does not allow calibration of'// &
'water flow rate ratio for this variable-speed cooling tower.')
CALL ShowFatalError('Cooling tower calibration failed for tower '//TRIM(SimpleTower(TowerNum)%Name))
ELSE IF (SolFla == -2) THEN
CALL ShowSevereError('Bad starting values for cooling tower water flow rate ratio calibration.')
CALL ShowContinueError('Inlet air wet-bulb, range, and/or approach temperature does not allow calibration of'// &
'water flow rate ratio for this variable-speed cooling tower.')
CALL ShowFatalError('Cooling tower calibration failed for tower '//TRIM(SimpleTower(TowerNum)%Name)//'.')
ENDIF
ELSE
WRITE(OutputChar2,OutputFormat2)WaterFlowRateRatio
WRITE(OutputChar,OutputFormat)Tapproach
CALL ShowSevereError('Bad starting values for cooling tower water flow rate ratio calibration.')
CALL ShowContinueError('Design inlet air wet-bulb or range temperature must be modified to achieve the design approach')
CALL ShowContinueError('A water flow rate ratio of '//TRIM(OutputChar2)//' was calculated to yield an ' &
//'approach temperature of '//TRIM(OutputChar)//'.')
CALL ShowFatalError('Cooling tower calibration failed for tower '//TRIM(SimpleTower(TowerNum)%Name)//'.')
END IF
SimpleTower(TowerNum)%CalibratedWaterFlowRate = SimpleTower(TowerNum)%DesignWaterFlowRate/WaterFlowRatio
IF(WaterFlowRatio .LT. VSTower(SimpleTower(TowerNum)%VSTower)%MinWaterFlowRatio .OR. &
WaterFlowRatio .GT. VSTower(SimpleTower(TowerNum)%VSTower)%MaxWaterFlowRatio)THEN
WRITE(OutputChar2,OutputFormat2)WaterFlowRatio
WRITE(OutputCharLo,OutputFormat)VSTower(SimpleTower(TowerNum)%VSTower)%MinWaterFlowRatio
WRITE(OutputCharHi,OutputFormat)VSTower(SimpleTower(TowerNum)%VSTower)%MaxWaterFlowRatio
CALL ShowWarningError('CoolingTower:VariableSpeed, "'//TRIM(SimpleTower(TowerNum)%Name)//&
'" the calibrated water flow rate ratio is determined to be '//TRIM(OutputChar2) &
//'. This is outside the valid range of '//TRIM(OutputCharLo)//' to '//TRIM(OutputCharHi)//'.')
END IF
rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
(Twb+Ta+Tr), &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex,&
'SizeTower')
Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
(Twb+Ta+Tr), &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex, &
'SizeTower')
SimpleTower(TowerNum)%TowerNominalCapacity = ((rho *tmpDesignWaterFlowRate) * &
Cp * Tr)
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Nominal Capacity [W]', SimpleTower(TowerNum)%TowerNominalCapacity)
SimpleTower(TowerNum)%FreeConvAirFlowRate = SimpleTower(TowerNum)%MinimumVSAirFlowFrac * &
SimpleTower(TowerNum)%HighSpeedAirFlowRate
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Air flow rate in free convection regime [m3/s]', SimpleTower(TowerNum)%FreeConvAirFlowRate)
SimpleTower(TowerNum)%TowerFreeConvNomCap = SimpleTower(TowerNum)%TowerNominalCapacity * &
SimpleTower(TowerNum)%FreeConvectionCapacityFraction
IF (PlantSizesOkayToFinalize) CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Tower capacity in free convection regime at design conditions [W]' &
, SimpleTower(TowerNum)%TowerFreeConvNomCap)
END IF
IF (PlantSizesOkayToFinalize) Then
!create predefined report
equipName = SimpleTower(TowerNum)%Name
CALL PreDefTableEntry(pdchMechType,equipName,SimpleTower(TowerNum)%TowerType)
CALL PreDefTableEntry(pdchMechNomCap,equipName,SimpleTower(TowerNum)%TowerNominalCapacity)
ENDIF
! input error checking
ErrorsFound = .FALSE.
IF (PlantSizesOkayToFinalize) Then
IF (SimpleTower(TowerNum)%TowerType_Num == CoolingTower_SingleSpeed) THEN
IF (SimpleTower(TowerNum)%DesignWaterFlowRate > 0.0d0) THEN
IF (SimpleTower(TowerNum)%FreeConvAirFlowRate >= SimpleTower(TowerNum)%HighSpeedAirFlowRate) THEN
CALL ShowSevereError(cCoolingTower_SingleSpeed//' "'//TRIM(SimpleTower(TowerNum)%Name)//&
'". Free convection air flow rate must be less than the design air flow rate.')
ErrorsFound=.true.
END IF
IF (SimpleTower(TowerNum)%FreeConvTowerUA >= SimpleTower(TowerNum)%HighSpeedTowerUA) THEN
CALL ShowSevereError(cCoolingTower_SingleSpeed//' "'//TRIM(SimpleTower(TowerNum)%Name)//&
'". Free convection UA must be less than the design tower UA.')
ErrorsFound=.true.
END IF
END IF
END IF
IF (SimpleTower(TowerNum)%TowerType_Num == CoolingTower_TwoSpeed) THEN
IF (SimpleTower(TowerNum)%DesignWaterFlowRate > 0.0d0) THEN
IF (SimpleTower(TowerNum)%HighSpeedAirFlowRate <= SimpleTower(TowerNum)%LowSpeedAirFlowRate) THEN
CALL ShowSevereError(cCoolingTower_TwoSpeed//' "'//TRIM(SimpleTower(TowerNum)%Name)//&
'". Low speed air flow rate must be less than the high speed air flow rate.')
ErrorsFound=.true.
ENDIF
IF (SimpleTower(TowerNum)%LowSpeedAirFlowRate <= SimpleTower(TowerNum)%FreeConvAirFlowRate) THEN
CALL ShowSevereError(cCoolingTower_TwoSpeed//' "'//TRIM(SimpleTower(TowerNum)%Name)//&
'". Free convection air flow rate must be less than the low speed air flow rate.')
ErrorsFound=.true.
ENDIF
IF (SimpleTower(TowerNum)%HighSpeedTowerUA <= SimpleTower(TowerNum)%LowSpeedTowerUA) THEN
CALL ShowSevereError(cCoolingTower_TwoSpeed//' "'//TRIM(SimpleTower(TowerNum)%Name)//&
'". Tower UA at low fan speed must be less than the tower UA at high fan speed.')
ErrorsFound=.true.
ENDIF
IF (SimpleTower(TowerNum)%LowSpeedTowerUA <= SimpleTower(TowerNum)%FreeConvTowerUA) THEN
CALL ShowSevereError(cCoolingTower_TwoSpeed//' "'//TRIM(SimpleTower(TowerNum)%Name)//&
'". Tower UA at free convection air flow rate must be less than the tower UA at low fan speed.')
ErrorsFound=.true.
ENDIF
END IF
END IF
IF (ErrorsFound) THEN
CALL ShowFatalError('InitTower: Program terminated due to previous condition(s).')
ENDIF
ENDIF
RETURN
END SUBROUTINE SizeTower