Skip to content

Commit

Permalink
FDS Source: Clean up code related to ORIENTED particles
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgratta committed Sep 24, 2024
1 parent e5b6ec6 commit 1e3e516
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 44 deletions.
1 change: 1 addition & 0 deletions Source/cons.f90
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ MODULE GLOBAL_CONSTANTS
LOGICAL :: CHECK_VN=.TRUE. !< Check the Von Neumann number
LOGICAL :: CHECK_FO=.FALSE. !< Check the solid phase Fourier number
LOGICAL :: SOLID_PARTICLES=.FALSE. !< Indicates the existence of solid particles
LOGICAL :: ORIENTED_PARTICLES=.FALSE. !< Indicates the existence of particles with a specified orientation
LOGICAL :: HVAC=.FALSE. !< Perform an HVAC calculation
LOGICAL :: BAROCLINIC=.TRUE. !< Include the baroclinic terms in the momentum equation
LOGICAL :: GRAVITATIONAL_DEPOSITION=.TRUE. !< Allow aerosol gravitational deposition
Expand Down
1 change: 0 additions & 1 deletion Source/func.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,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%TAG,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),LP%CLASS_INDEX,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),LP%INITIALIZATION_INDEX,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),LP%ORIENTATION_INDEX,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),LP%WALL_INDEX,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),LP%DUCT_INDEX,UNPACK_IT)
Expand Down
3 changes: 1 addition & 2 deletions Source/part.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ SUBROUTINE INSERT_VOLUMETRIC_PARTICLES
LP%DX = DX(II)
LP%DY = DY(JJ)
LP%DZ = DZ(KK)
LP%INITIALIZATION_INDEX = INIT_INDEX
LP%INIT_INDEX = INIT_INDEX

! Initialize particle properties

Expand Down Expand Up @@ -1399,7 +1399,6 @@ SUBROUTINE INSERT_VOLUMETRIC_PARTICLES
LP%PWT = LP%PWT*PWT0
ENDIF
IF (ANY(IN%PATH_RAMP_INDEX>0)) LP%PATH_PARTICLE=.TRUE.
LP%INIT_INDEX = INIT_INDEX
ENDDO

ENDIF
Expand Down
59 changes: 19 additions & 40 deletions Source/radi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4402,60 +4402,39 @@ SUBROUTINE RADIATION_FVM
ENDDO OTHER_WALL_LOOP
ENDDO INTERPOLATION_LOOP

! Compute projected intensity on particles
! Compute projected intensity on particles with a specified ORIENTATION

