Skip to content

Commit aa71c7a

Browse files
committed
FireX: Merge with firemodels/master
2 parents ae92430 + 5780431 commit aa71c7a

17 files changed

+106
-81
lines changed

Build/Scripts/HYPRE/build_hypre.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
set LIB_TAG=v2.33.0
2+
set LIB_TAG=v3.0.0
33

44
::*** library and tag name are the same
55

Build/Scripts/HYPRE/build_hypre.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
HYPRE_LIB_TAG=v2.33.0
2+
HYPRE_LIB_TAG=v3.0.0
33

44
CONFMAKE=$1
55
CLEAN_HYPRE=$2
@@ -14,10 +14,10 @@ fi
1414

1515
echo "Checking for hypre library..."
1616

17-
if [ -d "$FIREMODELS/libs/hypre" ]; then
17+
if [ -d "$FIREMODELS/libs/hypre/$HYPRE_LIB_TAG" ]; then
1818
echo "Hypre library exists. Skipping hypre build."
1919
# List all directories under $FIREMODELS/libs/hypre
20-
hypre_lib_dir=$(ls -d $FIREMODELS/libs/hypre/*/)
20+
hypre_lib_dir=$(ls -d $FIREMODELS/libs/hypre/$HYPRE_LIB_TAG/)
2121
# Extract the version part (removes the leading path)
2222
HYPRE_VERSION=$(basename $hypre_lib_dir)
2323
export HYPRE_HOME=$FIREMODELS/libs/hypre/$HYPRE_VERSION

Build/Scripts/SUNDIALS/build_sundials.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
set LIB_TAG=v6.7.0
2+
set LIB_TAG=v7.5.0
33

44
::*** library and tag name are the same
55

@@ -123,8 +123,8 @@ cmake ..\ ^
123123
-DBUILD_SHARED_LIBS=OFF ^
124124
-DCMAKE_INSTALL_LIBDIR="lib" ^
125125
-DCMAKE_MAKE_PROGRAM="%CMAKE_MAKE_PROGRAM%" ^
126-
-DCMAKE_C_FLAGS_RELEASE="${CMAKE_C_FLAGS_RELEASE} /MT" ^
127-
-DCMAKE_C_FLAGS_DEBUG="${CMAKE_C_FLAGS_DEBUG} /MTd"
126+
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" ^
127+
-DSUNDIALS_LOGGING_LEVEL=0
128128

129129
::*** build and install sundials
130130

Build/Scripts/SUNDIALS/build_sundials.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
SUNDIALS_LIB_TAG=v6.7.0
2+
SUNDIALS_LIB_TAG=v7.5.0
33

44
CONFMAKE=$1
55
CLEAN_SUNDIALS=$2
@@ -15,10 +15,10 @@ fi
1515

1616
echo "Checking for sundials library..."
1717

18-
if [ -d "$FIREMODELS/libs/sundials" ]; then
18+
if [ -d "$FIREMODELS/libs/sundials/$SUNDIALS_LIB_TAG" ]; then
1919
echo "Sundials library exists. Skipping sundials build."
2020
# List all directories under $FIREMODELS/libs/sundials
21-
sundials_lib_dir=$(ls -d $FIREMODELS/libs/sundials/*/)
21+
sundials_lib_dir=$(ls -d $FIREMODELS/libs/sundials/$SUNDIALS_LIB_TAG/)
2222
# Extract the version part (removes the leading path)
2323
SUNDIALS_VERSION=$(basename $sundials_lib_dir)
2424
export SUNDIALS_HOME=$FIREMODELS/libs/sundials/$SUNDIALS_VERSION
@@ -47,7 +47,6 @@ if [ -d "$FIREMODELS/sundials" ]; then
4747
else
4848
echo "Your SUNDIALS repository is not up to date with the required tag: $SUNDIALS_LIB_TAG."
4949
echo "The FDS build requires SUNDIALS version $SUNDIALS_LIB_TAG. Please update your SUNDIALS repository."
50-
exit 1
5150
fi
5251
mkdir $FIREMODELS/sundials/BUILDDIR
5352
cd $FIREMODELS/sundials/BUILDDIR

