Skip to content

Commit

Permalink
Merge pull request #13807 from mcgratta/master
Browse files Browse the repository at this point in the history
FDS Source: Issues #13805 and #13806. Clean up particle bookkeeping
  • Loading branch information
mcgratta authored Nov 26, 2024
2 parents 6e9300c + 61fca61 commit 92ecf4c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 28 deletions.
6 changes: 3 additions & 3 deletions Source/dump.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3197,9 +3197,9 @@ SUBROUTINE INITIALIZE_DIAGNOSTIC_FILE(DT)
LPC => LAGRANGIAN_PARTICLE_CLASS(N)
WRITE(LU_OUTPUT,'(/I4,1X,A)') N,TRIM(LPC%ID)
WRITE(LU_OUTPUT,'(4X,A,A)') ' SURFace ID: ',TRIM(SURFACE(LPC%SURF_INDEX)%ID)
WRITE(LU_OUTPUT,'(4X,A,I0)') ' # Reals: ',LPC%N_STORAGE_REALS
WRITE(LU_OUTPUT,'(4X,A,I0)') ' # Integers: ',LPC%N_STORAGE_INTEGERS
WRITE(LU_OUTPUT,'(4X,A,I0)') ' # Logicals: ',LPC%N_STORAGE_LOGICALS
WRITE(LU_OUTPUT,'(4X,A,I0)') ' # Reals: ',LPC%N_REALS
WRITE(LU_OUTPUT,'(4X,A,I0)') ' # Integers: ',LPC%N_INTEGERS
WRITE(LU_OUTPUT,'(4X,A,I0)') ' # Logicals: ',LPC%N_LOGICALS
ENDDO PARTLOOP

! Print out information about all Devices
Expand Down
5 changes: 0 additions & 5 deletions Source/func.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1058,8 +1058,6 @@ SUBROUTINE ALLOCATE_STORAGE(NM,LP_INDEX,LPC_INDEX,SURF_INDEX,WALL_INDEX,CFACE_IN
LP%B2_INDEX = B2_INDEX
LP%BR_INDEX = BR_INDEX

CALL PACK_PARTICLE(NM,OS_DUMMY,LP,LPC_INDEX,LP%N_REALS,LP%N_INTEGERS,LP%N_LOGICALS,UNPACK_IT=.FALSE.,COUNT_ONLY=.TRUE.)

ELSEIF (PRESENT(WALL_INDEX)) THEN

SF => SURFACE(SURF_INDEX)
Expand Down Expand Up @@ -1484,9 +1482,6 @@ SUBROUTINE PACK_PARTICLE(NM,OS,LP,LPC_INDEX,RC,IC,LC,UNPACK_IT,COUNT_ONLY)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),LP%INIT_INDEX,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),LP%CFACE_INDEX,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),LP%PROP_INDEX,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),LP%N_REALS,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),LP%N_INTEGERS,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),LP%N_LOGICALS,UNPACK_IT)

! Assign logical pointers and values

Expand Down
10 changes: 5 additions & 5 deletions Source/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2037,11 +2037,11 @@ SUBROUTINE INITIALIZE_MESH_EXCHANGE_1(NM)
CALL ALLOCATE_STORAGE(NM,LP_INDEX=1,LPC_INDEX=ILC,SURF_INDEX=LPC%SURF_INDEX)
LP => M%LAGRANGIAN_PARTICLE(1)
OS => LPC%PARTICLE_STORAGE
CALL PACK_PARTICLE(NM,OS,LP,ILC,LPC%N_STORAGE_REALS,LPC%N_STORAGE_INTEGERS,LPC%N_STORAGE_LOGICALS,&
UNPACK_IT=.FALSE.,COUNT_ONLY=.TRUE.)
IF (.NOT.ALLOCATED(LPC%PARTICLE_STORAGE%REALS)) ALLOCATE(LPC%PARTICLE_STORAGE%REALS(LPC%N_STORAGE_REALS))
IF (.NOT.ALLOCATED(LPC%PARTICLE_STORAGE%INTEGERS)) ALLOCATE(LPC%PARTICLE_STORAGE%INTEGERS(LPC%N_STORAGE_INTEGERS))
IF (.NOT.ALLOCATED(LPC%PARTICLE_STORAGE%LOGICALS)) ALLOCATE(LPC%PARTICLE_STORAGE%LOGICALS(LPC%N_STORAGE_LOGICALS))
LPC%N_REALS=0 ; LPC%N_INTEGERS=0 ; LPC%N_LOGICALS=0
CALL PACK_PARTICLE(NM,OS,LP,ILC,LPC%N_REALS,LPC%N_INTEGERS,LPC%N_LOGICALS,UNPACK_IT=.FALSE.,COUNT_ONLY=.TRUE.)
IF (.NOT.ALLOCATED(LPC%PARTICLE_STORAGE%REALS)) ALLOCATE(LPC%PARTICLE_STORAGE%REALS(LPC%N_REALS))
IF (.NOT.ALLOCATED(LPC%PARTICLE_STORAGE%INTEGERS)) ALLOCATE(LPC%PARTICLE_STORAGE%INTEGERS(LPC%N_INTEGERS))
IF (.NOT.ALLOCATED(LPC%PARTICLE_STORAGE%LOGICALS)) ALLOCATE(LPC%PARTICLE_STORAGE%LOGICALS(LPC%N_LOGICALS))
CALL NULLIFY_PARTICLE(NM,1)
ENDDO

