Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FDS Source: fix pointer issue with insertion of particles at a CFACE #12245

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions Source/part.f90
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ SUBROUTINE PARTICLE_FACE_INSERT(WALL_INDEX,CFACE_INDEX)
INTEGER :: I,N_LPC,N_LPC_MAX,ITER,LPC_INDEX,INSERT_TYPE
REAL(EB):: CFA_X, CFA_Y, CFA_Z, RN, VEL_PART, C_S, H_1, H_2, TMP_PART, TMP_GUESS
LOGICAL :: RETURN_FLAG
TYPE (BOUNDARY_COORD_TYPE), POINTER :: CFA_BC
TYPE (CFACE_TYPE), POINTER :: CFA

WALL_OR_CFACE_IF_1: IF (PRESENT(WALL_INDEX)) THEN
Expand Down Expand Up @@ -753,6 +754,7 @@ SUBROUTINE PARTICLE_FACE_INSERT(WALL_INDEX,CFACE_INDEX)
ELSEIF (PRESENT(CFACE_INDEX)) THEN
CFA => MESHES(NM)%CFACE(CFACE_INDEX)
B1 => MESHES(NM)%BOUNDARY_PROP1(CFA%B1_INDEX)
CFA_BC => MESHES(NM)%BOUNDARY_COORD(CFA%BC_INDEX)
IF (CFA%OD_INDEX>0) ONE_D => MESHES(NM)%BOUNDARY_ONE_D(CFA%OD_INDEX)
ENDIF

Expand Down Expand Up @@ -825,17 +827,17 @@ SUBROUTINE PARTICLE_FACE_INSERT(WALL_INDEX,CFACE_INDEX)
ENDIF
ELSEIF (PRESENT(CFACE_INDEX)) THEN
CALL RANDOM_CFACE_XYZ(NM,CFA,CFA_X,CFA_Y,CFA_Z)
BC%X = CFA_X + BC%NVEC(1)*VENT_OFFSET*DX(IIG)
BC%Y = CFA_Y + BC%NVEC(2)*VENT_OFFSET*DY(JJG)
BC%Z = CFA_Z + BC%NVEC(3)*VENT_OFFSET*DZ(KKG)
BC%X = CFA_X + CFA_BC%NVEC(1)*VENT_OFFSET*DX(IIG)
BC%Y = CFA_Y + CFA_BC%NVEC(2)*VENT_OFFSET*DY(JJG)
BC%Z = CFA_Z + CFA_BC%NVEC(3)*VENT_OFFSET*DZ(KKG)
IF (INSERT_TYPE==1 .AND. LP%EMBER) THEN
CALL RANDOM_NUMBER(RN3)
BC%Z = CFA_Z + SF%EMBER_GENERATION_HEIGHT(1) + &
(SF%EMBER_GENERATION_HEIGHT(2)-SF%EMBER_GENERATION_HEIGHT(1))*REAL(RN3,EB)
ENDIF
LP%U = DOT_PRODUCT(BC%NVEC,(/-B1%U_NORMAL,SF%VEL_T(1),SF%VEL_T(2)/))
LP%V = DOT_PRODUCT(BC%NVEC,(/SF%VEL_T(1),-B1%U_NORMAL,SF%VEL_T(2)/))
LP%W = DOT_PRODUCT(BC%NVEC,(/SF%VEL_T(1),SF%VEL_T(2),-B1%U_NORMAL/))
LP%U = DOT_PRODUCT(CFA_BC%NVEC,(/-B1%U_NORMAL,SF%VEL_T(1),SF%VEL_T(2)/))
LP%V = DOT_PRODUCT(CFA_BC%NVEC,(/SF%VEL_T(1),-B1%U_NORMAL,SF%VEL_T(2)/))
LP%W = DOT_PRODUCT(CFA_BC%NVEC,(/SF%VEL_T(1),SF%VEL_T(2),-B1%U_NORMAL/))
ENDIF WALL_OR_CFACE_IF_2

! Update idicies in case offset puts location in a different cell
Expand Down