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.
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 CalcCoolTower
! SUBROUTINE INFORMATION:
! AUTHOR Daeho Kang
! DATE WRITTEN Aug 2008
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
!
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! Baruch Givoni. 1994. Passive and Low Energy Cooling of Buildings. Chapter 5: Evaporative Cooling Systems.
! John Wiley & Sons, Inc.
! USE STATEMENTS:
USE DataHeatBalFanSys, ONLY: MAT, ZT, ZoneAirHumRat, MCPC, MCPTC, CTMFL
USE ScheduleManager, ONLY: GetCurrentScheduleValue
USE Psychrometrics, ONLY: PsyCpAirFnWTdb, PsyWFnTdbTwbPb, PsyWFnTdbH, PsyRhoAirFnPbTdbW, RhoH2O
USE DataEnvironment, ONLY: OutBaroPress, OutDryBulbTemp, OutWetBulbTemp, OutHumRat, WindSpeed, OutEnthalpy
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: MinWindSpeed = 0.1d0 ! Minimum limit of outdoor air wind speed in m/s
REAL(r64), PARAMETER :: MaxWindSpeed = 30.0d0 ! Maximum limit of outdoor air wind speed in m/s
REAL(r64), PARAMETER :: UCFactor = 60000.0d0 ! Unit conversion factor m3/s to l/min
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: ZoneNum ! Number of zone being served
INTEGER :: CoolTowerNum ! Number of coolter being served
REAL(r64), ALLOCATABLE, DIMENSION(:), SAVE :: CVF ! Design flow rate in m3/s
REAL(r64) :: AirMassFlowRate ! Actual air mass flow rate in kg/s
REAL(r64) :: AirSpecHeat ! Specific heat of air
REAL(r64) :: AirDensity ! Density of air
REAL(r64) :: RhoWater ! Density of water
REAL(r64) :: PumpPartLoadRat ! Pump part load ratio (based on user schedule, or 1.0 for no schedule)
REAL(r64) :: WaterFlowRate ! Calculated water flow rate in m3/s
REAL(r64) :: AirVolFlowRate ! Calculated air volume flow rate in m3/s
REAL(r64) :: InletHumRat ! Humidity ratio of outdoor air
!unused1208REAL(r64) :: InletEnthalpy ! Enthalpy of outdoor air
REAL(r64) :: OutletHumRat ! Humidity ratio of air at the cooltower outlet
REAL(r64) :: OutletTemp ! Dry bulb temperature of air at the cooltower outlet
REAL(r64) :: IntHumRat ! Humidity ratio of initialized air
! Allocate the CVF array
IF (.NOT. ALLOCATED(CVF)) ALLOCATE(CVF(NumOfZones))
CVF = 0.0d0
MCPTC = 0.0d0
MCPC = 0.0d0
CTMFL = 0.0d0
DO CoolTowerNum = 1, NumCoolTowers
ZoneNum = CoolTowerSys(CoolTowerNum)%ZonePtr
IF (GetCurrentScheduleValue(CoolTowerSys(CoolTowerNum)%SchedPtr) > 0.0d0) THEN
! check component operation
IF (WindSpeed < MinWindSpeed .OR. WindSpeed > MaxWindSpeed) CYCLE
IF (MAT(ZoneNum) < CoolTowerSys(CoolTowerNum)%MinZoneTemp) CYCLE
! Unit is on and simulate this component
! Determine the temperature and air flow rate at the cooltower outlet
IF (CoolTowerSys(CoolTowerNum)%FlowCtrlType == WindDrivenFlow) THEN
CoolTowerSys(CoolTowerNum)%OutletVelocity = 0.7d0 * (CoolTowerSys(CoolTowerNum)%TowerHeight)**0.5d0 + &
0.47d0 * (WindSpeed - 1.d0)
AirVolFlowRate = CoolTowerSys(CoolTowerNum)%OutletArea * CoolTowerSys(CoolTowerNum)%OutletVelocity
AirVolFlowRate = Min(AirVolFlowRate,CoolTowerSys(CoolTowerNum)%MaxAirVolFlowRate)
WaterFlowRate = (AirVolFlowRate / (0.0125d0 * (CoolTowerSys(CoolTowerNum)%TowerHeight)**0.5d0))
IF (WaterFlowRate > CoolTowerSys(CoolTowerNum)%MaxWaterFlowRate * UCFactor) THEN
WaterFlowRate = CoolTowerSys(CoolTowerNum)%MaxWaterFlowRate * UCFactor
AirVolFlowRate = 0.0125d0 * WaterFlowRate * (CoolTowerSys(CoolTowerNum)%TowerHeight)**0.5d0
AirVolFlowRate = Min(AirVolFlowRate,CoolTowerSys(CoolTowerNum)%MaxAirVolFlowRate)
END IF
WaterFlowRate = MIN(WaterFlowRate,(CoolTowerSys(CoolTowerNum)%MaxWaterFlowRate * UCFactor))
OutletTemp = OutDryBulbTemp - (OutDryBulbTemp - OutWetBulbTemp) * &
(1.d0-exp(-0.8d0 * CoolTowerSys(CoolTowerNum)%TowerHeight)) * &
(1.d0-exp(-0.15d0 * WaterFlowRate))
ELSE IF (CoolTowerSys(CoolTowerNum)%FlowCtrlType == WaterFlowSchedule) THEN
WaterFlowRate = CoolTowerSys(CoolTowerNum)%MaxWaterFlowRate * UCFactor
AirVolFlowRate = 0.0125d0 * WaterFlowRate * (CoolTowerSys(CoolTowerNum)%TowerHeight)**0.5d0
AirVolFlowRate = Min(AirVolFlowRate,CoolTowerSys(CoolTowerNum)%MaxAirVolFlowRate)
OutletTemp = OutDryBulbTemp - (OutDryBulbTemp - OutWetBulbTemp) * &
(1.d0-exp(-0.8d0 * CoolTowerSys(CoolTowerNum)%TowerHeight)) * &
(1.d0-exp(-0.15d0 * WaterFlowRate))
END IF
IF (OutletTemp < OutWetBulbTemp) THEN
CALL ShowSevereError('Cooltower outlet temperature exceed the outdoor wet bulb temperature '//&
'reset to input values')
CALL ShowContinueError('Occurs in Cooltower ='//TRIM(CoolTowerSys(CoolTowerNum)%Name))
END IF
WaterFlowRate = WaterFlowRate / UCFactor
! Determine actual water flow rate
IF (CoolTowerSys(CoolTowerNum)%FracWaterLoss > 0.0d0) THEN
CoolTowerSys(CoolTowerNum)%ActualWaterFlowRate = WaterFlowRate * &
(1.0d0 + CoolTowerSys(CoolTowerNum)%FracWaterLoss)
ELSE
CoolTowerSys(CoolTowerNum)%ActualWaterFlowRate = WaterFlowRate
END IF
! Determine actual air flow rate
IF (CoolTowerSys(CoolTowerNum)%FracFlowSched > 0.0d0) THEN
CoolTowerSys(CoolTowerNum)%ActualAirVolFlowRate = AirVolFlowRate * &
(1.0d0 - CoolTowerSys(CoolTowerNum)%FracFlowSched)
ELSE
CoolTowerSys(CoolTowerNum)%ActualAirVolFlowRate = AirVolFlowRate
END IF
! Determine pump power
IF (GetCurrentScheduleValue(CoolTowerSys(CoolTowerNum)%PumpSchedPtr) > 0) THEN
PumpPartLoadRat = GetCurrentScheduleValue(CoolTowerSys(CoolTowerNum)%PumpSchedPtr)
ELSE
PumpPartLoadRat = 1.0d0
END IF
! Determine air mass flow rate and volume flow rate
InletHumRat = PsyWFnTdbTwbPb(OutDryBulbTemp,OutWetBulbTemp,OutBaroPress)
! Assume no pressure drops and no changes in enthalpy between inlet and outlet air
IntHumRat = PsyWFnTdbH(OutletTemp,OutEnthalpy) ! Initialized humidity ratio
AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress,OutletTemp,IntHumRat)
AirMassFlowRate = AirDensity * CoolTowerSys(CoolTowerNum)%ActualAirVolFlowRate
! From the mass balance W_in*(m_air + m_water) = W_out*m_air
RhoWater = RhoH2O(OutletTemp) ! Assume T_water = T_outlet
OutletHumRat = (InletHumRat*(AirMassFlowRate + (CoolTowerSys(CoolTowerNum)%ActualWaterFlowRate * RhoWater))) &
/ AirMassFlowRate
AirSpecHeat = PsyCpAirFnWTdb(OutletHumRat,OutletTemp)
AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress,OutletTemp,OutletHumRat) ! Outlet air density
CVF(ZoneNum) = CoolTowerSys(CoolTowerNum)%ActualAirVolFlowRate * &
GetCurrentScheduleValue(CoolTowerSys(CoolTowerNum)%SchedPtr)
MCPC(ZoneNum) = CVF(ZoneNum) * AirDensity * AirSpecHeat
MCPTC(ZoneNum) = MCPC(ZoneNum) * OutletTemp
CTMFL(ZoneNum) = MCPC(ZoneNum) / AirSpecHeat
CoolTowerSys(CoolTowerNum)%SenHeatPower = MCPC(ZoneNum) * ABS(ZT(ZoneNum) - OutletTemp)
CoolTowerSys(CoolTowerNum)%LatHeatPower = CVF(ZoneNum) * ABS(ZoneAirHumRat(ZoneNum) - OutletHumRat)
CoolTowerSys(CoolTowerNum)%OutletTemp = OutletTemp
CoolTowerSys(CoolTowerNum)%OutletHumRat = OutletHumRat
CoolTowerSys(CoolTowerNum)%AirVolFlowRate = CVF(ZoneNum)
CoolTowerSys(CoolTowerNum)%AirMassFlowRate = CTMFL(ZoneNum)
CoolTowerSys(CoolTowerNum)%InletDBTemp = Zone(ZoneNum)%OutDryBulbTemp
CoolTowerSys(CoolTowerNum)%InletWBTemp = Zone(ZoneNum)%OutWetBulbTemp
CoolTowerSys(CoolTowerNum)%InletHumRat = OutHumRat
CoolTowerSys(CoolTowerNum)%CoolTWaterConsumpRate = (ABS(InletHumRat - OutletHumRat)*CTMFL(ZoneNum)) / RhoWater
CoolTowerSys(CoolTowerNum)%CoolTWaterStarvMakeupRate = 0.0d0 ! initialize -- calc in update
CoolTowerSys(CoolTowerNum)%PumpElecPower = CoolTowerSys(CoolTowerNum)%RatedPumpPower * PumpPartLoadRat
ELSE ! Unit is off
CoolTowerSys(CoolTowerNum)%SenHeatPower = 0.0d0
CoolTowerSys(CoolTowerNum)%LatHeatPower = 0.0d0
CoolTowerSys(CoolTowerNum)%OutletTemp = 0.0d0
CoolTowerSys(CoolTowerNum)%OutletHumRat = 0.0d0
CoolTowerSys(CoolTowerNum)%AirVolFlowRate = 0.0d0
CoolTowerSys(CoolTowerNum)%AirMassFlowRate = 0.0d0
CoolTowerSys(CoolTowerNum)%InletDBTemp = 0.0d0
CoolTowerSys(CoolTowerNum)%InletHumRat = 0.0d0
CoolTowerSys(CoolTowerNum)%PumpElecPower = 0.0d0
CoolTowerSys(CoolTowerNum)%CoolTWaterConsumpRate = 0.0d0
CoolTowerSys(CoolTowerNum)%CoolTWaterStarvMakeupRate = 0.0d0
END IF
END DO
RETURN
END SUBROUTINE CalcCoolTower