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) | :: | WaterConnNum |
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 CalcConnectionsHeatRecovery(WaterConnNum)
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN August 2006
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculate drainwater heat recovery
! METHODOLOGY EMPLOYED:
!
! USE STATEMENTS:
USE Psychrometrics, ONLY: CPHW
!unused0909 USE DataEnvironment, ONLY: WaterMainsTemp
USE DataWater, ONLY: WaterStorage
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: WaterConnNum
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: CapacityRatio, NTU, ExpVal, HXCapacityRate, DrainCapacityRate, MinCapacityRate
! FLOW:
IF (.NOT. WaterConnections(WaterConnNum)%HeatRecovery) THEN
WaterConnections(WaterConnNum)%RecoveryTemp = WaterConnections(WaterConnNum)%ColdSupplyTemp
WaterConnections(WaterConnNum)%ReturnTemp = WaterConnections(WaterConnNum)%ColdSupplyTemp
WaterConnections(WaterConnNum)%WasteTemp = WaterConnections(WaterConnNum)%DrainTemp
ELSE IF (WaterConnections(WaterConnNum)%TotalMassFlowRate == 0.0d0) THEN
WaterConnections(WaterConnNum)%Effectiveness = 0.0d0
WaterConnections(WaterConnNum)%RecoveryRate = 0.0d0
WaterConnections(WaterConnNum)%RecoveryTemp = WaterConnections(WaterConnNum)%ColdSupplyTemp
WaterConnections(WaterConnNum)%ReturnTemp = WaterConnections(WaterConnNum)%ColdSupplyTemp
WaterConnections(WaterConnNum)%WasteTemp = WaterConnections(WaterConnNum)%DrainTemp
ELSE ! WaterConnections(WaterConnNum)%TotalMassFlowRate > 0.0
SELECT CASE (WaterConnections(WaterConnNum)%HeatRecoveryConfig)
CASE (HeatRecoveryConfigPlant)
WaterConnections(WaterConnNum)%RecoveryMassFlowRate = WaterConnections(WaterConnNum)%HotMassFlowRate
CASE (HeatRecoveryConfigEquipment)
WaterConnections(WaterConnNum)%RecoveryMassFlowRate = WaterConnections(WaterConnNum)%ColdMassFlowRate
CASE (HeatRecoveryConfigPlantAndEquip)
WaterConnections(WaterConnNum)%RecoveryMassFlowRate = WaterConnections(WaterConnNum)%TotalMassFlowRate
END SELECT
HXCapacityRate = CPHW(InitConvTemp) * WaterConnections(WaterConnNum)%RecoveryMassFlowRate
DrainCapacityRate = CPHW(InitConvTemp) * WaterConnections(WaterConnNum)%DrainMassFlowRate
MinCapacityRate = MIN(DrainCapacityRate, HXCapacityRate)
SELECT CASE (WaterConnections(WaterConnNum)%HeatRecoveryHX)
CASE (HeatRecoveryHXIdeal)
WaterConnections(WaterConnNum)%Effectiveness = 1.0d0
CASE (HeatRecoveryHXCounterFlow) ! Unmixed
CapacityRatio = MinCapacityRate / MAX(DrainCapacityRate, HXCapacityRate)
NTU = WaterConnections(WaterConnNum)%HXUA / MinCapacityRate
IF (CapacityRatio == 1.0d0) THEN
WaterConnections(WaterConnNum)%Effectiveness = NTU / (1.0d0 + NTU)
ELSE
ExpVal = EXP(-NTU * (1.0d0 - CapacityRatio))
WaterConnections(WaterConnNum)%Effectiveness = (1.0d0 - ExpVal) / (1.0d0 - CapacityRatio * ExpVal)
END IF
CASE (HeatRecoveryHXCrossFlow) ! Unmixed
CapacityRatio = MinCapacityRate / MAX(DrainCapacityRate, HXCapacityRate)
NTU = WaterConnections(WaterConnNum)%HXUA / MinCapacityRate
WaterConnections(WaterConnNum)%Effectiveness = 1.0d0 - EXP((NTU ** 0.22d0 / CapacityRatio) * &
(EXP(-CapacityRatio * NTU ** 0.78d0) - 1.0d0))
END SELECT
WaterConnections(WaterConnNum)%RecoveryRate = WaterConnections(WaterConnNum)%Effectiveness * MinCapacityRate * &
(WaterConnections(WaterConnNum)%DrainTemp - WaterConnections(WaterConnNum)%ColdSupplyTemp)
WaterConnections(WaterConnNum)%RecoveryTemp = WaterConnections(WaterConnNum)%ColdSupplyTemp + &
WaterConnections(WaterConnNum)%RecoveryRate / (CPHW(InitConvTemp) * WaterConnections(WaterConnNum)%TotalMassFlowRate)
WaterConnections(WaterConnNum)%WasteTemp = WaterConnections(WaterConnNum)%DrainTemp - &
WaterConnections(WaterConnNum)%RecoveryRate / (CPHW(InitConvTemp) * WaterConnections(WaterConnNum)%TotalMassFlowRate)
IF (WaterConnections(WaterConnNum)%RecoveryTankNum > 0) THEN
WaterStorage(WaterConnections(WaterConnNum)%RecoveryTankNum)%VdotAvailSupply(WaterConnections(WaterConnNum)%TankSupplyID) &
= WaterConnections(WaterConnNum)%DrainVolFlowRate
WaterStorage(WaterConnections(WaterConnNum)%RecoveryTankNum)%TwaterSupply(WaterConnections(WaterConnNum)%TankSupplyID) &
= WaterConnections(WaterConnNum)%WasteTemp
END IF
SELECT CASE (WaterConnections(WaterConnNum)%HeatRecoveryConfig)
CASE (HeatRecoveryConfigPlant)
WaterConnections(WaterConnNum)%TempError = 0.0d0 ! No feedback back to the cold supply
!WaterConnections(WaterConnNum)%ColdTemp = WaterConnections(WaterConnNum)%ColdSupplyTemp
WaterConnections(WaterConnNum)%ReturnTemp = WaterConnections(WaterConnNum)%RecoveryTemp
CASE (HeatRecoveryConfigEquipment)
WaterConnections(WaterConnNum)%TempError = ABS(WaterConnections(WaterConnNum)%ColdTemp &
- WaterConnections(WaterConnNum)%RecoveryTemp)
WaterConnections(WaterConnNum)%ColdTemp = WaterConnections(WaterConnNum)%RecoveryTemp
WaterConnections(WaterConnNum)%ReturnTemp = WaterConnections(WaterConnNum)%ColdSupplyTemp
CASE (HeatRecoveryConfigPlantAndEquip)
WaterConnections(WaterConnNum)%TempError = ABS(WaterConnections(WaterConnNum)%ColdTemp &
- WaterConnections(WaterConnNum)%RecoveryTemp)
WaterConnections(WaterConnNum)%ColdTemp = WaterConnections(WaterConnNum)%RecoveryTemp
WaterConnections(WaterConnNum)%ReturnTemp = WaterConnections(WaterConnNum)%RecoveryTemp
END SELECT
END IF
RETURN
END SUBROUTINE CalcConnectionsHeatRecovery