From 15df532693c0f9f669c9240163bb28bb35139ea8 Mon Sep 17 00:00:00 2001 From: mcgratta Date: Wed, 20 Mar 2024 13:58:11 -0400 Subject: [PATCH] FDS Source: Issue #12641. Fix bug in algorithm to detect merge pressure zones --- Source/main.f90 | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Source/main.f90 b/Source/main.f90 index d1c6cf39b96..c82d8f5e4e5 100644 --- a/Source/main.f90 +++ b/Source/main.f90 @@ -1793,6 +1793,7 @@ SUBROUTINE EXCHANGE_DIVERGENCE_INFO INTEGER :: IPZ,IOPZ,IOPZ2 REAL(EB) :: TNOW +LOGICAL :: NEW_CONNECTION TNOW = CURRENT_TIME() @@ -1836,16 +1837,23 @@ SUBROUTINE EXCHANGE_DIVERGENCE_INFO ! Connect zones to others which are not directly connected DO NM=1,NMESHES - DO IPZ=1,N_ZONE - DO IOPZ=1,N_ZONE - IF (IOPZ==IPZ) CYCLE - IF (CONNECTED_ZONES(IPZ,IOPZ,NM)) THEN - DO IOPZ2=0,N_ZONE - IF (IOPZ==IOPZ2) CYCLE - IF (CONNECTED_ZONES(IOPZ,IOPZ2,NM)) CONNECTED_ZONES(IPZ,IOPZ2,NM) = .TRUE. - IF (CONNECTED_ZONES(IOPZ,IOPZ2,NM)) CONNECTED_ZONES(IOPZ2,IPZ,NM) = .TRUE. - ENDDO - ENDIF + NEW_CONNECTION = .TRUE. + DO WHILE (NEW_CONNECTION) + NEW_CONNECTION = .FALSE. + DO IPZ=1,N_ZONE + DO IOPZ=1,N_ZONE + IF (IOPZ==IPZ) CYCLE + IF (CONNECTED_ZONES(IPZ,IOPZ,NM)) THEN + DO IOPZ2=0,N_ZONE + IF (IOPZ==IOPZ2) CYCLE + IF (CONNECTED_ZONES(IOPZ,IOPZ2,NM)) THEN + IF (.NOT.CONNECTED_ZONES(IPZ,IOPZ2,NM)) NEW_CONNECTION = .TRUE. + CONNECTED_ZONES(IPZ,IOPZ2,NM) = .TRUE. + CONNECTED_ZONES(IOPZ2,IPZ,NM) = .TRUE. + ENDIF + ENDDO + ENDIF + ENDDO ENDDO ENDDO ENDDO