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) | :: | J | |||
integer, | intent(in) | :: | LFLAG | |||
real(kind=r64), | intent(in) | :: | PDROP | |||
integer, | intent(in) | :: | I | |||
integer, | intent(in) | :: | N | |||
integer, | intent(in) | :: | M | |||
real(kind=r64), | intent(out) | :: | F(2) | |||
real(kind=r64), | intent(out) | :: | DF(2) | |||
integer, | intent(out) | :: | NF |
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 AFEEXF(J,LFLAG,PDROP,I,N,M,F,DF,NF)
!
! SUBROUTINE INFORMATION:
! AUTHOR George Walton
! DATE WRITTEN Extracted from AIRNET
! MODIFIED Lixing Gu, 12/17/06
! Revised for zone exhaust fan
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine solves airflow for a surface crack component
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataLoopNode, ONLY: Node
USE DataHVACGlobals, ONLY: VerySmallMassFlow
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: J ! Component number
INTEGER, INTENT(IN) :: LFLAG ! Initialization flag.If = 1, use laminar relationship
REAL(r64), INTENT(IN) :: PDROP ! Total pressure drop across a component (P1 - P2) [Pa]
INTEGER, INTENT(IN) :: I ! Linkage number
INTEGER, INTENT(IN) :: N ! Node 1 number
INTEGER, INTENT(IN) :: M ! Node 2 number
INTEGER, INTENT(OUT) :: NF ! Number of flows, either 1 or 2
REAL(r64), INTENT(OUT) :: F(2) ! Airflow through the component [kg/s]
REAL(r64), INTENT(OUT) :: DF(2) ! Partial derivative: DF/DP
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) CDM, FL, FT
REAL(r64) RhozNorm, VisczNorm, expn, Ctl, coef, Corr, VisAve, Tave, RhoCor
INTEGER CompNum,InletNode
! FLOW:
CompNum = AirflowNetworkCompData(J)%TypeNum
InletNode = MultizoneCompExhaustFanData(CompNum)%InletNode
If (Node(InletNode)%MassFlowRate > VerySmallMassFlow) then
! Treat the component as an exhaust fan
NF = 1
F(1) = Node(InletNode)%MassFlowRate
DF(1) = 0.0d0
RETURN
Else
! Treat the component as a surface crack
! Crack standard condition from given inputs
Corr = MultizoneSurfaceData(I)%Factor
RhozNorm = PsyRhoAirFnPbTdbW(MultizoneCompExhaustFanData(CompNum)%StandardP, &
MultizoneCompExhaustFanData(CompNum)%StandardT,MultizoneCompExhaustFanData(CompNum)%StandardW)
VisczNorm = 1.71432d-5+4.828d-8*MultizoneCompExhaustFanData(CompNum)%StandardT
expn = MultizoneCompExhaustFanData(CompNum)%FlowExpo
VisAve = (VISCZ(N)+VISCZ(M))/2.0d0
Tave = (TZ(N)+TZ(M))/2.0d0
IF(PDROP.GE.0.0d0) THEN
coef = MultizoneCompExhaustFanData(CompNum)%FlowCoef/SQRTDZ(N)*Corr
ELSE
coef = MultizoneCompExhaustFanData(CompNum)%FlowCoef/SQRTDZ(M)*Corr
END IF
NF = 1
IF(LFLAG.EQ.1) THEN
! Initialization by linear relation.
IF(PDROP.GE.0.0d0) THEN
RhoCor = (TZ(N)+KelvinConv)/(Tave+KelvinConv)
ctl = (RhozNorm/RHOZ(N)/RhoCor)**(expn-1.0d0)*(VisczNorm/VisAve)**(2.d0*expn-1.0d0)
DF(1) = Coef*RHOZ(N)/VISCZ(N)*ctl
ELSE
RhoCor = (TZ(M)+KelvinConv)/(Tave+KelvinConv)
ctl = (RhozNorm/RHOZ(M)/RhoCor)**(expn-1.0d0)*(VisczNorm/VisAve)**(2.d0*expn-1.0d0)
DF(1) = Coef*RHOZ(M)/VISCZ(M)*ctl
END IF
F(1) = -DF(1)*PDROP
ELSE
! Standard calculation.
IF(PDROP.GE.0.0d0) THEN
! Flow in positive direction.
! Laminar flow.
RhoCor = (TZ(N)+KelvinConv)/(Tave+KelvinConv)
ctl = (RhozNorm/RHOZ(N)/RhoCor)**(expn-1.0d0)*(VisczNorm/VisAve)**(2.d0*expn-1.0d0)
CDM = Coef*RHOZ(N)/VISCZ(N)*ctl
FL = CDM*PDROP
! Turbulent flow.
IF(expn .EQ. 0.5d0) THEN
FT = Coef*SQRTDZ(N)*SQRT(PDROP)*ctl
ELSE
FT = Coef*SQRTDZ(N)*(PDROP**expn)*ctl
END IF
ELSE
! Flow in negative direction.
! Laminar flow.
RhoCor = (TZ(M)+KelvinConv)/(Tave+KelvinConv)
ctl = (RhozNorm/RHOZ(M)/RhoCor)**(expn-1.0d0)*(VisczNorm/VisAve)**(2.d0*expn-1.0d0)
CDM = Coef*RHOZ(M)/VISCZ(M)*ctl
FL = CDM*PDROP
! Turbulent flow.
IF(expn .EQ. 0.5d0) THEN
FT = -Coef*SQRTDZ(M)*SQRT(-PDROP)*ctl
ELSE
FT = -Coef*SQRTDZ(M)*(-PDROP)**expn*ctl
END IF
END IF
! Select laminar or turbulent flow.
IF(LIST.GE.4) WRITE(Unit21,901) ' scr: ',I,PDROP,FL,FT
IF(ABS(FL).LE.ABS(FT)) THEN
F(1) = FL
DF(1) = CDM
ELSE
F(1) = FT
DF(1) = FT*expn/PDROP
END IF
END IF
End If
!
901 FORMAT(A5,I3,6X,4E16.7)
RETURN
END SUBROUTINE AFEEXF