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 AFEDMP(J,LFLAG,PDROP,I,N,M,F,DF,NF)
! SUBROUTINE INFORMATION:
! AUTHOR George Walton
! DATE WRITTEN Extracted from AIRNET
! MODIFIED Lixing Gu, 2/1/04
! Revised the subroutine to meet E+ needs
! MODIFIED Lixing Gu, 6/8/05
!
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine solves airflow for a Controlled power law resistance airflow component (damper)
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
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) C
INTEGER CompNum
! FLOW:
! Get component number
CompNum = AirflowNetworkCompData(J)%TypeNum
NF = 1
C = AFECTL(I)
IF(C.LT.DisSysCompDamperData(CompNum)%FlowMin) C = DisSysCompDamperData(CompNum)%FlowMin
IF(C.GT.DisSysCompDamperData(CompNum)%FlowMax) C = DisSysCompDamperData(CompNum)%FlowMax
C = DisSysCompDamperData(CompNum)%A0+C*(DisSysCompDamperData(CompNum)%A1+C* &
(DisSysCompDamperData(CompNum)%A2+C*DisSysCompDamperData(CompNum)%A3))
IF(LIST.GE.4) WRITE(Unit21,901) ' Dmp:',I,AFECTL(I),DisSysCompDamperData(CompNum)%FlowMin, &
DisSysCompDamperData(CompNum)%FlowMax,C
IF(LFLAG.EQ.1 .OR. ABS(PDROP).LE.DisSysCompDamperData(CompNum)%LTP) THEN
! Laminar flow.
IF(PDROP.GE.0.0d0) THEN
DF(1) = C*DisSysCompDamperData(CompNum)%LamFlow*RHOZ(N)/VISCZ(N)
ELSE
DF(1) = C*DisSysCompDamperData(CompNum)%LamFlow*RHOZ(M)/VISCZ(M)
END IF
F(1) = DF(1)*PDROP
ELSE
! Turbulent flow.
IF(PDROP.GE.0.0d0) THEN
F(1) = C*DisSysCompDamperData(CompNum)%TurFlow*SQRTDZ(N)*PDROP**DisSysCompDamperData(CompNum)%FlowExpo
ELSE
F(1) = -C*DisSysCompDamperData(CompNum)%TurFlow*SQRTDZ(M)*(-PDROP)**DisSysCompDamperData(CompNum)%FlowExpo
ENDIF
DF(1) = F(1)*DisSysCompDamperData(CompNum)%FlowExpo/PDROP
END IF
901 FORMAT(A5,I3,6X,4E16.7)
RETURN
END SUBROUTINE AFEDMP