From 1e3e5168730e69f16c70c081af0fe7d709cc5f27 Mon Sep 17 00:00:00 2001 From: mcgratta Date: Tue, 24 Sep 2024 15:59:28 -0400 Subject: [PATCH] FDS Source: Clean up code related to ORIENTED particles --- Source/cons.f90 | 1 + Source/func.f90 | 1 - Source/part.f90 | 3 +-- Source/radi.f90 | 59 ++++++++++++++++--------------------------------- Source/read.f90 | 1 + Source/type.f90 | 1 - Source/wall.f90 | 1 + 7 files changed, 23 insertions(+), 44 deletions(-) diff --git a/Source/cons.f90 b/Source/cons.f90 index 913b49ba0c5..954cc8e570f 100644 --- a/Source/cons.f90 +++ b/Source/cons.f90 @@ -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 diff --git a/Source/func.f90 b/Source/func.f90 index 0d657df72d1..212b7c4db7a 100644 --- a/Source/func.f90 +++ b/Source/func.f90 @@ -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) diff --git a/Source/part.f90 b/Source/part.f90 index 2c94f1d1bb6..8ed89b22a69 100644 --- a/Source/part.f90 +++ b/Source/part.f90 @@ -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 @@ -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 diff --git a/Source/radi.f90 b/Source/radi.f90 index de0dbef45be..6394008dc28 100644 --- a/Source/radi.f90 +++ b/Source/radi.f90 @@ -4402,15 +4402,17 @@ 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)) @@ -4418,44 +4420,21 @@ SUBROUTINE RADIATION_FVM 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 diff --git a/Source/read.f90 b/Source/read.f90 index c4f4722af60..6dcceb2c0b3 100644 --- a/Source/read.f90 +++ b/Source/read.f90 @@ -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 diff --git a/Source/type.f90 b/Source/type.f90 index 4d865c51ff6..26d2b539f96 100644 --- a/Source/type.f90 +++ b/Source/type.f90 @@ -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 diff --git a/Source/wall.f90 b/Source/wall.f90 index 9717fd858ed..1747124caf1 100644 --- a/Source/wall.f90 +++ b/Source/wall.f90 @@ -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)