Skip to content

Commit c7ef74e

Browse files
Merge pull request firemodels#14416 from marcosvanella/master
FDS Source: Reduce significant digits from cell-linking search direct…
2 parents 7e7a75a + 677742c commit c7ef74e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Source/geom.f90

+13
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ MODULE COMPLEX_GEOMETRY
288288

289289
! Max numbers of link attempts for small faces and cut-cells:
290290
INTEGER, PARAMETER :: N_LINK_ATTMP = 1, N_LINK_ATTMP_F=50
291+
! Number of digits in loose precision used in normals definition for linking.
292+
INTEGER, PARAMETER :: LINK_DIGITS = 8
293+
REAL(EB),PARAMETER :: LINK_FCT = REAL(10**LINK_DIGITS,EB)
291294

292295
! Areas per SURF and GEOM:
293296
REAL(EB), ALLOCATABLE, DIMENSION(:,:) :: FDS_AREA_GEOM
@@ -8268,6 +8271,11 @@ SUBROUTINE GET_CELL_LINK_INFO(NM)
82688271

82698272
! With the surface normal search for a Regular Gasphase face in that direction.
82708273
AREA_IF_1 : IF (AREA > TWO_EPSILON_EB) THEN
8274+
NRML = NRML / AREA ! Normalize unit vector:
8275+
! Normalize NRML vector to LINK_DIGITS:
8276+
DO DUM=IAXIS,KAXIS
8277+
NRML(DUM) = REAL(INT(LINK_FCT*NRML(DUM)),EB)/LINK_FCT
8278+
ENDDO
82718279
MASK(IAXIS:KAXIS) = .TRUE.
82728280
INRM(1) = MAXLOC(ABS(NRML(IAXIS:KAXIS)),MASK=MASK,DIM=1); MASK(INRM(1))=.FALSE.
82738281
INRM(2) = MAXLOC(ABS(NRML(IAXIS:KAXIS)),MASK=MASK,DIM=1); MASK(INRM(2))=.FALSE.
@@ -8373,6 +8381,11 @@ SUBROUTINE GET_CELL_LINK_INFO(NM)
83738381
ENDDO
83748382

83758383
AREA_IF_2 : IF (AREA > TWO_EPSILON_EB) THEN
8384+
NRML = NRML / AREA ! Normalize unit vector:
8385+
! Normalize NRML vector to LINK_DIGITS:
8386+
DO DUM=IAXIS,KAXIS
8387+
NRML(DUM) = REAL(INT(LINK_FCT*NRML(DUM)),EB)/LINK_FCT
8388+
ENDDO
83768389
MASK(IAXIS:KAXIS) = .TRUE.
83778390
INRM(1) = MAXLOC(ABS(NRML(IAXIS:KAXIS)),MASK=MASK,DIM=1); MASK(INRM(1))=.FALSE.
83788391
INRM(2) = MAXLOC(ABS(NRML(IAXIS:KAXIS)),MASK=MASK,DIM=1); MASK(INRM(2))=.FALSE.

0 commit comments

Comments
 (0)