Expand Down
18 changes: 9 additions & 9 deletions Source/part.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4734,17 +4734,17 @@ SUBROUTINE ADD_TO_PARTICLE_SEND_BUFFER
IF (NOM/=0 .AND. NOM/=NM) THEN

OS => OMESH(NOM)%PARTICLE_SEND_BUFFER
IF (OS%N_REALS+LP%N_REALS>OS%N_REALS_DIM) THEN
CALL REALLOCATE_STORAGE_ARRAYS(OS,N_REALS=OS%N_REALS_DIM,N_REALS_NEW=OS%N_REALS_DIM+10*LP%N_REALS)
OS%N_REALS_DIM = OS%N_REALS_DIM + 10*LP%N_REALS
IF (OS%N_REALS+LPC%N_REALS>OS%N_REALS_DIM) THEN
CALL REALLOCATE_STORAGE_ARRAYS(OS,N_REALS=OS%N_REALS_DIM,N_REALS_NEW=OS%N_REALS_DIM+10*LPC%N_REALS)
OS%N_REALS_DIM = OS%N_REALS_DIM + 10*LPC%N_REALS
ENDIF
IF (OS%N_INTEGERS+LP%N_INTEGERS>OS%N_INTEGERS_DIM) THEN
CALL REALLOCATE_STORAGE_ARRAYS(OS,N_INTEGERS=OS%N_INTEGERS_DIM,N_INTEGERS_NEW=OS%N_INTEGERS_DIM+10*LP%N_INTEGERS)
OS%N_INTEGERS_DIM = OS%N_INTEGERS_DIM + 10*LP%N_INTEGERS
IF (OS%N_INTEGERS+LPC%N_INTEGERS>OS%N_INTEGERS_DIM) THEN
CALL REALLOCATE_STORAGE_ARRAYS(OS,N_INTEGERS=OS%N_INTEGERS_DIM,N_INTEGERS_NEW=OS%N_INTEGERS_DIM+10*LPC%N_INTEGERS)
OS%N_INTEGERS_DIM = OS%N_INTEGERS_DIM + 10*LPC%N_INTEGERS
ENDIF
IF (OS%N_LOGICALS+LP%N_LOGICALS>OS%N_LOGICALS_DIM) THEN
CALL REALLOCATE_STORAGE_ARRAYS(OS,N_LOGICALS=OS%N_LOGICALS_DIM,N_LOGICALS_NEW=OS%N_LOGICALS_DIM+10*LP%N_LOGICALS)
OS%N_LOGICALS_DIM = OS%N_LOGICALS_DIM + 10*LP%N_LOGICALS
IF (OS%N_LOGICALS+LPC%N_LOGICALS>OS%N_LOGICALS_DIM) THEN
CALL REALLOCATE_STORAGE_ARRAYS(OS,N_LOGICALS=OS%N_LOGICALS_DIM,N_LOGICALS_NEW=OS%N_LOGICALS_DIM+10*LPC%N_LOGICALS)
OS%N_LOGICALS_DIM = OS%N_LOGICALS_DIM + 10*LPC%N_LOGICALS
ENDIF

OS%N_ITEMS = OS%N_ITEMS + 1
Expand Down
9 changes: 3 additions & 6 deletions Source/type.f90
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ MODULE TYPES
INTEGER :: NEAREST_RAD_ANGLE_INDEX=0 !< Index of the radiation angle nearest the given orientation vector
INTEGER :: CNF_RAMP_INDEX=-1 !< Ramp index for Cumulative Number Fraction function
INTEGER :: BREAKUP_CNF_RAMP_INDEX=-1 !< Ramp index for break-up Cumulative Number Fraction function
INTEGER :: N_STORAGE_REALS=0 !< Number of reals to store for this particle class
INTEGER :: N_STORAGE_INTEGERS=0 !< Number of integers to store for this particle class
INTEGER :: N_STORAGE_LOGICALS=0 !< Number of logicals to store for this particle class
INTEGER :: N_REALS=0 !< Number of reals to store for this particle class
INTEGER :: N_INTEGERS=0 !< Number of integers to store for this particle class
INTEGER :: N_LOGICALS=0 !< Number of logicals to store for this particle class
INTEGER :: NEW_PARTICLE_INCREMENT=1000 !< Number of new storage slots to allocate when NPLDIM is exceeded
INTEGER :: EVAP_MODEL !< Evaporation correlation

Expand Down Expand Up @@ -392,9 +392,6 @@ MODULE TYPES
INTEGER :: DUCT_CELL_INDEX=0 !< Index of duct cell
INTEGER :: CFACE_INDEX=0 !< Index of immersed boundary CFACE that the droplet has attached to
INTEGER :: PROP_INDEX=0 !< Index of the PROPERTY_TYPE assigned to the particle
INTEGER :: N_REALS=0 !< Number of reals to pack into restart or send/recv buffer
INTEGER :: N_INTEGERS=0 !< Number of integers to pack into restart or send/recv buffer
INTEGER :: N_LOGICALS=0 !< Number of logicals to pack into restart or send/recv buffer

LOGICAL :: SHOW=.FALSE. !< Show the particle in Smokeview
LOGICAL :: SPLAT=.FALSE. !< The liquid droplet has hit a solid
Expand Down

0 comments on commit 92ecf4c

Please sign in to comment.