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 SizeVSMerkelTower(TowerNum)
! SUBROUTINE INFORMATION:
! AUTHOR <author>
! DATE WRITTEN <date_written>
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! <description>
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
USE DataSizing
USE DataPlant, ONLY: PlantLoop, PlantSizesOkayToFinalize
USE General, ONLY: SolveRegulaFalsi
USE PlantUtilities, ONLY: RegisterPlantCompDesignFlow
USE ReportSizingManager, ONLY: ReportSizingOutput
USE PlantUtilities, ONLY: RegisterPlantCompDesignFlow
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: TowerNum
! SUBROUTINE PARAMETER DEFINITIONS:
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) :: tmpNomTowerCap
REAL(r64) :: tmpDesignWaterFlowRate
REAL(r64) :: tmpTowerFreeConvNomCap
REAL(r64) :: tmpDesignAirFlowRate
REAL(r64) :: tmpHighSpeedFanPower
REAL(r64) :: tmpFreeConvAirFlowRate
REAL(r64), DIMENSION(6) :: Par ! Parameter array need for RegulaFalsi routine
REAL(r64) :: UA0 ! Lower bound for UA [W/C]
REAL(r64) :: UA1 ! Upper bound for UA [W/C]
REAL(r64) :: DesTowerLoad ! Design tower load [W]
REAL(r64) :: Cp ! local specific heat for fluid
REAL(r64) :: rho ! local density for fluid
REAL(r64) :: UA ! Calculated UA value
REAL(r64) :: OutWaterTemp
! Find the appropriate Plant Sizing object
PltSizCondNum = PlantLoop(SimpleTower(TowerNum)%LoopNum)%PlantSizNum
tmpNomTowerCap = SimpleTower(TowerNum)%TowerNominalCapacity
tmpDesignWaterFlowRate = SimpleTower(TowerNum)%DesignWaterFlowRate
tmpTowerFreeConvNomCap = SimpleTower(TowerNum)%TowerFreeConvNomCap
tmpDesignAirFlowRate = SimpleTower(TowerNum)%HighSpeedAirFlowRate
tmpHighSpeedFanPower = SimpleTower(TowerNum)%HighSpeedFanPower
tmpFreeConvAirFlowRate = SimpleTower(TowerNum)%FreeConvAirFlowRate
IF (SimpleTower(TowerNum)%PerformanceInputMethod_Num == PIM_NominalCapacity) THEN
IF (SimpleTower(TowerNum)%TowerNominalCapacity == autosize) THEN
! get nominal capacity from PlantSizData(PltSizCondNum)%DeltaT and PlantSizData(PltSizCondNum)%DesVolFlowRate
IF (PltSizCondNum > 0) THEN
IF (PlantSizData(PltSizCondNum)%DesVolFlowRate >= SmallWaterVolFlow) 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 &
* PlantSizData(PltSizCondNum)%DesVolFlowRate * PlantSizData(PltSizCondNum)%DeltaT &
* SimpleTower(TowerNum)%SizFac
tmpNomTowerCap = DesTowerLoad / SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%TowerNominalCapacity = tmpNomTowerCap
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Nominal Capacity [W]', SimpleTower(TowerNum)%TowerNominalCapacity)
ENDIF
ELSE
tmpNomTowerCap = 0.d0
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%TowerNominalCapacity = tmpNomTowerCap
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Nominal Capacity [W]', SimpleTower(TowerNum)%TowerNominalCapacity)
ENDIF
ENDIF
ELSE
CALL ShowSevereError('Autosizing error for cooling tower object = '//TRIM(SimpleTower(TowerNum)%Name))
CALL ShowFatalError('Autosizing of cooling tower nominal capacity requires a loop Sizing:Plant object.')
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%TowerFreeConvNomCap == autosize) THEN
tmpTowerFreeConvNomCap = tmpNomTowerCap * SimpleTower(TowerNum)%TowerFreeConvNomCapSizingFactor
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%TowerFreeConvNomCap = tmpTowerFreeConvNomCap
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Free Convection Nominal Capacity [W]', &
SimpleTower(TowerNum)%TowerFreeConvNomCap)
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%DesignWaterFlowRate == autosize) THEN
! for nominal cap input method, get design water flow rate from nominal cap and scalable sizing factor
tmpDesignWaterFlowRate = tmpNomTowerCap * SimpleTower(TowerNum)%DesignWaterFlowPerUnitNomCap
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%DesignWaterFlowRate = tmpDesignWaterFlowRate
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Design Water Flow Rate [m3/s]', SimpleTower(TowerNum)%DesignWaterFlowRate)
ENDIF
ENDIF
CALL RegisterPlantCompDesignFlow(SimpleTower(TowerNum)%WaterInletNodeNum,tmpDesignWaterFlowRate)
IF (SimpleTower(TowerNum)%HighSpeedAirFlowRate == autosize) THEN
IF (SimpleTower(TowerNum)%DefaultedDesignAirFlowScalingFactor) THEN
tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum)%DesignAirFlowPerUnitNomCap * (101325.d0/StdBaroPress)
ELSE
tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum)%DesignAirFlowPerUnitNomCap
ENDIF
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%HighSpeedAirFlowRate = tmpDesignAirFlowRate
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Design Air Flow Rate [m3/s]', SimpleTower(TowerNum)%HighSpeedAirFlowRate)
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%FreeConvAirFlowRate == autosize) THEN
tmpFreeConvAirFlowRate = tmpDesignAirFlowRate * SimpleTower(TowerNum)%FreeConvAirFlowRateSizingFactor
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%FreeConvAirFlowRate = tmpFreeConvAirFlowRate
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Free Convection Regime Air Flow Rate [m3/s]', SimpleTower(TowerNum)%FreeConvAirFlowRate)
ENDIF
ENDIF
! now calcuate UA values from nominal capacities and flow rates
IF (PlantSizesOkayToFinalize .and. (.NOT. SimpleTower(TowerNum)%UAvaluesCompleted)) THEN
IF (PltSizCondNum > 0) THEN ! user has a plant sizing object
Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
PlantSizData(PltSizCondNum)%ExitTemp, &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex, &
'SizeTower')
SimpleTowerInlet(TowerNum)%WaterTemp = PlantSizData(PltSizCondNum)%ExitTemp + PlantSizData(PltSizCondNum)%DeltaT
ELSE ! probably no plant sizing object
Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex, &
'SizeTower')
SimpleTowerInlet(TowerNum)%WaterTemp = 35.d0 ! design condition
ENDIF
rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(SimpleTower(TowerNum)%LoopNum)%FluidIndex,&
'SizeTower')
! full speed fan tower UA
Par(1) = tmpNomTowerCap*SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
Par(2) = REAL(TowerNum,r64)
Par(3) = rho * tmpDesignWaterFlowRate ! design water mass flow rate
Par(4) = tmpDesignAirFlowRate ! design air volume flow rate
Par(5) = Cp
UA0 = 0.0001d0 * Par(1) ! Assume deltaT = 10000K (limit)
UA1 = Par(1) ! Assume deltaT = 1K
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)
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('calculating 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
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]', &
SimpleTower(TowerNum)%HighSpeedTowerUA)
! free convection tower UA
Par(1) = tmpTowerFreeConvNomCap*SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
Par(2) = REAL(TowerNum,r64)
Par(3) = rho * tmpDesignWaterFlowRate ! design water mass flow rate
Par(4) = tmpFreeConvAirFlowRate ! design air volume flow rate
Par(5) = Cp
UA0 = 0.0001d0 * Par(1) ! Assume deltaT = 10000K (limit)
UA0 = MAX(UA0, 1.d0) ! limit to 1.0
UA1 = Par(1) ! Assume deltaT = 1K
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)
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par)
IF (SolFla == -1) THEN
CALL ShowSevereError('Iteration limit exceeded in calculating tower free convection UA')
CALL ShowFatalError('calculating 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 free convection tower '//TRIM(SimpleTower(TowerNum)%Name))
ENDIF
SimpleTower(TowerNum)%FreeConvTowerUA = UA
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]', &
SimpleTower(TowerNum)%FreeConvTowerUA)
SimpleTower(TowerNum)%UAvaluesCompleted = .TRUE.
ENDIF
ELSEIF (SimpleTower(TowerNum)%PerformanceInputMethod_Num == PIM_UFactor) THEN
!UA input method
IF (SimpleTower(TowerNum)%DesignWaterFlowRate == autosize) THEN ! get from plant sizing
! UA input method using plant sizing for flow rate, whereas Nominal capacity method uses scalable sizing factor per cap
IF (PltSizCondNum > 0) THEN
IF (PlantSizData(PltSizCondNum)%DesVolFlowRate >= SmallWaterVolFlow) THEN
tmpDesignWaterFlowRate = PlantSizData(PltSizCondNum)%DesVolFlowRate* SimpleTower(TowerNum)%SizFac
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%DesignWaterFlowRate = tmpDesignWaterFlowRate
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Design Water Flow Rate [m3/s]', SimpleTower(TowerNum)%DesignWaterFlowRate)
ENDIF
ELSE
tmpDesignWaterFlowRate = 0.d0
ENDIF
ELSE
CALL ShowSevereError('Autosizing error for cooling tower object = '//TRIM(SimpleTower(TowerNum)%Name))
CALL ShowFatalError('Autosizing of cooling tower nominal capacity requires a loop Sizing:Plant object.')
ENDIF
ENDIF
CALL RegisterPlantCompDesignFlow(SimpleTower(TowerNum)%WaterInletNodeNum,tmpDesignWaterFlowRate)
IF ( SimpleTower(TowerNum)%HighSpeedTowerUA == autosize) THEN
! get nominal capacity from PlantSizData(PltSizCondNum)%DeltaT and PlantSizData(PltSizCondNum)%DesVolFlowRate
IF (PltSizCondNum > 0) THEN
IF (PlantSizData(PltSizCondNum)%DesVolFlowRate >= SmallWaterVolFlow) 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 &
* PlantSizData(PltSizCondNum)%DesVolFlowRate * PlantSizData(PltSizCondNum)%DeltaT &
* SimpleTower(TowerNum)%SizFac
tmpNomTowerCap = DesTowerLoad / SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%TowerNominalCapacity = tmpNomTowerCap
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Nominal Capacity [W]', SimpleTower(TowerNum)%TowerNominalCapacity)
ENDIF
ELSE
tmpNomTowerCap = 0.d0
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%TowerNominalCapacity = tmpNomTowerCap
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Nominal Capacity [W]', SimpleTower(TowerNum)%TowerNominalCapacity)
ENDIF
ENDIF
ELSE
CALL ShowSevereError('Autosizing error for cooling tower object = '//TRIM(SimpleTower(TowerNum)%Name))
CALL ShowFatalError('Autosizing of cooling tower nominal capacity requires a loop Sizing:Plant object.')
ENDIF
IF (SimpleTower(TowerNum)%TowerFreeConvNomCap == autosize) THEN
tmpTowerFreeConvNomCap = tmpNomTowerCap * SimpleTower(TowerNum)%TowerFreeConvNomCapSizingFactor
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%TowerFreeConvNomCap = tmpTowerFreeConvNomCap
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Free Convection Nominal Capacity [W]', &
SimpleTower(TowerNum)%TowerFreeConvNomCap)
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%HighSpeedAirFlowRate == autosize) THEN
IF (SimpleTower(TowerNum)%DefaultedDesignAirFlowScalingFactor) THEN
tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum)%DesignAirFlowPerUnitNomCap * (101325.d0/StdBaroPress)
ELSE
tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum)%DesignAirFlowPerUnitNomCap
ENDIF
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%HighSpeedAirFlowRate = tmpDesignAirFlowRate
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Design Air Flow Rate [m3/s]', SimpleTower(TowerNum)%HighSpeedAirFlowRate)
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%FreeConvAirFlowRate == autosize) THEN
tmpFreeConvAirFlowRate = tmpDesignAirFlowRate * SimpleTower(TowerNum)%FreeConvAirFlowRateSizingFactor
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%FreeConvAirFlowRate = tmpFreeConvAirFlowRate
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Free Convection Regime Air Flow Rate [m3/s]', SimpleTower(TowerNum)%FreeConvAirFlowRate)
ENDIF
ENDIF
! now calcuate UA values from nominal capacities and flow rates
IF (PlantSizesOkayToFinalize) 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')
! full speed fan tower UA
Par(1) = tmpNomTowerCap* SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
Par(2) = REAL(TowerNum,r64)
Par(3) = rho * tmpDesignWaterFlowRate ! design water mass flow rate
Par(4) = tmpDesignAirFlowRate ! design air volume flow rate
Par(5) = Cp
UA0 = 0.0001d0 * Par(1) ! Assume deltaT = 10000K (limit)
UA1 = Par(1) ! 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)
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('calculating 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
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]', &
SimpleTower(TowerNum)%HighSpeedTowerUA)
! free convection tower UA
Par(1) = tmpTowerFreeConvNomCap* SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
Par(2) = REAL(TowerNum,r64)
Par(3) = rho * tmpDesignWaterFlowRate ! design water mass flow rate
Par(4) = tmpFreeConvAirFlowRate ! design air volume flow rate
Par(5) = Cp
UA0 = 0.0001d0 * Par(1) ! Assume deltaT = 10000K (limit)
UA1 = Par(1) ! 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)
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par)
IF (SolFla == -1) THEN
CALL ShowSevereError('Iteration limit exceeded in calculating tower free convection UA')
CALL ShowFatalError('calculating 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 free convection tower '//TRIM(SimpleTower(TowerNum)%Name))
ENDIF
SimpleTower(TowerNum)%LowSpeedTowerUA = UA
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
ELSE !full speed UA given
IF (SimpleTower(TowerNum)%FreeConvTowerUA == autosize) THEN ! determine from scalable sizing factor
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%FreeConvTowerUA = SimpleTower(TowerNum)%HighSpeedTowerUA * &
SimpleTower(TowerNum)%FreeConvTowerUASizingFactor
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
ENDIF
IF (SimpleTower(TowerNum)%HighSpeedAirFlowRate == autosize) THEN ! given UA but not air flow rate
! need an air flow rate to find capacity from UA but flow rate is scaled off capacity
! get nominal capacity from PlantSizData(PltSizCondNum)%DeltaT and PlantSizData(PltSizCondNum)%DesVolFlowRate
IF (PltSizCondNum > 0) THEN
IF (PlantSizData(PltSizCondNum)%DesVolFlowRate >= SmallWaterVolFlow) 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 &
* PlantSizData(PltSizCondNum)%DesVolFlowRate * PlantSizData(PltSizCondNum)%DeltaT
tmpNomTowerCap = DesTowerLoad / SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%TowerNominalCapacity = tmpNomTowerCap
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Nominal Capacity [W]', SimpleTower(TowerNum)%TowerNominalCapacity)
ENDIF
ELSE
tmpNomTowerCap = 0.d0
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%TowerNominalCapacity = tmpNomTowerCap
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Nominal Capacity [W]', SimpleTower(TowerNum)%TowerNominalCapacity)
ENDIF
ENDIF
ELSE
CALL ShowSevereError('Autosizing error for cooling tower object = '//TRIM(SimpleTower(TowerNum)%Name))
CALL ShowFatalError('Autosizing of cooling tower nominal capacity requires a loop Sizing:Plant object.')
ENDIF
IF (SimpleTower(TowerNum)%DefaultedDesignAirFlowScalingFactor) THEN
tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum)%DesignAirFlowPerUnitNomCap * (101325.d0/StdBaroPress)
ELSE
tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum)%DesignAirFlowPerUnitNomCap
ENDIF
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%HighSpeedAirFlowRate = tmpDesignAirFlowRate
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Design Air Flow Rate [m3/s]', SimpleTower(TowerNum)%HighSpeedAirFlowRate)
ENDIF
ELSE ! UA and Air flow rate given, so find Nominal Cap from running model
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')
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)
CALL SimSimpleTower(TowerNum,rho * tmpDesignWaterFlowRate,SimpleTower(TowerNum)%HighSpeedAirFlowRate, &
SimpleTower(TowerNum)%HighSpeedTowerUA,OutWaterTemp)
tmpNomTowerCap = cp*rho * tmpDesignWaterFlowRate*(SimpleTowerInlet(TowerNum)%WaterTemp - OutWaterTemp)
tmpNomTowerCap = tmpNomTowerCap / SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%TowerNominalCapacity = tmpNomTowerCap
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Nominal Capacity [W]', SimpleTower(TowerNum)%TowerNominalCapacity)
ENDIF
ENDIF ! both UA and air flow rate given
IF (SimpleTower(TowerNum)%FreeConvAirFlowRate == autosize) THEN
tmpFreeConvAirFlowRate = tmpDesignAirFlowRate * SimpleTower(TowerNum)%FreeConvAirFlowRateSizingFactor
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%FreeConvAirFlowRate = tmpFreeConvAirFlowRate
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Free Convection Regime Air Flow Rate [m3/s]', SimpleTower(TowerNum)%FreeConvAirFlowRate)
ENDIF
ENDIF
CALL SimSimpleTower(TowerNum,rho * tmpDesignWaterFlowRate,tmpFreeConvAirFlowRate, &
SimpleTower(TowerNum)%FreeConvTowerUA,OutWaterTemp)
tmpTowerFreeConvNomCap = cp*rho * tmpDesignWaterFlowRate*(SimpleTowerInlet(TowerNum)%WaterTemp - OutWaterTemp)
tmpTowerFreeConvNomCap = tmpTowerFreeConvNomCap / SimpleTower(TowerNum)%HeatRejectCapNomCapSizingRatio
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%TowerFreeConvNomCap = tmpTowerFreeConvNomCap
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Free Convection Nominal Capacity [W]', &
SimpleTower(TowerNum)%TowerFreeConvNomCap)
ENDIF
ENDIF
ENDIF
IF (SimpleTower(TowerNum)%HighSpeedFanPower == autosize) THEN
tmpHighSpeedFanPower = tmpNomTowerCap * SimpleTower(TowerNum)%DesignFanPowerPerUnitNomCap
IF (PlantSizesOkayToFinalize) THEN
SimpleTower(TowerNum)%HighSpeedFanPower = tmpHighSpeedFanPower
CALL ReportSizingOutput(SimpleTower(TowerNum)%TowerType, SimpleTower(TowerNum)%Name, &
'Design Fan Power [W]', SimpleTower(TowerNum)%HighSpeedFanPower)
ENDIF
ENDIF
RETURN
END SUBROUTINE SizeVSMerkelTower