Build/Scripts/SUNDIALS/confmake.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ cmake_args=(
1212
-DEXAMPLES_ENABLE_F2003=OFF
1313
-DENABLE_OPENMP=OFF
1414
-DCMAKE_INSTALL_LIBDIR="lib"
15+
-DSUNDIALS_LOGGING_LEVEL=0
1516
)
1617

1718
# Add OSX deployment target if building for macOS

Build/Scripts/set_compilers.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ else # Default to GNU compilers
7272
select_compiler_from_system COMP_FC mpifort
7373
fi
7474

75-
echo "Thirdparty libs C Compiler COMP_CC=$COMP_CC"
76-
echo "Thirdparty libs C++ compiler COMP_CXX=$COMP_CXX"
77-
echo "Firemodels and Thirdparty libs Fortran compiler COMP_FC=$COMP_FC"
75+
echo "Third party libs C Compiler COMP_CC=$COMP_CC"
76+
echo "Third party libs C++ compiler COMP_CXX=$COMP_CXX"
77+
echo "Firemodels and third party libs Fortran compiler COMP_FC=$COMP_FC"
7878

7979
export COMP_CC=$COMP_CC
8080
export COMP_CXX=$COMP_CXX

Build/makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111

1212
VPATH = ../Source
1313

14-
# 3rd part library versions
15-
HYPRE_VERSION=v2.33.0
16-
SUNDIALS_VERSION=v6.7.0
14+
HYPRE_VERSION=v3.0.0
15+
SUNDIALS_VERSION=v7.5.0
1716
HDF5_VERSION=v1.14.5
1817

1918
ifeq ($(shell echo "check_quotes"),"check_quotes")
@@ -115,8 +114,8 @@ endif # MKLROOT test
115114
ifdef SUNDIALS_HOME # This assumes the SUNDIALS library is available.
116115
FFLAGS_SUNDIALS = -DWITH_SUNDIALS ${SUNDIALS_INFO} -I"${SUNDIALS_HOME}/fortran"
117116
FFLAGS_SUNDIALS_WIN = -DWITH_SUNDIALS ${SUNDIALS_INFO} /I"${SUNDIALS_HOME}\fortran"
118-
LFLAGS_SUNDIALS = ${SUNDIALS_HOME}/lib/libsundials_fcvode_mod.a ${SUNDIALS_HOME}/lib/libsundials_fnvecserial_mod.a ${SUNDIALS_HOME}/lib/libsundials_cvode.a
119-
LFLAGS_SUNDIALS_WIN = ${SUNDIALS_HOME}\lib\sundials_fcvode_mod.lib ${SUNDIALS_HOME}\lib\sundials_fnvecserial_mod.lib ${SUNDIALS_HOME}\lib\sundials_cvode.lib
117+
LFLAGS_SUNDIALS = ${SUNDIALS_HOME}/lib/libsundials_fcvode_mod.a ${SUNDIALS_HOME}/lib/libsundials_fnvecserial_mod.a ${SUNDIALS_HOME}/lib/libsundials_cvode.a ${SUNDIALS_HOME}/lib/libsundials_fcore_mod.a ${SUNDIALS_HOME}/lib/libsundials_core.a
118+
LFLAGS_SUNDIALS_WIN = ${SUNDIALS_HOME}\lib\sundials_fcvode_mod_static.lib ${SUNDIALS_HOME}\lib\sundials_fnvecserial_mod_static.lib ${SUNDIALS_HOME}\lib\sundials_cvode_static.lib ${SUNDIALS_HOME}\lib\sundials_fcore_mod.lib ${SUNDIALS_HOME}\lib\sundials_core_static.lib /link /NODEFAULTLIB:MSVCRTD /NODEFAULTLIB:libcmtd.lib
120119
endif
121120

