SUBROUTINE UpdateAirflowNetwork(FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Lixing Gu
! DATE WRITTEN 12/10/05
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine update varaibles used in the AirflowNetwork model.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
Use DataHVACGlobals, ONLY: TimeStepSys
USE DataHVACGlobals, ONLY: TurnFansOn, TurnFansOff, VerySmallMassFlow
USE DataAirLoop, ONLY: LoopSystemOnMassFlowrate,LoopSystemOffMassFlowrate,LoopFanOperationMode, &
LoopOnOffFanPartLoadRatio,LoopHeatingCoilMaxRTF,LoopONOffFanRTF,LoopDXCoilRTF
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(IN), OPTIONAL :: FirstHVACIteration ! True when solution technique on first iteration
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Integer I, J, N, M, ZN1, ZN2, Node1, Node2, Node3
REAL(r64) CpAir, Qsen, Qlat, AirDensity, Tamb
REAL(r64) PartLoadRatio, OnOffRatio,NodeMass, AFNMass
LOGICAL WriteFlag
LOGICAL,SAVE :: MyOneTimeFlag = .TRUE.
LOGICAL,SAVE :: MyOneTimeFlag1 = .TRUE.
AirflowNetworkExchangeData%SumMCp = 0.0d0
AirflowNetworkExchangeData%SumMCpT = 0.0d0
AirflowNetworkExchangeData%SumMHr = 0.0d0
AirflowNetworkExchangeData%SumMHrW = 0.0d0
AirflowNetworkExchangeData%SumMMCp = 0.0d0
AirflowNetworkExchangeData%SumMMCpT = 0.0d0
AirflowNetworkExchangeData%SumMMHr = 0.0d0
AirflowNetworkExchangeData%SumMMHrW = 0.0d0
IF (Contaminant%CO2Simulation) Then
AirflowNetworkExchangeData%SumMHrCO = 0.0d0
AirflowNetworkExchangeData%SumMMHrCO = 0.0d0
End If
IF (Contaminant%GenericContamSimulation) Then
AirflowNetworkExchangeData%SumMHrGC = 0.0d0
AirflowNetworkExchangeData%SumMMHrGC = 0.0d0
End If
! Calculate sensible and latent loads in each zone from multizone airflows
If (SimulateAirflowNetwork == AirflowNetworkControlMultizone .OR. SimulateAirflowNetwork == AirflowNetworkControlMultiADS .OR. &
(SimulateAirflowNetwork == AirflowNetworkControlSimpleADS .AND. AirflowNetworkFanActivated)) then
Do i=1, NumOfLinksMultiZone ! Multizone airflow energy
N = AirflowNetworkLinkageData(i)%NodeNums(1)
M = AirflowNetworkLinkageData(i)%NodeNums(2)
ZN1 = AirflowNetworkNodeData(N)%EPlusZoneNum
ZN2 = AirflowNetworkNodeData(M)%EPlusZoneNum
If (ZN1 > 0 .AND. ZN2 == 0) then
! Find a linkage from outdoors to this zone
Tamb = Zone(ZN1)%OutDryBulbTemp
CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb)
AirflowNetworkExchangeData(ZN1)%SumMCp = AirflowNetworkExchangeData(ZN1)%SumMCp + &
AirflowNetworkLinkSimu(i)%FLOW2*CpAir
AirflowNetworkExchangeData(ZN1)%SumMCpT = AirflowNetworkExchangeData(ZN1)%SumMCpT + &
AirflowNetworkLinkSimu(i)%FLOW2*CpAir*Tamb
AirflowNetworkExchangeData(ZN1)%SumMHr = AirflowNetworkExchangeData(ZN1)%SumMHr + &
AirflowNetworkLinkSimu(i)%FLOW2
AirflowNetworkExchangeData(ZN1)%SumMHrW = AirflowNetworkExchangeData(ZN1)%SumMHrW + &
AirflowNetworkLinkSimu(i)%FLOW2*OutHumRat
IF (Contaminant%CO2Simulation) Then
AirflowNetworkExchangeData(ZN1)%SumMHrCO = AirflowNetworkExchangeData(ZN1)%SumMHrCO + &
AirflowNetworkLinkSimu(i)%FLOW2*OutdoorCO2
End If
IF (Contaminant%GenericContamSimulation) Then
AirflowNetworkExchangeData(ZN1)%SumMHrGC = AirflowNetworkExchangeData(ZN1)%SumMHrGC + &
AirflowNetworkLinkSimu(i)%FLOW2*OutdoorGC
End If
end if
If (ZN1 == 0 .AND. ZN2 > 0) then
! Find a linkage from outdoors to this zone
Tamb = Zone(ZN2)%OutDryBulbTemp
CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb)
AirflowNetworkExchangeData(ZN2)%SumMCp = AirflowNetworkExchangeData(ZN2)%SumMCp + &
AirflowNetworkLinkSimu(i)%FLOW*CpAir
AirflowNetworkExchangeData(ZN2)%SumMCpT = AirflowNetworkExchangeData(ZN2)%SumMCpT + &
AirflowNetworkLinkSimu(i)%FLOW*CpAir*Tamb
AirflowNetworkExchangeData(ZN2)%SumMHr = AirflowNetworkExchangeData(ZN2)%SumMHr + &
AirflowNetworkLinkSimu(i)%FLOW
AirflowNetworkExchangeData(ZN2)%SumMHrW = AirflowNetworkExchangeData(ZN2)%SumMHrW + &
AirflowNetworkLinkSimu(i)%FLOW*OutHumRat
IF (Contaminant%CO2Simulation) Then
AirflowNetworkExchangeData(ZN2)%SumMHrCO = AirflowNetworkExchangeData(ZN2)%SumMHrCO + &
AirflowNetworkLinkSimu(i)%FLOW*OutdoorCO2
End If
IF (Contaminant%GenericContamSimulation) Then
AirflowNetworkExchangeData(ZN2)%SumMHrGC = AirflowNetworkExchangeData(ZN2)%SumMHrGC + &
AirflowNetworkLinkSimu(i)%FLOW*OutdoorGC
End If
end if
If (ZN1 > 0 .AND. ZN2 > 0) then
! Find a linkage from outdoors to this zone
CpAir = PsyCpAirFnWTdb(ANZW(ZN1), ANZT(ZN1))
AirflowNetworkExchangeData(ZN2)%SumMMCp = AirflowNetworkExchangeData(ZN2)%SumMMCp + &
AirflowNetworkLinkSimu(i)%FLOW*CpAir
AirflowNetworkExchangeData(ZN2)%SumMMCpT = AirflowNetworkExchangeData(ZN2)%SumMMCpT + &
AirflowNetworkLinkSimu(i)%FLOW*CpAir*ANZT(ZN1)
AirflowNetworkExchangeData(ZN2)%SumMMHr = AirflowNetworkExchangeData(ZN2)%SumMMHr + &
AirflowNetworkLinkSimu(i)%FLOW
AirflowNetworkExchangeData(ZN2)%SumMMHrW = AirflowNetworkExchangeData(ZN2)%SumMMHrW + &
AirflowNetworkLinkSimu(i)%FLOW*ANZW(ZN1)
IF (Contaminant%CO2Simulation) Then
AirflowNetworkExchangeData(ZN2)%SumMMHrCO = AirflowNetworkExchangeData(ZN2)%SumMMHrCO + &
AirflowNetworkLinkSimu(i)%FLOW*ANCO(ZN1)
End If
IF (Contaminant%GenericContamSimulation) Then
AirflowNetworkExchangeData(ZN2)%SumMMHrGC = AirflowNetworkExchangeData(ZN2)%SumMMHrGC + &
AirflowNetworkLinkSimu(i)%FLOW*ANGC(ZN1)
End If
CpAir = PsyCpAirFnWTdb(ANZW(ZN2), ANZT(ZN2))
AirflowNetworkExchangeData(ZN1)%SumMMCp = AirflowNetworkExchangeData(ZN1)%SumMMCp + &
AirflowNetworkLinkSimu(i)%FLOW2*CpAir
AirflowNetworkExchangeData(ZN1)%SumMMCpT = AirflowNetworkExchangeData(ZN1)%SumMMCpT + &
AirflowNetworkLinkSimu(i)%FLOW2*CpAir*ANZT(ZN2)
AirflowNetworkExchangeData(ZN1)%SumMMHr = AirflowNetworkExchangeData(ZN1)%SumMMHr + &
AirflowNetworkLinkSimu(i)%FLOW2
AirflowNetworkExchangeData(ZN1)%SumMMHrW = AirflowNetworkExchangeData(ZN1)%SumMMHrW + &
AirflowNetworkLinkSimu(i)%FLOW2*ANZW(ZN2)
IF (Contaminant%CO2Simulation) Then
AirflowNetworkExchangeData(ZN1)%SumMMHrCO = AirflowNetworkExchangeData(ZN1)%SumMMHrCO + &
AirflowNetworkLinkSimu(i)%FLOW2*ANCO(ZN2)
End If
IF (Contaminant%GenericContamSimulation) Then
AirflowNetworkExchangeData(ZN1)%SumMMHrGC = AirflowNetworkExchangeData(ZN1)%SumMMHrGC + &
AirflowNetworkLinkSimu(i)%FLOW2*ANGC(ZN2)
End If
end if
End Do
End If
! End of update of multizone airflow calculations
! Initialize these values
AirflowNetworkExchangeData%LeakSen = 0.0d0
AirflowNetworkExchangeData%CondSen = 0.0d0
AirflowNetworkExchangeData%LeakLat = 0.0d0
AirflowNetworkExchangeData%DiffLat = 0.0d0
AirflowNetworkExchangeData%MultiZoneSen = 0.0d0
AirflowNetworkExchangeData%MultiZoneLat = 0.0d0
! Rewrite AirflowNetwork airflow rate
do i=1,NumOfLinksMultiZone
Tamb = OutDryBulbTempAt(AirflowNetworkLinkageData(i)%NodeHeights(1))
AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress,Tamb,OutHumRat)
AirflowNetworkLinkSimu(i)%VolFlow = AirflowNetworkLinkSimu(i)%Flow/AirDensity
AirflowNetworkLinkSimu(i)%VolFlow2 = AirflowNetworkLinkSimu(i)%Flow2/AirDensity
end do
AirflowNetworkLinkReport%FLOW = AirflowNetworkLinkSimu%FLOW
AirflowNetworkLinkReport%FLOW2 = AirflowNetworkLinkSimu%FLOW2
AirflowNetworkLinkReport%VolFlow = AirflowNetworkLinkSimu%VolFlow
AirflowNetworkLinkReport%VolFlow2 = AirflowNetworkLinkSimu%VolFlow2
! Save zone loads from multizone calculation for later summation
If (PRESENT(FirstHVACIteration)) then
If (FirstHVACIteration .AND. SupplyFanType .EQ. FanType_SimpleOnOff) then
AirflowNetworkMultiExchangeData = AirflowNetworkExchangeData
Do I=1,AirflowNetworkNumOfZones
AirflowNetworkNodeReport(i)%PZ = AirflowNetworkNodeSimu(i)%PZ
AirflowNetworkNodeReport(i)%PZOFF = AirflowNetworkNodeSimu(i)%PZ
AirflowNetworkNodeReport(i)%PZON = 0.0d0
End Do
Do I=1,AirflowNetworkNumOfSurfaces
AirflowNetworkLinkReport1(I)%FLOW = AirflowNetworkLinkSimu(I)%FLOW
AirflowNetworkLinkReport1(I)%FLOW2 = AirflowNetworkLinkSimu(I)%FLOW2
AirflowNetworkLinkReport1(I)%VolFLOW = AirflowNetworkLinkSimu(I)%VolFLOW
AirflowNetworkLinkReport1(I)%VolFLOW2 = AirflowNetworkLinkSimu(I)%VolFLOW2
AirflowNetworkLinkReport1(I)%FLOWOFF = AirflowNetworkLinkSimu(I)%FLOW
AirflowNetworkLinkReport1(I)%FLOW2OFF = AirflowNetworkLinkSimu(I)%FLOW2
AirflowNetworkLinkReport1(I)%VolFLOWOFF = AirflowNetworkLinkSimu(I)%VolFLOW
AirflowNetworkLinkReport1(I)%VolFLOW2OFF = AirflowNetworkLinkSimu(I)%VolFLOW2
AirflowNetworkLinkReport1(I)%DP = AirflowNetworkLinkSimu(I)%DP
AirflowNetworkLinkReport1(I)%DPOFF = AirflowNetworkLinkSimu(I)%DP
AirflowNetworkLinkReport1(I)%DPON = 0.0d0
End Do
End If
End If
if (.NOT. (AirflowNetworkFanActivated .and. SimulateAirflowNetwork > AirflowNetworkControlMultizone)) RETURN
If (SimulateAirflowNetwork > AirflowNetworkControlMultizone+1) then
Do i=1, AirflowNetworkNumOfSurfaces ! Multizone airflow energy
N = AirflowNetworkLinkageData(i)%NodeNums(1)
M = AirflowNetworkLinkageData(i)%NodeNums(2)
ZN1 = AirflowNetworkNodeData(N)%EPlusZoneNum
ZN2 = AirflowNetworkNodeData(M)%EPlusZoneNum
! Find a linkage from a zone to outdoors
If (ZN1 > 0 .and. ZN2 == 0) then
Tamb = Zone(ZN1)%OutDryBulbTemp
CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb)
AirflowNetworkExchangeData(ZN1)%MultiZoneSen = AirflowNetworkExchangeData(ZN1)%MultiZoneSen + &
AirflowNetworkLinkSimu(i)%FLOW2*CpAir*(Tamb-ANZT(ZN1))
AirflowNetworkExchangeData(ZN1)%MultiZoneLat = AirflowNetworkExchangeData(ZN1)%MultiZoneLat + &
AirflowNetworkLinkSimu(i)%FLOW2*(OutHumRat-ANZW(ZN1))
end if
If (ZN1 == 0 .and. ZN2 > 0) then
Tamb = Zone(ZN2)%OutDryBulbTemp
CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb)
AirflowNetworkExchangeData(ZN2)%MultiZoneSen = AirflowNetworkExchangeData(ZN2)%MultiZoneSen + &
AirflowNetworkLinkSimu(i)%FLOW*CpAir*(Tamb-ANZT(ZN2))
AirflowNetworkExchangeData(ZN2)%MultiZoneLat = AirflowNetworkExchangeData(ZN2)%MultiZoneLat + &
AirflowNetworkLinkSimu(i)%FLOW*(OutHumRat-ANZW(ZN2))
end if
If (ZN1 > 0 .and. ZN2 > 0) then
If (AirflowNetworkLinkSimu(i)%FLOW .GT. 0) then ! Flow from ZN1 to ZN2
CpAir = PsyCpAirFnWTdb(ANZW(ZN1), ANZT(ZN1))
AirflowNetworkExchangeData(ZN2)%MultiZoneSen = AirflowNetworkExchangeData(ZN2)%MultiZoneSen + &
AirflowNetworkLinkSimu(i)%FLOW*CpAir*(ANZT(ZN1)-ANZT(ZN2))
AirflowNetworkExchangeData(ZN2)%MultiZoneLat = AirflowNetworkExchangeData(ZN2)%MultiZoneLat + &
AirflowNetworkLinkSimu(i)%FLOW*(ANZW(ZN1)-ANZW(ZN2))
CpAir = PsyCpAirFnWTdb(ANZW(ZN2), ANZT(ZN2))
AirflowNetworkExchangeData(ZN1)%MultiZoneSen = AirflowNetworkExchangeData(ZN1)%MultiZoneSen + &
ABS(AirflowNetworkLinkSimu(i)%FLOW2)*CpAir*(ANZT(ZN2)-ANZT(ZN1))
AirflowNetworkExchangeData(ZN1)%MultiZoneLat = AirflowNetworkExchangeData(ZN1)%MultiZoneLat + &
ABS(AirflowNetworkLinkSimu(i)%FLOW2)*(ANZW(ZN2)-ANZW(ZN1))
Else
! CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN2), MAT(ZN2))
! AirflowNetworkExchangeData(ZN1)%MultiZoneSen = AirflowNetworkExchangeData(ZN1)%MultiZoneSen + &
! AirflowNetworkLinkSimu(i)%FLOW*CpAir*(MAT(ZN1)-MAT(ZN2))
! AirflowNetworkExchangeData(ZN1)%MultiZoneLat = AirflowNetworkExchangeData(ZN1)%MultiZoneLat + &
! AirflowNetworkLinkSimu(i)%FLOW*(ZoneAirHumRat(ZN1)-ZoneAirHumRat(ZN2))
! CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN1), MAT(ZN1))
! AirflowNetworkExchangeData(ZN2)%MultiZoneSen = AirflowNetworkExchangeData(ZN2)%MultiZoneSen + &
! ABS(AirflowNetworkLinkSimu(i)%FLOW2)*CpAir*(MAT(ZN1)-MAT(ZN2))
! AirflowNetworkExchangeData(ZN2)%MultiZoneLat = AirflowNetworkExchangeData(ZN2)%MultiZoneLat + &
! ABS(AirflowNetworkLinkSimu(i)%FLOW2)*(ZoneAirHumRat(ZN1)-ZoneAirHumRat(ZN2))
CpAir = PsyCpAirFnWTdb(ANZW(ZN2), ANZT(ZN2))
AirflowNetworkExchangeData(ZN1)%MultiZoneSen = AirflowNetworkExchangeData(ZN1)%MultiZoneSen + &
ABS(AirflowNetworkLinkSimu(i)%FLOW2)*CpAir*(ANZT(ZN2)-ANZT(ZN1))
AirflowNetworkExchangeData(ZN1)%MultiZoneLat = AirflowNetworkExchangeData(ZN1)%MultiZoneLat + &
ABS(AirflowNetworkLinkSimu(i)%FLOW2)*(ANZW(ZN2)-ANZW(ZN1))
End If
end if
End Do
End If
PartLoadRatio = 1.0d0
OnOffFanRunTimeFraction = 1.0d0
! Calculate the part load ratio, can't be greater than 1 for a simple ONOFF fan
If (SupplyFanType .EQ. FanType_SimpleOnOff .AND. Node(SupplyFanInletNode)%MassFlowRate > VerySmallMassFlow .AND. &
LoopFanOperationMode .EQ. CycFanCycCoil) then
PartLoadRatio= LoopOnOffFanPartLoadRatio
OnOffFanRunTimeFraction = Max(LoopHeatingCoilMaxRTF,LoopONOffFanRTF,LoopDXCoilRTF)
End If
LoopHeatingCoilMaxRTF = 0.0d0
If (SupplyFanType .EQ. FanType_SimpleOnOff .AND. PartLoadRatio < 1.0d0) then
AirflowNetworkLinkReport%FLOW = AirflowNetworkLinkSimu%FLOW*PartLoadRatio
AirflowNetworkLinkReport%FLOW2 = AirflowNetworkLinkSimu%FLOW2*PartLoadRatio
AirflowNetworkLinkReport%VolFlow = AirflowNetworkLinkSimu%VolFlow*PartLoadRatio
AirflowNetworkLinkReport%VolFlow2 = AirflowNetworkLinkSimu%VolFlow2*PartLoadRatio
End If
! One time warning
If (MyOneTimeFlag) then
If (SupplyFanType .EQ. FanType_SimpleOnOff .AND. LoopFanOperationMode .EQ. ContFanCycCoil) then
OnOffRatio = ABS((LoopSystemOnMassFlowrate-LoopSystemOffMassFlowrate)/LoopSystemOnMassFlowrate)
If (OnOffRatio > 0.1d0) then
CALL ShowWarningError('The absolute percent difference of supply air mass flow rate between HVAC operation ' &
//'and No HVAC operation is above 10% with fan operation mode = ContFanCycCoil.')
CALL ShowContinueError('The added zone loads using the AirflowNetwork model may not be accurate,' &
//'because the zone loads are calculated based on the mass flow rate during HVAC operation.')
CALL ShowContinueError('The mass flow rate during HVAC operation = '//TRIM(RoundSigDigits(LoopSystemOnMassFlowrate,2)) &
//' The mass flow rate during no HVAC operation = '//TRIM(RoundSigDigits(LoopSystemOffMassFlowrate,2)))
MyOneTimeFlag = .FALSE.
End If
End If
End If
! Check mass flow differences in the zone inlet zones and splitter nodes between node and AFN links
If (MyOneTimeFlag1) then
If ((.NOT. VAVSystem) .AND. DisplayExtraWarnings) Then
WriteFlag = .FALSE.
Do I=1,AirflowNetworkNumOfLinks
Node1 = AirflowNetworkLinkageData(i)%NodeNums(1)
Node2 = AirflowNetworkLinkageData(i)%NodeNums(2)
If (AirflowNetworkNodeData(Node1)%EPlusTypeNum == EPlusTypeNum_SPI .OR. &
AirflowNetworkNodeData(Node2)%EPlusTypeNum == EPlusTypeNum_SPO .OR. &
AirflowNetworkNodeData(Node2)%EPlusTypeNum == EPlusTypeNum_ZIN) then
If (AirflowNetworkNodeData(Node1)%EPlusTypeNum == EPlusTypeNum_SPI) Then
Node3 = Node1
Else
Node3 = Node2
End If
IF (AirflowNetworkNodeData(Node2)%EPlusTypeNum == EPlusTypeNum_ZIN) Then
If (AirflowNetworkCompData(AirflowNetworkLinkageData(i)%CompNum)%EPlusTypeNum == 0) Cycle
End If
NodeMass = Node(AirflowNetworkNodeData(Node3)%EPlusNodeNum)%MassFlowRate
AFNMass = AirflowNetworkLinkSimu(I)%FLOW
If (NodeMass .GT. 0.0 .AND. AFNMass .GT. NodeMass + 0.01d0) Then
CALL ShowWarningError('The mass flow rate difference is found between System Node = ' // &
Trim(NodeID(AirflowNetworkNodeData(Node3)%EPlusNodeNum)) &
//' and AFN Link = ' // Trim(AirflowNetworkLinkageData(I)%Name)//'.')
CALL ShowContinueError('The system node max mass flow rate = '//TRIM(RoundSigDigits(NodeMass,3)) &
//' kg/s. The AFN node mass flow rate = '//TRIM(RoundSigDigits(AFNMass,3)) // ' kg.s.')
WriteFlag = .TRUE.
End If
End If
End Do
MyOneTimeFlag1 = .FALSE.
If (WriteFlag) Then
CALL ShowWarningError('Please adjust the rate of Maximum Air Flow Rate field in the terminal objects or ' // &
'duct pressure resistance.')
End If
Else
MyOneTimeFlag1 = .FALSE.
End If
End If
! Assign airflows to EPLus nodes
DO I=1,AirflowNetworkNumOfLinks
if (AirflowNetworkCompData(AirflowNetworkLinkageData(i)%CompNum)%CompTypeNum .EQ. CompTypeNum_DWC .OR. &
AirflowNetworkLinkageData(i)%VAVTermDamper) then
! Exclude envelope leakage Crack element
Node1 = AirflowNetworkLinkageData(i)%NodeNums(1)
Node2 = AirflowNetworkLinkageData(i)%NodeNums(2)
j=AirflowNetworkNodeData(Node1)%EPlusNodeNum
if (j > 0 .AND. AirflowNetworkNodeData(Node1)%EPlusZoneNum .EQ. 0) then
Node(j)%MassFlowRate = AirflowNetworkLinkSimu(I)%FLOW*PartLoadRatio
If (.NOT. (AirflowNetworkNodeData(Node1)%EPlusTypeNum == EPlusTypeNum_DIN .OR. &
AirflowNetworkNodeData(Node1)%EPlusTypeNum == EPlusTypeNum_DOU)) Then
Node(j)%MassFlowRateMaxAvail = AirflowNetworkLinkSimu(I)%FLOW*PartLoadRatio
Node(j)%MassFlowRateMax = AirflowNetworkLinkSimu(I)%FLOW
End If
end if
j=AirflowNetworkNodeData(Node2)%EPlusNodeNum
if (j > 0) then
Node(j)%MassFlowRate = AirflowNetworkLinkSimu(I)%FLOW*PartLoadRatio
If (.NOT. (AirflowNetworkNodeData(Node2)%EPlusTypeNum == EPlusTypeNum_DIN .OR. &
AirflowNetworkNodeData(Node2)%EPlusTypeNum == EPlusTypeNum_DOU)) Then
Node(j)%MassFlowRateMaxAvail = AirflowNetworkLinkSimu(I)%FLOW*PartLoadRatio
Node(j)%MassFlowRateMax = AirflowNetworkLinkSimu(I)%FLOW
End If
end if
end if
END DO
! Assign AirflowNetwork nodal values to Node array
DO I=1,AirflowNetworkNumOfNodes
j=AirflowNetworkNodeData(I)%EPlusNodeNum
if (j > 0) then
Node(j)%Enthalpy = PsyHFnTdbW(AirflowNetworkNodeSimu(I)%TZ, AirflowNetworkNodeSimu(I)%WZ)
Node(j)%Temp = AirflowNetworkNodeSimu(I)%TZ
Node(j)%HumRat = AirflowNetworkNodeSimu(I)%WZ
IF (Contaminant%CO2Simulation) THEN
Node(j)%CO2 = AirflowNetworkNodeSimu(I)%CO2Z
END IF
IF (Contaminant%GenericContamSimulation) THEN
Node(j)%GenContam = AirflowNetworkNodeSimu(I)%GCZ
END IF
end if
END DO
! Calculate sensible loads from forced air flow
DO I=1,AirflowNetworkNumOfLinks
Node1 = AirflowNetworkLinkageData(i)%NodeNums(1)
Node2 = AirflowNetworkLinkageData(i)%NodeNums(2)
CpAir = PsyCpAirFnWTdb((AirflowNetworkNodeSimu(Node1)%WZ+AirflowNetworkNodeSimu(Node2)%WZ)/2.0d0, &
(AirflowNetworkNodeSimu(Node1)%TZ+AirflowNetworkNodeSimu(Node2)%TZ)/2.0d0)
! Calculate sensible loads from duct conduction losses
if (AirflowNetworkLinkageData(i)%ZoneNum > 0 .AND. &
AirflowNetworkCompData(AirflowNetworkLinkageData(i)%CompNum)%CompTypeNum == CompTypeNum_DWC) then
Qsen = AirflowNetworkLinkSimu(I)%FLOW*CpAir*(AirflowNetworkNodeSimu(Node2)%TZ-AirflowNetworkNodeSimu(Node1)%TZ)
AirflowNetworkExchangeData(AirflowNetworkLinkageData(i)%ZoneNum)%CondSen = &
AirflowNetworkExchangeData(AirflowNetworkLinkageData(i)%ZoneNum)%CondSen-Qsen
end if
! Calculate sensible leakage losses
if (AirflowNetworkCompData(AirflowNetworkLinkageData(i)%CompNum)%CompTypeNum == CompTypeNum_PLR .OR. &
AirflowNetworkCompData(AirflowNetworkLinkageData(i)%CompNum)%CompTypeNum == CompTypeNum_ELR) then
! Calculate supply leak sensible losses
if ((AirflowNetworkNodeData(Node2)%EPlusZoneNum > 0) .AND. &
(AirflowNetworkNodeData(Node1)%EPlusNodeNum == 0) .AND. &
(AirflowNetworkLinkSimu(I)%FLOW .GT. 0.0d0)) then
ZN2=AirflowNetworkNodeData(Node2)%EPlusZoneNum
Qsen = AirflowNetworkLinkSimu(I)%FLOW*CpAir*(AirflowNetworkNodeSimu(Node1)%TZ-AirflowNetworkNodeSimu(Node2)%TZ)
AirflowNetworkExchangeData(ZN2)%LeakSen = AirflowNetworkExchangeData(ZN2)%LeakSen+Qsen
end if
if ((AirflowNetworkNodeData(Node1)%EPlusZoneNum > 0) .AND. &
(AirflowNetworkNodeData(Node2)%EPlusNodeNum == 0) .AND. &
(AirflowNetworkLinkSimu(I)%FLOW2 .GT. 0.0d0)) then
ZN1=AirflowNetworkNodeData(Node1)%EPlusZoneNum
Qsen = AirflowNetworkLinkSimu(I)%FLOW2*CpAir*(AirflowNetworkNodeSimu(Node2)%TZ-AirflowNetworkNodeSimu(Node1)%TZ)
AirflowNetworkExchangeData(ZN1)%LeakSen = AirflowNetworkExchangeData(ZN1)%LeakSen+Qsen
end if
end if
END DO
! Calculate latent loads from forced air flow
DO I=1,AirflowNetworkNumOfLinks
Node1 = AirflowNetworkLinkageData(i)%NodeNums(1)
Node2 = AirflowNetworkLinkageData(i)%NodeNums(2)
! Calculate latent loads from duct conduction losses
if (AirflowNetworkLinkageData(i)%ZoneNum > 0 .AND. &
AirflowNetworkCompData(AirflowNetworkLinkageData(i)%CompNum)%CompTypeNum == CompTypeNum_DWC) then
Qlat = AirflowNetworkLinkSimu(I)%FLOW*(AirflowNetworkNodeSimu(Node2)%WZ-AirflowNetworkNodeSimu(Node1)%WZ)
AirflowNetworkExchangeData(AirflowNetworkLinkageData(i)%ZoneNum)%DiffLat = &
AirflowNetworkExchangeData(AirflowNetworkLinkageData(i)%ZoneNum)%DiffLat-Qlat
end if
! Calculate latent leakage losses
if (AirflowNetworkCompData(AirflowNetworkLinkageData(i)%CompNum)%CompTypeNum == CompTypeNum_PLR .OR. &
AirflowNetworkCompData(AirflowNetworkLinkageData(i)%CompNum)%CompTypeNum == CompTypeNum_ELR) then
! Calculate supply leak latent losses
if ((AirflowNetworkNodeData(Node2)%EPlusZoneNum > 0) .AND. &
(AirflowNetworkNodeData(Node1)%EPlusNodeNum == 0) .AND. &
(AirflowNetworkLinkSimu(I)%FLOW .GT. 0.0d0)) then
ZN2=AirflowNetworkNodeData(Node2)%EPlusZoneNum
Qlat = AirflowNetworkLinkSimu(I)%FLOW*(AirflowNetworkNodeSimu(Node1)%WZ-AirflowNetworkNodeSimu(Node2)%WZ)
AirflowNetworkExchangeData(ZN2)%LeakLat = AirflowNetworkExchangeData(ZN2)%LeakLat+Qlat
IF (Contaminant%CO2Simulation) Then
AirflowNetworkExchangeData(ZN2)%TotalCO2 = AirflowNetworkExchangeData(ZN2)%TotalCO2+ &
AirflowNetworkLinkSimu(I)%FLOW*(AirflowNetworkNodeSimu(Node1)%CO2Z-AirflowNetworkNodeSimu(Node2)%CO2Z)
End If
IF (Contaminant%GenericContamSimulation) Then
AirflowNetworkExchangeData(ZN2)%TotalGC = AirflowNetworkExchangeData(ZN2)%TotalGC+ &
AirflowNetworkLinkSimu(I)%FLOW*(AirflowNetworkNodeSimu(Node1)%GCZ-AirflowNetworkNodeSimu(Node2)%GCZ)
End If
end if
if ((AirflowNetworkNodeData(Node1)%EPlusZoneNum > 0) .AND. &
(AirflowNetworkNodeData(Node2)%EPlusNodeNum == 0) .AND. &
(AirflowNetworkLinkSimu(I)%FLOW2 .GT. 0.0d0)) then
ZN1=AirflowNetworkNodeData(Node1)%EPlusZoneNum
Qlat = AirflowNetworkLinkSimu(I)%FLOW2*(AirflowNetworkNodeSimu(Node2)%WZ-AirflowNetworkNodeSimu(Node1)%WZ)
AirflowNetworkExchangeData(ZN1)%LeakLat = AirflowNetworkExchangeData(ZN1)%LeakLat+Qlat
IF (Contaminant%CO2Simulation) Then
AirflowNetworkExchangeData(ZN1)%TotalCO2 = AirflowNetworkExchangeData(ZN1)%TotalCO2+ &
AirflowNetworkLinkSimu(I)%FLOW2*(AirflowNetworkNodeSimu(Node2)%CO2Z-AirflowNetworkNodeSimu(Node1)%CO2Z)
End If
IF (Contaminant%GenericContamSimulation) Then
AirflowNetworkExchangeData(ZN1)%TotalGC = AirflowNetworkExchangeData(ZN1)%TotalGC+ &
AirflowNetworkLinkSimu(I)%FLOW2*(AirflowNetworkNodeSimu(Node2)%GCZ-AirflowNetworkNodeSimu(Node1)%GCZ)
End If
end if
end if
END DO
! Sum all the loads
DO I=1, NumOfZones
AirflowNetworkExchangeData(i)%TotalSen = &
AirflowNetworkExchangeData(i)%LeakSen+AirflowNetworkExchangeData(i)%CondSen
AirflowNetworkExchangeData(i)%TotalLat = &
AirflowNetworkExchangeData(i)%LeakLat+AirflowNetworkExchangeData(i)%DiffLat
END DO
! Simple ONOFF fan
If (SupplyFanType .EQ. FanType_SimpleOnOff .AND. OnOffFanRunTimeFraction < 1.0d0) then
DO I=1, NumOfZones
AirflowNetworkExchangeData(i)%MultiZoneSen = AirflowNetworkExchangeData(i)%MultiZoneSen*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%MultiZoneLat = AirflowNetworkExchangeData(i)%MultiZoneLat*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%LeakSen = AirflowNetworkExchangeData(i)%LeakSen*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%LeakLat = AirflowNetworkExchangeData(i)%LeakLat*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%CondSen = AirflowNetworkExchangeData(i)%CondSen*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%DiffLat = AirflowNetworkExchangeData(i)%DiffLat*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%TotalSen = AirflowNetworkExchangeData(i)%TotalSen*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%TotalLat = AirflowNetworkExchangeData(i)%TotalLat*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%SumMCp = AirflowNetworkExchangeData(i)%SumMCp*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%SumMCpT = AirflowNetworkExchangeData(i)%SumMCpT*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%SumMHr = AirflowNetworkExchangeData(i)%SumMHr*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%SumMHrW = AirflowNetworkExchangeData(i)%SumMHrW*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%SumMMCp = AirflowNetworkExchangeData(i)%SumMMCp*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%SumMMCpT = AirflowNetworkExchangeData(i)%SumMMCpT*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%SumMMHr = AirflowNetworkExchangeData(i)%SumMMHr*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%SumMMHrW = AirflowNetworkExchangeData(i)%SumMMHrW*OnOffFanRuntimeFraction
IF (Contaminant%CO2Simulation) Then
AirflowNetworkExchangeData(i)%SumMHrCO = AirflowNetworkExchangeData(i)%SumMHrCO*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%SumMMHrCO = AirflowNetworkExchangeData(i)%SumMMHrCO*OnOffFanRuntimeFraction
End If
IF (Contaminant%GenericContamSimulation) Then
AirflowNetworkExchangeData(i)%SumMHrGC = AirflowNetworkExchangeData(i)%SumMHrGC*OnOffFanRuntimeFraction
AirflowNetworkExchangeData(i)%SumMMHrGC = AirflowNetworkExchangeData(i)%SumMMHrGC*OnOffFanRuntimeFraction
End If
END DO
If (LoopFanOperationMode .EQ. CycFanCycCoil) Then
DO I=1, NumOfZones
AirflowNetworkExchangeData(i)%SumMCp = AirflowNetworkExchangeData(i)%SumMCp + &
AirflowNetworkMultiExchangeData(i)%SumMCp*(1.0-OnOffFanRuntimeFraction)
AirflowNetworkExchangeData(i)%SumMCpT = AirflowNetworkExchangeData(i)%SumMCpT + &
AirflowNetworkMultiExchangeData(i)%SumMCpT*(1.0-OnOffFanRuntimeFraction)
AirflowNetworkExchangeData(i)%SumMHr = AirflowNetworkExchangeData(i)%SumMHr + &
AirflowNetworkMultiExchangeData(i)%SumMHr*(1.0-OnOffFanRuntimeFraction)
AirflowNetworkExchangeData(i)%SumMHrW = AirflowNetworkExchangeData(i)%SumMHrW + &
AirflowNetworkMultiExchangeData(i)%SumMHrW*(1.0-OnOffFanRuntimeFraction)
AirflowNetworkExchangeData(i)%SumMMCp = AirflowNetworkExchangeData(i)%SumMMCp + &
AirflowNetworkMultiExchangeData(i)%SumMMCp*(1.0-OnOffFanRuntimeFraction)
AirflowNetworkExchangeData(i)%SumMMCpT = AirflowNetworkExchangeData(i)%SumMMCpT + &
AirflowNetworkMultiExchangeData(i)%SumMMCpT*(1.0-OnOffFanRuntimeFraction)
AirflowNetworkExchangeData(i)%SumMMHr = AirflowNetworkExchangeData(i)%SumMMHr + &
AirflowNetworkMultiExchangeData(i)%SumMMHr*(1.0-OnOffFanRuntimeFraction)
AirflowNetworkExchangeData(i)%SumMMHrW = AirflowNetworkExchangeData(i)%SumMMHrW + &
AirflowNetworkMultiExchangeData(i)%SumMMHrW*(1.0-OnOffFanRuntimeFraction)
IF (Contaminant%CO2Simulation) Then
AirflowNetworkExchangeData(i)%SumMHrCO = AirflowNetworkExchangeData(i)%SumMHrCO + &
AirflowNetworkMultiExchangeData(i)%SumMHrCO*(1.0-OnOffFanRuntimeFraction)
AirflowNetworkExchangeData(i)%SumMMHrCO = AirflowNetworkExchangeData(i)%SumMMHrCO + &
AirflowNetworkMultiExchangeData(i)%SumMMHrCO*(1.0-OnOffFanRuntimeFraction)
End If
IF (Contaminant%GenericContamSimulation) Then
AirflowNetworkExchangeData(i)%SumMHrGC = AirflowNetworkExchangeData(i)%SumMHrGC + &
AirflowNetworkMultiExchangeData(i)%SumMHrGC*(1.0-OnOffFanRuntimeFraction)
AirflowNetworkExchangeData(i)%SumMMHrGC = AirflowNetworkExchangeData(i)%SumMMHrGC + &
AirflowNetworkMultiExchangeData(i)%SumMMHrGC*(1.0-OnOffFanRuntimeFraction)
End If
END DO
End If
End If
If (SupplyFanType .EQ. FanType_SimpleOnOff) then
Do I=1,AirflowNetworkNumOfZones
AirflowNetworkNodeReport(i)%PZ = AirflowNetworkNodeSimu(i)%PZ*PartLoadRatio + &
AirflowNetworkNodeReport(i)%PZOFF*(1.0-PartLoadRatio)
AirflowNetworkNodeReport(i)%PZON = AirflowNetworkNodeSimu(i)%PZ
End Do
Do I=1,AirflowNetworkNumOfSurfaces
AirflowNetworkLinkReport1(I)%FLOW = AirflowNetworkLinkSimu(I)%FLOW*PartLoadRatio + &
AirflowNetworkLinkReport1(I)%FLOWOFF*(1.0-PartLoadRatio)
AirflowNetworkLinkReport1(I)%FLOW2 = AirflowNetworkLinkSimu(I)%FLOW2*PartLoadRatio + &
AirflowNetworkLinkReport1(I)%FLOW2OFF*(1.0-PartLoadRatio)
AirflowNetworkLinkReport1(I)%VolFLOW = AirflowNetworkLinkSimu(I)%VolFLOW*PartLoadRatio + &
AirflowNetworkLinkReport1(I)%VolFLOWOFF*(1.0-PartLoadRatio)
AirflowNetworkLinkReport1(I)%VolFLOW2 = AirflowNetworkLinkSimu(I)%VolFLOW2*PartLoadRatio + &
AirflowNetworkLinkReport1(I)%VolFLOW2OFF*(1.0-PartLoadRatio)
AirflowNetworkLinkReport1(I)%DP = AirflowNetworkLinkSimu(I)%DP*PartLoadRatio + &
AirflowNetworkLinkReport1(I)%DPOFF*(1.0-PartLoadRatio)
AirflowNetworkLinkReport1(I)%DPON = AirflowNetworkLinkSimu(I)%DP
End Do
End If
RETURN
END SUBROUTINE UpdateAirflowNetwork