IF (SOLID_PARTICLES) THEN
IF (ORIENTED_PARTICLES) THEN
PARTICLE_RADIATION_LOOP: DO IP=1,NLP
LP => LAGRANGIAN_PARTICLE(IP)
LPC => LAGRANGIAN_PARTICLE_CLASS(LP%CLASS_INDEX)
IF (LPC%N_ORIENTATION==0) CYCLE PARTICLE_RADIATION_LOOP
BC => BOUNDARY_COORD(LP%BC_INDEX)
IF (LP%INITIALIZATION_INDEX > 0) THEN
IN => INITIALIZATION(LP%INITIALIZATION_INDEX)
TEMP_ORIENTATION(1:3) = ORIENTATION_VECTOR(1:3,LP%ORIENTATION_INDEX)
IF (LP%INIT_INDEX > 0) THEN
IN => INITIALIZATION(LP%INIT_INDEX)
IF (ANY(IN%ORIENTATION_RAMP_INDEX > 0)) THEN
TEMP_ORIENTATION(1) = EVALUATE_RAMP(T,IN%ORIENTATION_RAMP_INDEX(1))
TEMP_ORIENTATION(2) = EVALUATE_RAMP(T,IN%ORIENTATION_RAMP_INDEX(2))
TEMP_ORIENTATION(3) = EVALUATE_RAMP(T,IN%ORIENTATION_RAMP_INDEX(3))
TEMP_ORIENTATION = TEMP_ORIENTATION / &
(SQRT(TEMP_ORIENTATION(1)**2+TEMP_ORIENTATION(2)**2+TEMP_ORIENTATION(3)**2) &
+TWO_EPSILON_EB)
COS_DL = -DOT_PRODUCT(TEMP_ORIENTATION(1:3),DLANG(1:3,N))
IF (COS_DL>ORIENTATION_VIEW_ANGLE(LP%ORIENTATION_INDEX)) THEN
COS_DL = -(TEMP_ORIENTATION(1)*DLX(N) + &
TEMP_ORIENTATION(2)*DLY(N) + &
TEMP_ORIENTATION(3)*DLZ(N))
BR => BOUNDARY_RADIA(LP%BR_INDEX)
IF (LPC%MASSLESS_TARGET) THEN
BR%BAND(IBND)%ILW(N) = COS_DL * IL(BC%IIG,BC%JJG,BC%KKG) * VIEW_ANGLE_AREA(LP%ORIENTATION_INDEX)
IF (N==NEAREST_RADIATION_ANGLE(LP%ORIENTATION_INDEX)) &
BR%IL(IBND) = IL(BC%IIG,BC%JJG,BC%KKG)
ELSE
! IL_UP does not account for the absorption of radiation within the cell occupied by the particle
BR%BAND(IBND)%ILW(N) = COS_DL * IL_UP(BC%IIG,BC%JJG,BC%KKG) * VIEW_ANGLE_AREA(LP%ORIENTATION_INDEX)
ENDIF
ENDIF
CYCLE PARTICLE_RADIATION_LOOP
ENDIF
ENDIF
SELECT CASE(LPC%N_ORIENTATION)
CASE(0)
CYCLE PARTICLE_RADIATION_LOOP
CASE(1)
COS_DL = -DOT_PRODUCT(ORIENTATION_VECTOR(1:3,LP%ORIENTATION_INDEX),DLANG(1:3,N))
IF (COS_DL>ORIENTATION_VIEW_ANGLE(LP%ORIENTATION_INDEX)) THEN
COS_DL = -(ORIENTATION_VECTOR(1,LP%ORIENTATION_INDEX)*DLX(N) + &
ORIENTATION_VECTOR(2,LP%ORIENTATION_INDEX)*DLY(N) + &
ORIENTATION_VECTOR(3,LP%ORIENTATION_INDEX)*DLZ(N))
BR => BOUNDARY_RADIA(LP%BR_INDEX)
IF (LPC%MASSLESS_TARGET) THEN
BR%BAND(IBND)%ILW(N) = COS_DL * IL(BC%IIG,BC%JJG,BC%KKG) * VIEW_ANGLE_AREA(LP%ORIENTATION_INDEX)
IF (N==NEAREST_RADIATION_ANGLE(LP%ORIENTATION_INDEX)) &
BR%IL(IBND) = IL(BC%IIG,BC%JJG,BC%KKG)
ELSE
! IL_UP does not account for the absorption of radiation within the cell occupied by the particle
BR%BAND(IBND)%ILW(N) = COS_DL * IL_UP(BC%IIG,BC%JJG,BC%KKG) * VIEW_ANGLE_AREA(LP%ORIENTATION_INDEX)
ENDIF
ENDIF
END SELECT
COS_DL = -DOT_PRODUCT(TEMP_ORIENTATION(1:3),DLANG(1:3,N))
IF (COS_DL > ORIENTATION_VIEW_ANGLE(LP%ORIENTATION_INDEX)) THEN
COS_DL = -(TEMP_ORIENTATION(1)*DLX(N) + TEMP_ORIENTATION(2)*DLY(N) + TEMP_ORIENTATION(3)*DLZ(N))
BR => BOUNDARY_RADIA(LP%BR_INDEX)
IF (LPC%MASSLESS_TARGET) THEN
BR%BAND(IBND)%ILW(N) = COS_DL * IL(BC%IIG,BC%JJG,BC%KKG) * VIEW_ANGLE_AREA(LP%ORIENTATION_INDEX)
IF (N==NEAREST_RADIATION_ANGLE(LP%ORIENTATION_INDEX)) &
BR%IL(IBND) = IL(BC%IIG,BC%JJG,BC%KKG)
ELSE
! IL_UP does not account for the absorption of radiation within the cell occupied by the particle
BR%BAND(IBND)%ILW(N) = COS_DL * IL_UP(BC%IIG,BC%JJG,BC%KKG) * VIEW_ANGLE_AREA(LP%ORIENTATION_INDEX)
ENDIF
ENDIF
ENDDO PARTICLE_RADIATION_LOOP
ENDIF

Expand Down
1 change: 1 addition & 0 deletions Source/read.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5967,6 +5967,7 @@ SUBROUTINE READ_PART
IF (ANY(ABS(ORIENTATION(1:3))>TWO_EPSILON_EB)) LPC%N_ORIENTATION = LPC%N_ORIENTATION + 1

IF (LPC%N_ORIENTATION>0) THEN
ORIENTED_PARTICLES = .TRUE.
LPC%INCLUDE_BOUNDARY_RADIA_TYPE = .TRUE.
N_ORIENTATION_VECTOR = N_ORIENTATION_VECTOR + 1
LPC%ORIENTATION_INDEX = N_ORIENTATION_VECTOR
Expand Down
1 change: 0 additions & 1 deletion Source/type.f90
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ MODULE TYPES
INTEGER :: BR_INDEX=0 !< Variables devoted to radiation intensities
INTEGER :: TAG !< Unique integer identifier for the particle
INTEGER :: CLASS_INDEX=0 !< LAGRANGIAN_PARTICLE_CLASS of particle
INTEGER :: INITIALIZATION_INDEX=0 !< Index for INIT that placed the particle
INTEGER :: ORIENTATION_INDEX=0 !< Index in the array of all ORIENTATIONs
INTEGER :: WALL_INDEX=0 !< If liquid droplet has stuck to a wall, this is the WALL cell index
INTEGER :: DUCT_INDEX=0 !< Index of duct
Expand Down
1 change: 1 addition & 0 deletions Source/wall.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3170,6 +3170,7 @@ SUBROUTINE PYROLYSIS(N_MATS,MATL_INDEX,SURF_INDEX,IIG,JJG,KKG,TMP_S,TMP_F,Y_O2_F
ELSEIF (SIM_MODE==DNS_MODE) THEN H_MASS_IF

SELECT CASE(ABS(IOR))
CASE(0); H_MASS = 0._EB
CASE(1); H_MASS = 2._EB*D_FILM*RDX(IIG)
CASE(2); H_MASS = 2._EB*D_FILM*RDY(JJG)
CASE(3); H_MASS = 2._EB*D_FILM*RDZ(KKG)
Expand Down

0 comments on commit 1e3e516

Please sign in to comment.