122121
ifdef HYPRE_HOME # This assumes the HYPRE library is available.

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ if(USE_HYPRE OR USE_HYPRE_NVIDIA OR USE_HYPRE_AMDGPU OR USE_HYPRE_INTELGPU)
157157
include(FetchContent)
158158
# As we are not using the system hypre, we need to choose the version we
159159
# want
160-
set(HYPRE_GIT_VERSION "v2.32.0-24-63331f19c" )
160+
set(HYPRE_GIT_VERSION "3.0.0" )
161161
FetchContent_Declare(
162162
HYPRE
163163
GIT_REPOSITORY https://github.com/hypre-space/hypre.git
@@ -216,7 +216,7 @@ if(USE_SUNDIALS)
216216
include(FetchContent)
217217
# As we are not using the system sundials, we need to choose the version
218218
# we want
219-
set(SUNDIALS_GIT_VERSION "6.7.0")
219+
set(SUNDIALS_GIT_VERSION "7.5.0")
220220
FetchContent_Declare(
221221
SUNDIALS
222222
GIT_REPOSITORY https://github.com/LLNL/sundials.git

Manuals/FDS_Technical_Reference_Guide/Equation_Chapter.tex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ \section{Mass and Species Transport}
149149
\be \dod{\rho}{t} + \nabla\!\cdot (\rho \bu) = \dm_{\rm b}''' \label{mass} \ee
150150
because $\sum Z_\alpha=1$ and $\sum \dm_\alpha''' = 0$ and $\sum \dm_{\rm b,\alpha}'''=\dm_{\rm b}'''$, by definition, and because it is assumed that $\sum \rho D_\alpha \nabla Z_\alpha = 0$. This last assertion is not true, in general. The diffusive flux for the most abundant local species is corrected to enforce the constraint.
151151

152-
153-
154-
155152
\paragraph{Enforcing Realizability} ~\\
156153

157154
\noindent Realizability of species mass fractions requires $Y_\alpha \ge 0$ for all $\alpha$ and $\sum Y_\alpha = 1$. Note that this is more restrictive than the boundedness constraint, which simply requires $0 \le Y_\alpha \le 1$.
@@ -160,6 +157,10 @@ \section{Mass and Species Transport}
160157

161158
With this approach we must take care to ensure $\sum \rho D_\alpha \nabla Z_\alpha = 0$. Our strategy is to absorb any errors in diffusive transport into the most abundant species \emph{locally}. That is, for a given cell face we set $\rho D_m \nabla Z_m = -\sum_{\alpha\ne m} \rho D_\alpha \nabla Z_\alpha$, where $m$ is the most abundant species adjacent to that face. Note that since FDS is typically used as an LES code mass transport by molecular diffusion may be two or three orders of magnitude less than turbulent transport, which uses the same turbulent diffusion coefficient for all species. Therefore, the errors in summation of the diffusive fluxes tend to be small.
162159

160+
\paragraph{Enforcing the Equation of State} ~\\
161+
162+
\noindent Given the strategy of solving $N_s$ transport equations and obtaining $\rho = \sum_{\alpha=1}^{N_s} (\rho Y)_\alpha$ to enforce realizability, we must take care to ensure that we maintain the equation of state at cell faces after flux limited interpolation. In Sec.~\ref{sec_flux_limiters}, we describe a correction scheme that enforces the equation of state at cell faces and thus maintains isothermal flows for multi-component mixtures with variable molecular weights.
163+
163164
\section{Low Mach Number Approximation}
164165

165166
For low speed applications like fire, Rehm and Baum~\cite{Rehm:1} observed that the spatially and temporally resolved pressure, $p$, can be decomposed into a ``background'' pressure, $\bp(z,t)$, plus a perturbation, $\tp(x,y,z,t)$, with only the background pressure retained in the equation of state (ideal gas law):

Manuals/FDS_Technical_Reference_Guide/Mass_Chapter.tex

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ \subsection{Flux Limiters}
7878

7979
For uniform flow velocity, a fundamental property of the exact solution to the equations governing scalar transport is that the total variation of the scalar field (the sum of the absolute values of the scalar differences between neighboring cells) is either preserved or diminished (never increased). In other words, no new extrema are created. Numerical schemes which preserve this property are referred to as total variation diminishing (TVD) schemes. The practical importance of using a TVD scheme for fire modeling is that such a scheme is able to accurately track coherent vortex structure in turbulent flames and does not develop spurious reaction zones.
8080

81-
FDS employs two second-order TVD schemes as options for scalar transport: Superbee and CHARM. Superbee \cite{Roe:1986} is recommended for LES because it more accurately preserves the scalar variance for coarse grid solutions that are not expected to be smooth. Due to the gradient steepening applied in Superbee, however, the convergence degrades at small grid spacing for smooth solutions (the method will revert to a stair-step pattern instead of the exact solution). CHARM \cite{Zhou:1995}, though slightly more dissipative than Superbee, is convergent, and is therefore the better choice for DNS calculations where the flame front is well resolved.
81+
FDS employs two second-order TVD schemes as options for scalar transport: Superbee and CHARM. Superbee \cite{Roe:1986} is recommended for VLES because it more accurately preserves the scalar variance for coarse grid solutions that are not expected to be smooth. Due to the gradient steepening applied in Superbee, however, the convergence degrades at small grid spacing for smooth solutions (the method will revert to a stair-step pattern instead of the exact solution). CHARM \cite{Zhou:1995}, though slightly more dissipative than Superbee, is convergent, and is therefore the better choice for LES and DNS calculations.
8282

8383
To illustrate how flux limiters are applied to the scalar transport equations, below we discretize the advection terms in Eq.~(\ref{species}) in one dimension:
8484
\be \frac{(\rho Z)_{i}^* - (\rho Z)_{i}^n}{\dt}
@@ -94,12 +94,12 @@ \subsection{Flux Limiters}
9494
\begin{table}[H]
9595
\begin{center}
9696
\begin{tabular}{lc}
97-
Flux Limiter & $B(r)$ \\
97+
Flux Limiter & $B(r)$ \\
9898
\hline
99-
Central Difference & 1 \\
100-
Godunov & 0 \\
101-
Superbee \cite{Roe:1986} (LES default) & $\max(0,\min(2r,1),\min(r,2))$ \\
102-
CHARM \cite{Zhou:1995} (DNS default) & $s(3s+1)/(s+1)^2$; $s=1/r$ \\
99+
Central Difference & 1 \\
100+
Godunov & 0 \\
101+
Superbee \cite{Roe:1986} (VLES default) & $\max(0,\min(2r,1),\min(r,2))$ \\
102+
CHARM \cite{Zhou:1995} (LES and DNS default) & $s(3s+1)/(s+1)^2$; $s=1/r$ \\
103103
\end{tabular}
104104
\end{center}
105105
\end{table}
@@ -123,21 +123,38 @@ \subsubsection{Notes on Implementation}
123123

124124
The Central Difference and Godunov limiters are included for completeness, debugging, and educational purposes. These schemes have little utility for typical FDS applications.
125125

126-
% \subsubsection{Dealing with Variable Molecular Weights}
126+
\subsubsection{Dealing with Variable Molecular Weights}
127127

128-
%% leave this here for a moment as a reminder to write up the constant limiter coefficient method we are now using.
128+
Handling multi-component mixtures with variable molecular weights requires special care when constructing fluxes, otherwise we may violate the equation of state. The problem is easiest to illustrate by considering an isothermal (not necessarily constant density) flow. Maintaining isothermal flow requires
129+
\begin{equation}
130+
T = \frac{\overline{W} \bar{p}}{\rho R} = \frac{\bar{p}}{R \rho \sum_\alpha \frac{Z_\alpha}{W_\alpha}} = \frac{\bar{p}}{R \sum_\alpha \frac{\rho Z_\alpha}{W_\alpha}}
131+
\end{equation}
132+
to be constant and uniform at all cells and faces. Therefore, with $\bar{p}$ and $R$ constant and uniform, we must maintain
133+
\begin{equation}
134+
\label{eq:rho_mw}
135+
\sum_\alpha \frac{(\rho Z_\alpha)}{W_\alpha} = \frac{\rho}{\overline{W}}
136+
\end{equation}
137+
The above condition is automatically satisfied in the cases of using Godunov or Central differencing or in the case of binary flow (two species). However, if we apply a second-order flux limiter, such as Superbee or CHARM, independently to each species in a multi-component (three or more species) flow with variable molecular weights, then this condition is easily violated at a cell face.
138+
139+
For example, consider the case of a multi-component, constant density flow. A flux limited face value for species $\alpha$ is a sum of the values in adjacent cells times a coefficient $c_{i,\alpha}$ for each cell $i$. At a face we require have $\sum_\alpha \sum_i c_{i,\alpha} (\rho Z_\alpha)_i = \rho = \mbox{constant}$. The only way to guarantee $\rho$ is constant is if the $c_{i,\alpha}$ are the same for each $\alpha$, that is, $c_{i,\alpha} = c_i$. Rearranging then gives $\sum_i c_i \sum_\alpha (\rho Z_\alpha)_i = \sum_i c_i \rho_i = \rho$, which just says that we need to obey the constraint $\sum_i c_i = 1$, which is true by construction of the limiter.
129140

130-
% Maintaining isothermal flow requires
131-
% \begin{equation}
132-
% T = \frac{\overline{W} \bar{p}}{\rho R} = \frac{\bar{p}}{R \rho \sum_\alpha \frac{Z_\alpha}{W_\alpha}} = \frac{\bar{p}}{R \sum_\alpha \frac{\rho Z_\alpha}{W_\alpha}}
133-
% \end{equation}
134-
% to be constant and uniform at all cells and faces. Therefore, with $\bar{p}$ and $R$ constant and uniform, we must maintain
135-
% \begin{equation}
136-
% \label{eq:rho_mw}
137-
% \sum_\alpha \frac{(\rho Z_\alpha)}{W_\alpha} = \frac{\rho}{\overline{W}}
138-
% \end{equation}
141+
As mentioned above, constant limiter coefficients are only possible with simple schemes like Godunov (low order) or central (not TVD). In practice, applying a second-order limiter to all species independently and then taking the worst case also reduces to a low order scheme. Therefore, it is important to maintain the independent second-order limiters for the individual species. An algorithm to achieve this goal and satisfy the equation of state is described next.
139142

140-
% The above condition is automatically satisfied in the cases of using Godunov or Central differencing or in the case of binary flow (two species). However, if we apply a second-order flux limiter, such as Superbee or CHARM, independently to each species in a multi-component (three or more species) flow with variable molecular weights, then this condition is easily violated.
143+
\subsubsection{Molecular Weight Correction Algorithm}
144+
145+
Whether the flow is isothermal or not, satisfying Eq.~(\ref{eq:rho_mw}) is required to obey the equation of state. The scheme introduced here uses a flux limiter to find a face value of $\rho/\overline{W}$ and then corrects the most abundant species face density to satisfy Eq.~(\ref{eq:rho_mw}).
146+
147+
The following algorithm computes flux-limited species face densities for multi-component mixtures with variable molecular weights and preserves the equation of state, Eq.~(\ref{eq:rho_mw}), at cell faces. For simplicity, the following considers a 1-D domain with cell face between cells $i$ and $i+1$.
148+
\begin{enumerate}
149+
\item Compute flux limited face values as usual, $\overline{(\rho Z_\alpha)}^{FL}_{i+1/2}$, for $\alpha=1..N_s$.
150+
\item Also, for each face, determine the {\tt maxloc} of the flux-limited $\overline{(\rho Z_\alpha)}^{FL}_{i+1/2}$ (the most abundant species on the face) and call it $\gamma$. We will absorb the error into this species.
151+
\item For each cell, compute $\displaystyle \frac{\rho}{\overline{W}}$ from Eq.~(\ref{eq:rho_mw}).
152+
\item For each cell face, compute $\displaystyle \overline{\left(\frac{\rho}{\overline{W}}\right)}^{FL}_{i+1/2}$.
153+
\item Last, determine the face component density for $\gamma$ as
154+
\begin{equation}
155+
\overline{(\rho Z_\gamma)}^{FL}_{i+1/2} = W_\gamma \left[\overline{\left(\frac{\rho}{\overline{W}}\right)}^{FL}_{i+1/2} - \sum_{\alpha\ne\gamma} \frac{\overline{(\rho Z_{\alpha})}^{FL}_{i+1/2}}{W_\alpha} \right]
156+
\end{equation}
157+
\end{enumerate}
141158

142159

143160
\subsection{Time Splitting for Mass Source Terms}

0 commit comments

Comments
 (0)