Skip to content

Commit

Permalink
Merge remote-tracking branch 'firemodels/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgratta committed Aug 5, 2024
2 parents d65c1d9 + cd12a54 commit 719a972
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 27 deletions.
9 changes: 6 additions & 3 deletions Manuals/FDS_User_Guide/FDS_User_Guide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ \section{Monitoring Progress}
\end{lstlisting}
Be aware the output file will not monitor mesh boundary velocity errors in this case; it will echo only the simulation time and time step. You could still output a {\ct BNDF} of {\ct QUANTITY='VELOCITY ERROR'}, if necessary.

To stop a calculation before its scheduled time, create a file in the same directory as the output files called {\ct CHID.stop}. The existence of this file stops the program gracefully, causing it to dump out the latest flow variables for viewing in Smokeview.
To stop a calculation before its scheduled time, create a file in the same directory as the output files called {\ct CHID.stop}. The existence of this file stops the program gracefully, causing it to dump out the latest flow variables for viewing in Smokeview.

Since calculations can extend to hours or days, there is a restart feature in FDS. Details of how to use this feature are given in Sec.~\ref{info:restart}. Briefly, specify at the beginning of calculation how often a ``restart'' file should be saved. Should something happen to disrupt the calculation, like a power outage, the calculation can be restarted from the time the last restart file was saved.

Expand Down Expand Up @@ -811,7 +811,7 @@ \section{Protecting Old Cases}
\section{Stopping and Restarting Calculations ({\tt .restart})}
\label{info:restart}

An important {\ct MISC} parameter is called {\ct RESTART}. Normally, a simulation consists of a sequence of events starting from ambient conditions. However, there are occasions when you might want to stop a calculation, make a few limited adjustments, and then restart the calculation from that point in time. To do this, first bring the calculation to a halt gracefully by creating a file called {\ct CHID.stop} in the directory where the output files are located. Remember that FDS is case-sensitive. The file name must be exactly the same as the {\ct CHID} and `stop' should be lower case. FDS checks for the existence of this file at each time step, and if it finds it, gracefully shuts down the calculation after first creating a file (or files in the case of a multiple mesh job) called {\ct CHID.restart} (or {\ct CHID\_nn.restart}). To restart a job, the file(s) {\ct CHID.restart} should exist in the working directory, and the phrase {\ct RESTART=T} needs to be added to the {\ct MISC} line of the input data file. For example, suppose that the job whose {\ct CHID} is ``plume'' is halted by creating a dummy file called {\ct plume.stop} in the directory where all the output files are being created. To restart this job from where it left off you will need to delete the file {\ct CHID.stop} so that FDS does not immediately stop the calculation and add {\ct RESTART=T} to the {\ct MISC} line of the input file {\ct plume.fds}, or whatever you have chosen to name the input file. The existence of a restart file with the same {\ct CHID} as the original job tells FDS to continue saving the new data in the same files as the old\footnote{By default, when a job is restarted, the spreadsheet output files will be appended at the time the job was restarted, not the time the job was stopped. If you want the output files to be appended without clipping off any existing data, even though some duplicate output will be left over, then set {\ct CLIP\_RESTART\_FILES} to {\ct F} on the {\ct DUMP} line.}. If {\ct RESTART\_CHID} is also specified on the {\ct MISC} line, then FDS will look for old output files tagged with this string instead of using the specified {\ct CHID} on the {\ct HEAD} line. In this case, the new output files will be tagged with {\ct CHID}, and the old output files will not be altered. When running the restarted job, the diagnostic output of the restarted job is appended to output files from the original job.
An important {\ct MISC} parameter is called {\ct RESTART}. Normally, a simulation consists of a sequence of events starting from ambient conditions. However, there are occasions when you might want to stop a calculation, make a few limited adjustments, and then restart the calculation from that point in time. To do this, first bring the calculation to a halt gracefully by creating a file called {\ct CHID.stop} in the directory where the output files are located. Remember that FDS is case-sensitive. The file name must be exactly the same as the {\ct CHID} and `stop' should be lower case. If you have a {\ct CATF} line in your input, you will need to use {\ct CHID\_cat.stop}. FDS checks for the existence of this file at each time step, and if it finds it, gracefully shuts down the calculation after first creating a file (or files in the case of a multiple mesh job) called {\ct CHID.restart} (or {\ct CHID\_nn.restart}). To restart a job, the file(s) {\ct CHID.restart} should exist in the working directory, and the phrase {\ct RESTART=T} needs to be added to the {\ct MISC} line of the input data file. For example, suppose that the job whose {\ct CHID} is ``plume'' is halted by creating a dummy file called {\ct plume.stop} in the directory where all the output files are being created. To restart this job from where it left off you will need to delete the file {\ct CHID.stop} so that FDS does not immediately stop the calculation and add {\ct RESTART=T} to the {\ct MISC} line of the input file {\ct plume.fds}, or whatever you have chosen to name the input file. The existence of a restart file with the same {\ct CHID} as the original job tells FDS to continue saving the new data in the same files as the old\footnote{By default, when a job is restarted, the spreadsheet output files will be appended at the time the job was restarted, not the time the job was stopped. If you want the output files to be appended without clipping off any existing data, even though some duplicate output will be left over, then set {\ct CLIP\_RESTART\_FILES} to {\ct F} on the {\ct DUMP} line.}. If {\ct RESTART\_CHID} is also specified on the {\ct MISC} line, then FDS will look for old output files tagged with this string instead of using the specified {\ct CHID} on the {\ct HEAD} line. In this case, the new output files will be tagged with {\ct CHID}, and the old output files will not be altered. When running the restarted job, the diagnostic output of the restarted job is appended to output files from the original job.

