Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | CoilNum | |||
real(kind=r64), | intent(in) | :: | CapacityStream1 | |||
real(kind=r64), | intent(in) | :: | EnergyInStreamOne | |||
real(kind=r64), | intent(in) | :: | CapacityStream2 | |||
real(kind=r64), | intent(in) | :: | EnergyInStreamTwo | |||
real(kind=r64), | intent(in) | :: | CoilUA | |||
real(kind=r64) | :: | EnergyOutStreamOne | ||||
real(kind=r64) | :: | EnergyOutStreamTwo |
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 CoilOutletStreamCondition(CoilNum, CapacityStream1,EnergyInStreamOne, &
CapacityStream2,EnergyInStreamTwo, &
CoilUA,EnergyOutStreamOne,EnergyOutStreamTwo)
! FUNCTION INFORMATION:
! AUTHOR Rahul Chillar
! DATE WRITTEN March 2004
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! Calculate the outlet states of a simple heat exchanger using the effectiveness-Ntu
! method of analysis.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! Kays, W.M. and A.L. London. 1964.Compact Heat Exchangers, 2nd Ed.McGraw-Hill:New York.
! USE STATEMENTS:
! na
! Enforce explicit typing of all variables in this routine
Implicit None
! FUNCTION ARGUMENT DEFINITIONS:
Integer, intent(in) :: CoilNum
REAL(r64), intent(in) :: CapacityStream1 ! Capacity rate of stream1(W/C)
REAL(r64), intent(in) :: EnergyInStreamOne ! Inlet state of stream1 (C)
REAL(r64), intent(in) :: CapacityStream2 ! Capacity rate of stream2 (W/C)
REAL(r64), intent(in) :: EnergyInStreamTwo ! Inlet state of stream2 (C)
REAL(r64), intent(in) :: CoilUA ! Heat transfer rateW)
REAL(r64) :: EnergyOutStreamOne ! Outlet state of stream1 (C)
REAL(r64) :: EnergyOutStreamTwo ! Outlet state of stream2 (C)
! FUNCTION PARAMETER DEFINITIONS:
REAL(r64),Parameter:: LargeNo = 1.d10 ! value used in place of infinity
REAL(r64),Parameter:: SmallNo = 1.d-15 ! value used in place of zero
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
REAL(r64) MinimumCapacityStream ! Minimum capacity rate of the streams(W/C)
REAL(r64) MaximumCapacityStream ! Maximum capacity rate of the streams(W/C)
REAL(r64) RatioStreamCapacity ! Ratio of minimum to maximum capacity rate
REAL(r64) NTU ! Number of transfer units
REAL(r64) :: effectiveness=0.0d0 ! Heat exchanger effectiveness
REAL(r64) MaxHeatTransfer ! Maximum heat transfer possible(W)
REAL(r64) e, eta, b, d ! Intermediate variables in effectivness equation
! NTU and MinimumCapacityStream/MaximumCapacityStream (RatioStreamCapacity) calculations
MinimumCapacityStream = MIN(CapacityStream1,CapacityStream2)
MaximumCapacityStream = MAX(CapacityStream1,CapacityStream2)
IF(ABS(MaximumCapacityStream) .le. 1.d-6) THEN ! .EQ. 0.0d0) THEN
RatioStreamCapacity = 1.d0
ELSE
RatioStreamCapacity = MinimumCapacityStream/MaximumCapacityStream
ENDIF
IF(ABS(MinimumCapacityStream) .le. 1.d-6) THEN ! .EQ. 0.0d0) THEN
NTU = LargeNo
ELSE
NTU = CoilUA/MinimumCapacityStream
ENDIF
! Calculate effectiveness for special limiting cases
IF(NTU .LE. 0.0d0) THEN
effectiveness = 0.0d0
ELSE IF(RatioStreamCapacity .LT. SmallNo) THEN
! MinimumCapacityStream/MaximumCapacityStream = 0 and effectiveness is independent of configuration
! 20 is the Limit Chosen for Exponential Function, beyond which there is float point error.
If(NTU > 20.d0) THEN
effectiveness = 1.0d0
Else
effectiveness = 1.0d0 - EXP(-NTU)
End If
! Calculate effectiveness depending on heat exchanger configuration
ELSE IF (WaterCoil(CoilNum)%HeatExchType .EQ. CounterFlow) THEN
! Counterflow Heat Exchanger Configuration
IF (ABS(RatioStreamCapacity-1.d0) .LT. SmallNo) THEN
effectiveness = NTU/(NTU+1.0d0)
ELSE
If(NTU*(1.d0-RatioStreamCapacity) > 20.0d0) Then
e = 0.0d0
Else
e=EXP(-NTU*(1.d0-RatioStreamCapacity))
End If
effectiveness = (1.d0-e)/(1.d0-RatioStreamCapacity*e)
ENDIF
ELSE IF (WaterCoil(CoilNum)%HeatExchType .EQ. CrossFlow) THEN
! Cross flow, both streams unmixed
eta = NTU**(-0.22d0)
If((NTU*RatioStreamCapacity*eta)>20.d0) Then
b=1.0d0/(RatioStreamCapacity*eta)
If(b>20.d0) THEN
effectiveness=1.d0
Else
effectiveness = 1.0d0 - EXP(-b)
If(effectiveness.LT.0.0d0) effectiveness=0.0d0
End If
Else
d=((EXP(-NTU*RatioStreamCapacity*eta)-1.d0)/(RatioStreamCapacity*eta))
If(d .LT. -20.0d0 .OR. d .GT. 0.0d0) Then
effectiveness=1.0d0
Else
effectiveness = 1.0d0 - EXP((EXP(-NTU*RatioStreamCapacity*eta)-1.d0)/(RatioStreamCapacity*eta))
If(effectiveness.LT.0.0d0) effectiveness=0.0d0
End if
End if
ENDIF
! Determine leaving conditions for the two streams
MaxHeatTransfer = MAX(MinimumCapacityStream,SmallNo)*(EnergyInStreamOne-EnergyInStreamTwo)
EnergyOutStreamOne = EnergyInStreamOne - effectiveness* &
MaxHeatTransfer/MAX(CapacityStream1,SmallNo)
EnergyOutStreamTwo = EnergyInStreamTwo + effectiveness* &
MaxHeatTransfer/MAX(CapacityStream2,SmallNo)
RETURN
END SUBROUTINE CoilOutletStreamCondition