diff --git a/Source/dump.f90 b/Source/dump.f90 index 1fe6941244..eb4090691e 100644 --- a/Source/dump.f90 +++ b/Source/dump.f90 @@ -8206,7 +8206,7 @@ REAL(EB) RECURSIVE FUNCTION GAS_PHASE_OUTPUT(T,DT,NM,II,JJ,KK,IND,IND2,Y_INDEX,Z CASE(253) ! ZONE PRESSURE SOLVER TYPE GAS_PHASE_OUTPUT_RES = REAL(PRES_FLAG,EB) - IF (PRES_FLAG==ULMAT_FLAG) THEN + IF (PRES_FLAG==ULMAT_FLAG .AND. ALLOCATED(MESHES(NM)%ZONE_MESH)) THEN IF (ZONE_MESH(ZONE_MESH(PRESSURE_ZONE(II,JJ,KK))%CONNECTED_ZONE_PARENT)%USE_FFT) THEN GAS_PHASE_OUTPUT_RES = REAL(FFT_FLAG,EB) ELSE @@ -8217,7 +8217,7 @@ REAL(EB) RECURSIVE FUNCTION GAS_PHASE_OUTPUT(T,DT,NM,II,JJ,KK,IND,IND2,Y_INDEX,Z CASE(254) ! PRESSURE ZONE PARENT GAS_PHASE_OUTPUT_RES = 0._EB - IF (PRES_FLAG==ULMAT_FLAG) THEN + IF (PRES_FLAG==ULMAT_FLAG .AND. ALLOCATED(MESHES(NM)%ZONE_MESH)) THEN GAS_PHASE_OUTPUT_RES = REAL(ZONE_MESH(PRESSURE_ZONE(II,JJ,KK))%CONNECTED_ZONE_PARENT,EB) ENDIF diff --git a/Source/main.f90 b/Source/main.f90 index d825fe5f80..875609ba43 100644 --- a/Source/main.f90 +++ b/Source/main.f90 @@ -282,28 +282,6 @@ PROGRAM FDS CALL STOP_CHECK(1) ENDIF -! Poisson solver initialization - -SELECT CASE(PRES_FLAG) - CASE(FFT_FLAG) - ! All solvers require INITIALIZE_POISSON_SOLVER in INITIALIZE_MESH_VARIABLES_2 - CASE(GLMAT_FLAG,UGLMAT_FLAG) - CALL GLMAT_SOLVER_SETUP(1) - CALL STOP_CHECK(1) - CALL MESH_EXCHANGE(3) ! Exchange guard cell info for CCVAR(I,J,K,CGSC) -> HS. - CALL GLMAT_SOLVER_SETUP(2) - CALL MESH_EXCHANGE(3) ! Exchange guard cell info for CCVAR(I,J,K,UNKH) -> HS. - CALL GLMAT_SOLVER_SETUP(3) - CALL STOP_CHECK(1) - CASE(ULMAT_FLAG) - DO NM=LOWER_MESH_INDEX,UPPER_MESH_INDEX - CALL ULMAT_SOLVER_SETUP(NM) - ENDDO - CALL STOP_CHECK(1) -END SELECT - -IF (MY_RANK==0 .AND. VERBOSE) CALL VERBOSE_PRINTOUT('Completed Poisson initialization') - ! Initialize the flow field with random noise to eliminate false symmetries DO NM=LOWER_MESH_INDEX,UPPER_MESH_INDEX @@ -524,7 +502,9 @@ PROGRAM FDS IF (HVAC_SOLVE .AND. N_ZONE>0 .AND. .NOT.SOLID_PHASE_ONLY) CALL EXCHANGE_DIVERGENCE_INFO -CALL GLOBAL_MATRIX_REASSIGN +CALL GLOBAL_MATRIX_REASSIGN(FORCE_REASSIGN=.TRUE.) + +IF (MY_RANK==0 .AND. VERBOSE) CALL VERBOSE_PRINTOUT('Completed Poisson initialization') ! Write out character strings to .smv file @@ -889,7 +869,7 @@ PROGRAM FDS ! Update global pressure matrices after zone connections - CALL GLOBAL_MATRIX_REASSIGN + CALL GLOBAL_MATRIX_REASSIGN(FORCE_REASSIGN=.FALSE.) ! Exchange mass loss information for OBSTs abutting interpolated boundaries @@ -1613,17 +1593,20 @@ END SUBROUTINE CREATE_OR_REMOVE_OBSTRUCTIONS !> CREATE_OR_REMOVE_OBSTRUCTIONS or CONNECTED_ZONES has been updated. Zone connections are established !> in DIVERGENCE_PART_1, so global reassignment must follow. -SUBROUTINE GLOBAL_MATRIX_REASSIGN +SUBROUTINE GLOBAL_MATRIX_REASSIGN(FORCE_REASSIGN) + +LOGICAL, INTENT(IN) :: FORCE_REASSIGN -IF (OBST_CREATED_OR_REMOVED .OR. ICYC==1) THEN +IF (OBST_CREATED_OR_REMOVED .OR. FORCE_REASSIGN) THEN SELECT CASE (PRES_FLAG) CASE (ULMAT_FLAG) DO NM=LOWER_MESH_INDEX,UPPER_MESH_INDEX - CALL FINISH_ULMAT_SOLVER(NM) + IF(ALLOCATED(MESHES(NM)%ZONE_MESH)) CALL FINISH_ULMAT_SOLVER(NM) CALL ULMAT_SOLVER_SETUP(NM) ENDDO + CALL STOP_CHECK(1) CASE (UGLMAT_FLAG,GLMAT_FLAG) - CALL FINISH_GLMAT_SOLVER + IF(ALLOCATED(ZONE_SOLVE)) CALL FINISH_GLMAT_SOLVER CALL GLMAT_SOLVER_SETUP(1) CALL STOP_CHECK(1) CALL MESH_EXCHANGE(3) ! Exchange guard cell info for CCVAR(I,J,K,CGSC) -> HS.