Skip to content

Commit

Permalink
Merge pull request #13281 from drjfloyd/master
Browse files Browse the repository at this point in the history
FDS Source: add BNDF_MESH to MESH. Issue #13242.
  • Loading branch information
drjfloyd authored Aug 5, 2024
2 parents e6669b2 + 861276f commit c2e6304
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 22 deletions.
5 changes: 4 additions & 1 deletion Manuals/FDS_User_Guide/FDS_User_Guide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9885,7 +9885,9 @@ \section{Animated Boundary Quantities: The \texorpdfstring{{\tt BNDF}}{BNDF} Nam

The {\ct BNDF} (``boundary file'') namelist group parameters allows you to record surface quantities at all solid obstructions. As with the {\ct SLCF} group, each quantity is prescribed with a separate {\ct BNDF} line, and the output files are of the form {\ct CHID\_$n$.bf}. No physical coordinates need be specified, however, just {\ct QUANTITY}. See Table \ref{tab:solidoutputquantities}. For certain output quantities, additional parameters need to be specified via the {\ct PROP} namelist group. In such cases, add the character string, {\ct PROP\_ID}, to the {\ct BNDF} line to tell FDS where to find the necessary extra information.

{\ct BNDF} files (Sec.~\ref{out:BNDF}) can become very large, so be careful in prescribing the time interval, {\ct DT\_BNDF}, or discrete times, {\ct RAMP\_BNDF}, on the {\ct DUMP} line. One way to reduce the size of the output file is to turn off the drawing of boundary information on desired obstructions. On any given {\ct OBST} line, if the string {\ct BNDF\_OBST=F} is included, the obstruction is not colored. To turn off all boundary drawing, set {\ct BNDF\_DEFAULT=F} on the {\ct MISC} line. Then individual obstructions can be turned back on with {\ct BNDF\_OBST=T} on the appropriate {\ct OBST} line. Individual faces of a given obstruction can be controlled via {\ct BNDF\_FACE(IOR)}, where {\ct IOR} is the index of orientation (+1 for the positive $x$ direction, -1 for negative, and so on). Normally, FDS averages boundary file data at cell corners. For example, surface temperatures are computed at the center of each surface cell, but they are linearly interpolated to cell corners and output to a file that is read by Smokeview. To prevent this from happening, set {\ct CELL\_CENTERED=T} on the {\ct BNDF} line. This forces FDS to output the actual cell-centered data with no averaging. Note that this feature is mainly useful for diagnostics.
{\ct BNDF} files (Sec.~\ref{out:BNDF}) can become very large, so be careful in prescribing the time interval, {\ct DT\_BNDF}, or discrete times, {\ct RAMP\_BNDF}, on the {\ct DUMP} line. One way to reduce the size of the output file is to turn off the drawing of boundary information on desired obstructions. On any given {\ct OBST} line, if the string {\ct BNDF\_OBST=F} is included, the obstruction is not colored. To turn off all boundary drawing, set {\ct BNDF\_DEFAULT=F} on the {\ct MISC} line. Then individual obstructions can be turned back on with {\ct BNDF\_OBST=T} on the appropriate {\ct OBST} line. Individual faces of a given obstruction can be controlled via {\ct BNDF\_FACE(IOR)}, where {\ct IOR} is the index of orientation (+1 for the positive $x$ direction, -1 for negative, and so on). Another way is to disable {\ct BNDF} output for specific meshes by setting {\ct BNDF\_MESH=F} on the {\ct MESH} lines where no {\ct BNDF} output is desired.

Normally, FDS averages boundary file data at cell corners. For example, surface temperatures are computed at the center of each surface cell, but they are linearly interpolated to cell corners and output to a file that is read by Smokeview. To prevent this from happening, set {\ct CELL\_CENTERED=T} on the {\ct BNDF} line. This forces FDS to output the actual cell-centered data with no averaging. Note that this feature is mainly useful for diagnostics.

Applying boundary files to complex geometries can be controlled with the {\ct BNDF\_GEOM} logical on the {\ct GEOM} line. Note that {\ct BNDF} output for {\ct GEOM} uses face centered values only (node centered is not available; the user need not set {\ct CELL\_CENTERED=T}).

Expand Down Expand Up @@ -12361,6 +12363,7 @@ \section{\texorpdfstring{{\tt MESH}}{MESH} (Mesh Parameters)}
\hline
Keyword & Type & Description & Units & Default \\ \hline \hline
\endhead
{\ct BNDF\_MESH} & Logical & Section~\ref{info:BNDF} & & {\ct T} \\ \hline
{\ct CHECK\_MESH\_ALIGNMENT} & Logical & Section~\ref{info:mesh_alignment} & & {\ct F} \\ \hline
{\ct COLOR} & Character & Section~\ref{info:multimesh} & & {\ct 'BLACK'} \\ \hline
{\ct CYLINDRICAL} & Logical & Section~\ref{info:2D} & & {\ct F} \\ \hline
Expand Down
40 changes: 21 additions & 19 deletions Source/dump.f90
Original file line number Diff line number Diff line change
Expand Up @@ -471,21 +471,22 @@ SUBROUTINE ASSIGN_FILE_NAMES
ENDDO

! Boundary Files

DO N=1,N_BNDF
LU_BNDF(N,NM) = GET_FILE_NUMBER()
LU_BNDF(N+N_BNDF,NM) = GET_FILE_NUMBER()
IF (CC_IBM) THEN
LU_BNDG(N,NM) = GET_FILE_NUMBER()
LU_BNDG(N+N_BNDF,NM) = GET_FILE_NUMBER()
ENDIF
WRITE(FN_BNDF(N,NM),'(A,A,I0,A,I0,A)') TRIM(RESULTS_DIR)//TRIM(CHID),'_',NM,'_',N,'.bf'
WRITE(FN_BNDF(N+N_BNDF,NM),'(A,A,I0,A,I0,A)') TRIM(RESULTS_DIR)//TRIM(CHID),'_',NM,'_',N,'.bf.bnd'
IF (CC_IBM) THEN
WRITE(FN_BNDG(N,NM),'(A,A,I0,A,I0,A)') TRIM(RESULTS_DIR)//TRIM(CHID),'_',NM,'_',N,'.be'
WRITE(FN_BNDG(N+N_BNDF,NM),'(A,A,I0,A,I0,A)') TRIM(RESULTS_DIR)//TRIM(CHID),'_',NM,'_',N,'.be.bnd'
ENDIF
ENDDO
IF (M%BNDF_DUMP) THEN
DO N=1,N_BNDF
LU_BNDF(N,NM) = GET_FILE_NUMBER()
LU_BNDF(N+N_BNDF,NM) = GET_FILE_NUMBER()
IF (CC_IBM) THEN
LU_BNDG(N,NM) = GET_FILE_NUMBER()
LU_BNDG(N+N_BNDF,NM) = GET_FILE_NUMBER()
ENDIF
WRITE(FN_BNDF(N,NM),'(A,A,I0,A,I0,A)') TRIM(RESULTS_DIR)//TRIM(CHID),'_',NM,'_',N,'.bf'
WRITE(FN_BNDF(N+N_BNDF,NM),'(A,A,I0,A,I0,A)') TRIM(RESULTS_DIR)//TRIM(CHID),'_',NM,'_',N,'.bf.bnd'
IF (CC_IBM) THEN
WRITE(FN_BNDG(N,NM),'(A,A,I0,A,I0,A)') TRIM(RESULTS_DIR)//TRIM(CHID),'_',NM,'_',N,'.be'
WRITE(FN_BNDG(N+N_BNDF,NM),'(A,A,I0,A,I0,A)') TRIM(RESULTS_DIR)//TRIM(CHID),'_',NM,'_',N,'.be.bnd'
ENDIF
ENDDO
ENDIF

! CFACE file for mesh NM:

Expand Down Expand Up @@ -1198,7 +1199,7 @@ SUBROUTINE INITIALIZE_MESH_DUMPS(NM)

! Initialize Boundary Files

IF_BOUNDARY_FILES: IF (N_BNDF>0) THEN
IF_BOUNDARY_FILES: IF (N_BNDF>0 .AND. M%BNDF_DUMP) THEN

I1B = MAX(IBP1,JBP1)
I2B = MAX(JBP1,KBP1)
Expand Down Expand Up @@ -1300,7 +1301,7 @@ SUBROUTINE INITIALIZE_MESH_DUMPS(NM)

BOUNDARY_FILES: DO NF=1,N_BNDF

IF (M%N_PATCH==0) EXIT BOUNDARY_FILES
IF (M%N_PATCH==0 .OR. .NOT. M%BNDF_DUMP) EXIT BOUNDARY_FILES

BF => BOUNDARY_FILE(NF)

Expand Down Expand Up @@ -3416,7 +3417,7 @@ SUBROUTINE DUMP_RESTART(T,DT,NM)

IF (LEVEL_SET_MODE>0) WRITE(LU_CORE(NM)) PHI_LS,TOA

IF (N_BNDF>0) THEN
IF (N_BNDF>0 .AND. BNDF_DUMP) THEN
WRITE(LU_CORE(NM)) N_PATCH,N_BNDF_POINTS
WRITE(LU_CORE(NM)) PATCH
ENDIF
Expand Down Expand Up @@ -3638,7 +3639,7 @@ SUBROUTINE READ_RESTART(T,DT,NM)

IF (LEVEL_SET_MODE>0) READ(LU_RESTART(NM)) PHI_LS,TOA

IF (N_BNDF>0) THEN
IF (N_BNDF>0 .AND. BNDF_DUMP) THEN
READ(LU_RESTART(NM)) N_PATCH,N_BNDF_POINTS
ALLOCATE(MESHES(NM)%PATCH(N_PATCH)) ; PATCH=>MESHES(NM)%PATCH
READ(LU_RESTART(NM)) PATCH
Expand Down Expand Up @@ -10258,6 +10259,7 @@ SUBROUTINE DUMP_BNDF(T,DT,NM)
INTEGER :: CHANGE_BOUND, IERROR

IF (MESHES(NM)%N_PATCH==0 .AND. MESHES(NM)%N_INTERNAL_CFACE_CELLS==0) RETURN
IF (.NOT. MESHES(NM)%BNDF_DUMP) RETURN

FROM_BNDF = .TRUE.

Expand Down
3 changes: 3 additions & 0 deletions Source/mesh.f90
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ MODULE MESH_VARIABLES
INTEGER :: ICFL,JCFL,KCFL,IMX,JMX,KMX,IMN,JMN,KMN, I_VN,J_VN,K_VN,IRM,JRM,KRM, DT_RESTRICT_COUNT=0,DT_RESTRICT_STORE=0
LOGICAL :: CLIP_RHOMIN=.FALSE.,CLIP_RHOMAX=.FALSE.
LOGICAL :: BAROCLINIC_TERMS_ATTACHED=.FALSE.
LOGICAL :: BNDF_DUMP=.TRUE.
CHARACTER(LABEL_LENGTH) :: TRNX_ID,TRNY_ID,TRNZ_ID

TYPE(EDGE_TYPE), ALLOCATABLE, DIMENSION(:) :: EDGE
Expand Down Expand Up @@ -379,6 +380,7 @@ MODULE MESH_POINTERS
INTEGER, POINTER :: ICFL,JCFL,KCFL,IMX,JMX,KMX,IMN,JMN,KMN,I_VN,J_VN,K_VN,IRM,JRM,KRM,DT_RESTRICT_COUNT,DT_RESTRICT_STORE
LOGICAL, POINTER :: CLIP_RHOMIN,CLIP_RHOMAX
LOGICAL, POINTER :: BAROCLINIC_TERMS_ATTACHED
LOGICAL, POINTER :: BNDF_DUMP
TYPE(EDGE_TYPE), POINTER, DIMENSION(:) :: EDGE

INTEGER, POINTER :: IBAR,JBAR,KBAR,IBM1,JBM1,KBM1,IBP1,JBP1,KBP1
Expand Down Expand Up @@ -654,6 +656,7 @@ SUBROUTINE POINT_TO_MESH(NM)
JRM=>M%JRM
KRM=>M%KRM
BAROCLINIC_TERMS_ATTACHED=>M%BAROCLINIC_TERMS_ATTACHED
BNDF_DUMP=>M%BNDF_DUMP
I_VN=>M%I_VN
J_VN=>M%J_VN
K_VN=>M%K_VN
Expand Down
6 changes: 4 additions & 2 deletions Source/read.f90
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,11 @@ END FUNCTION READ_STOP
SUBROUTINE READ_MESH

INTEGER :: IJK(3),NM,CURRENT_MPI_PROCESS,MPI_PROCESS,RGB(3),N_MESH_NEW,N,II,JJ,KK,NMESHES_READ,NNN,JBAR_OLD_VALUE
LOGICAL :: CYLINDRICAL_OLD_VALUE
LOGICAL :: CYLINDRICAL_OLD_VALUE,BNDF_MESH
REAL(EB) :: XB1,XB2,XB3,XB4,XB5,XB6
CHARACTER(25) :: COLOR
CHARACTER(LABEL_LENGTH) :: MULT_ID,TRNX_ID,TRNY_ID,TRNZ_ID
NAMELIST /MESH/ CHECK_MESH_ALIGNMENT,COLOR,CYLINDRICAL,FYI,ID,IJK,MPI_PROCESS,MULT_ID,RGB,TRNX_ID,TRNY_ID,TRNZ_ID,XB
NAMELIST /MESH/ BNDF_MESH,CHECK_MESH_ALIGNMENT,COLOR,CYLINDRICAL,FYI,ID,IJK,MPI_PROCESS,MULT_ID,RGB,TRNX_ID,TRNY_ID,TRNZ_ID,XB
TYPE (MESH_TYPE), POINTER :: M
TYPE (MULTIPLIER_TYPE), POINTER :: MR

Expand Down Expand Up @@ -612,6 +612,7 @@ SUBROUTINE READ_MESH
TRNX_ID = 'null'
TRNY_ID = 'null'
TRNZ_ID = 'null'
BNDF_MESH = .TRUE.

! Read the MESH line

Expand Down Expand Up @@ -693,6 +694,7 @@ SUBROUTINE READ_MESH
JBAR_MAX = MAX(JBAR_MAX,M%JBAR)
KBAR_MAX = MAX(KBAR_MAX,M%KBAR)
M%N_EXTERNAL_WALL_CELLS = 2*M%IBAR*M%JBAR+2*M%IBAR*M%KBAR+2*M%JBAR*M%KBAR
M%BNDF_DUMP = BNDF_MESH

IF (M%JBAR==1) TWO_D = .TRUE.
IF (TWO_D .AND. M%JBAR/=1) THEN
Expand Down

0 comments on commit c2e6304

Please sign in to comment.