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 | |||
real(kind=r64), | intent(in) | :: | WaterFlowRateRatio | |||
real(kind=r64), | intent(in) | :: | AirFlowRateRatio | |||
real(kind=r64), | intent(in) | :: | Twb | |||
real(kind=r64), | intent(out) | :: | OutletWaterTemp |
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 SimVariableTower(TowerNum, WaterFlowRateRatio, AirFlowRateRatio, Twb, OutletWaterTemp)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN Feb. 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
!
! To calculate the leaving water temperature of the variable speed cooling tower.
! METHODOLOGY EMPLOYED:
!
! The range temperature is varied to determine balance point where model output (Tapproach),
! range temperature and inlet air wet-bulb temperature show a balance as:
! Twb + Tapproach + Trange = Node(WaterInletNode)%Temp
! REFERENCES:
!
! Benton, D.J., Bowmand, C.F., Hydeman, M., Miller, P.,
! "An Improved Cooling Tower Algorithm for the CoolToolsTM Simulation Model".
! ASHRAE Transactions 2002, V. 108, Pt. 1.
!
! York International Corporation, "YORKcalcTM Software, Chiller-Plant Energy-Estimating Program",
! Form 160.00-SG2 (0502). © 2002.
! USE STATEMENTS:
!
USE General, ONLY: SolveRegulaFalsi
USE DataPlant, ONLY: SingleSetPoint, DualSetpointDeadband
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: TowerNum ! variable speed tower index
REAL(r64), INTENT(IN) :: WaterFlowRateRatio ! current water flow rate ratio (capped if applicable)
REAL(r64), INTENT(IN) :: AirFlowRateRatio ! current air flow rate ratio
REAL(r64), INTENT(IN) :: Twb ! current inlet air wet-bulb temperature (C, capped if applicable)
REAL(r64), INTENT(OUT) :: OutletWaterTemp ! calculated tower outlet water temperature (C)
! 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 :: SolFla ! Flag of solver
REAL(r64), DIMENSION(4) :: Par ! Parameter array for regula falsi solver
REAL(r64) :: Tr ! range temperature which results in an energy balance
REAL(r64) :: TempSetPoint ! local temporary for loop setpoint
! determine tower outlet water temperature
Par(1) = TowerNum ! Index to cooling tower
Par(2) = WaterFlowRateRatio ! water flow rate ratio
Par(3) = AirFlowRateRatio ! air flow rate ratio
Par(4) = Twb ! inlet air wet-bulb temperature [C]
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, Tr, SimpleTowerTrResidual, 0.001d0, &
VSTower(SimpleTower(TowerNum)%VSTower)%MaxRangeTemp, Par)
OutletWaterTemp = SimpleTowerInlet(TowerNum)%WaterTemp - Tr
IF (SolFla == -1) THEN
CALL ShowSevereError('Iteration limit exceeded in calculating tower nominal capacity at minimum air flow ratio')
CALL ShowContinueError('Design inlet air wet-bulb or approach temperature must be modified to achieve an acceptable'// &
' range at the minimum air flow rate')
CALL ShowContinueError('Cooling tower simulation failed to converge for tower '//TRIM(SimpleTower(TowerNum)%Name))
! if SolFla = -2, Tr is returned as minimum value (0.001) and outlet temp = inlet temp - 0.001
ELSE IF (SolFla == -2) THEN ! decide if should run at max flow
SELECT CASE (PlantLoop(SimpleTower(TowerNum)%LoopNum)%LoopDemandCalcScheme)
CASE (SingleSetPoint)
TempSetPoint = PlantLoop(SimpleTower(TowerNum)%LoopNum)%LoopSide(SimpleTower(TowerNum)%LoopSideNum)%TempSetpoint
CASE (DualSetPointDeadBand)
TempSetPoint = PlantLoop(SimpleTower(TowerNum)%LoopNum)%LoopSide(SimpleTower(TowerNum)%LoopSideNum)%TempSetpointHi
END SELECT
IF (SimpleTowerInlet(TowerNum)%WaterTemp > &
(TempSetPoint + VSTower(SimpleTower(TowerNum)%VSTower)%MaxRangeTemp ) ) THEN ! run flat out
OutletWaterTemp = SimpleTowerInlet(TowerNum)%WaterTemp - VSTower(SimpleTower(TowerNum)%VSTower)%MaxRangeTemp
ENDIF
END IF
RETURN
END SUBROUTINE SimVariableTower