There may be times when you want to save restart files periodically during a run as insurance against power outages or system crashes. If this is the case, at the start of the original run set {\ct DT\_RESTART=50.} on the {\ct DUMP} line to save restart files every 50~s, for example. The default for {\ct DT\_RESTART} is 1000000, meaning no restart files are created unless you gracefully stop a job by creating a dummy file called {\ct CHID.stop}.
The control function feature (see Sec.~\ref{info:CTRL}) can be used to stop a calculation or dump a restart file when the computation reaches some measurable condition such as the first sprinkler activation.
Expand Down 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. Disabling output for a {\ct MESH} includes all wall cells at the exterior boundary of that {\ct MESH}.

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
35 changes: 30 additions & 5 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 Expand Up @@ -15007,7 +15009,7 @@ SUBROUTINE READ_SLCF
REAL(EB) :: MAXIMUM_VALUE,MINIMUM_VALUE
REAL(EB) :: AGL_SLICE
INTEGER :: N,NN,NM,MESH_NUMBER,N_SLCF_O,NITER,ITER,VELO_INDEX,GEOM_INDEX,IOR
LOGICAL :: VECTOR,CELL_CENTERED,DEBUG
LOGICAL :: VECTOR,CELL_CENTERED,DEBUG,CULL_SLICE
CHARACTER(LABEL_LENGTH) :: QUANTITY,SPEC_ID,PART_ID,QUANTITY2,PROP_ID,REAC_ID,SLICETYPE
REAL(EB), PARAMETER :: TOL=1.E-10_EB
REAL(FB) :: RLE_MIN, RLE_MAX
Expand Down Expand Up @@ -15144,13 +15146,36 @@ SUBROUTINE READ_SLCF

! Reject a slice if it is beyond the bounds of the current mesh

IF (XB(1)>=XF .OR. XB(2)<=XS .OR. XB(3)>=YF .OR. XB(4)<=YS .OR. XB(5)>=ZF .OR. XB(6)<=ZS) THEN
CULL_SLICE = .FALSE.
SELECT CASE (IOR)
CASE(1)
IF (XB(3)>=YF .OR. XB(4)<=YS .OR. XB(5)>=ZF .OR. XB(6)<=ZS) THEN
CULL_SLICE = .TRUE.
ELSE
IF (XB(1)>XF .OR. XB(2)<XS) CULL_SLICE =.TRUE.
ENDIF
CASE(2)
IF (XB(1)>=XF .OR. XB(2)<=XS .OR. XB(5)>=ZF .OR. XB(6)<=ZS) THEN
CULL_SLICE = .TRUE.
ELSE
IF (XB(3)>YF .OR. XB(4)<YS) CULL_SLICE =.TRUE.
ENDIF
CASE(3)
IF (XB(1)>=XF .OR. XB(2)<=XS .OR. XB(3)>=YF .OR. XB(4)<=YS) THEN
CULL_SLICE = .TRUE.
ELSE
IF (XB(5)>ZF .OR. XB(6)<ZS) CULL_SLICE =.TRUE.
ENDIF
CASE DEFAULT
IF (XB(1)>XF .OR. XB(2)<XS .OR. XB(3)>YF .OR. XB(4)<YS .OR. XB(5)>ZF .OR. XB(6)<ZS) CULL_SLICE = .TRUE.
END SELECT
IF (CULL_SLICE) THEN
N_SLCF = N_SLCF - 1
IF (VECTOR .AND. TWO_D) N_SLCF = N_SLCF - 2
IF (VECTOR .AND. .NOT. TWO_D) N_SLCF = N_SLCF - 3
CYCLE SLCF_LOOP
ENDIF

! Process vector quantities

NITER = 1
Expand Down

0 comments on commit 719a972

Please sign in to comment.