diff --git a/docs/source_docs/conf.py b/docs/source_docs/conf.py index 82aa9ba742cb265a3331558791c7690ba7944610..e4bbc5f011be06102d1e68748ad1790406511989 100644 --- a/docs/source_docs/conf.py +++ b/docs/source_docs/conf.py @@ -86,6 +86,9 @@ todo_include_todos = False numfig = True math_numfig = True +numfig_secnum_depth = 1 + +math_eqref_format = "Eq.{number}" bibtex_bibfiles = ['refs.bib'] diff --git a/docs/source_docs/index.rst b/docs/source_docs/index.rst index 939c4e9599d2af1f93f94b1293acdffbaeffbe96..b5be3101c893d972cd888964053df35b85be8ec7 100644 --- a/docs/source_docs/index.rst +++ b/docs/source_docs/index.rst @@ -81,6 +81,7 @@ and performance: test_benchmarks/CITests test_benchmarks/NightlyTests test_benchmarks/qualitative_bencharks/index + test_benchmarks/verification/index Notice ------ diff --git a/docs/source_docs/test_benchmarks/verification/chemistry/eulerian01.rst b/docs/source_docs/test_benchmarks/verification/chemistry/eulerian01.rst new file mode 100644 index 0000000000000000000000000000000000000000..0ceb3a1d0aab0e90d649081d9f9f6d39d6b02d4f --- /dev/null +++ b/docs/source_docs/test_benchmarks/verification/chemistry/eulerian01.rst @@ -0,0 +1,93 @@ +.. include:: ../../../definitions.rst + +Eulerian01: athermal, constant density +-------------------------------------- + +Description +~~~~~~~~~~~ + +Consider a system with a fluid comprised of two chemical species, :math:`A` and :math:`B`, with the transfer of species given by the reversible homogeneous reaction, + +.. math:: + :label: chem_eulerian01_eq01 + + A(g) \leftrightarrow B(g) + +If both species have the same molecular weight, specific heat, and enthalpy of formation, then the mixture molecular weight, system temperature, and density are constant. +The evolution of species mass in the absence of convection and diffusion is given by + +.. math:: + :label: chem_eulerian01_eq02 + + \rho\frac{\partial X_{A}}{\partial t} = \dot{\omega}_{A} + +where :math:`\rho` is density; +:math:`X_A` is the mass fraction of species :math:`A`; and +:math:`\dot{\omega}_{A}` is the net rate of production (consumption if negative) of species :math:`A`. + +A manufactured solution for species :math:`A` is + +.. math:: + :label: chem_eulerian01_eq03 + + X_A(t) = X_A^0 - \sin(6\pi t)/4 + +where :math:`X_A^0 = X_A(t=0)` is the initial mass fraction of species :math:`A`. Taking the derivative with respect to time, and substituting the result into :eq:`chem_eulerian01_eq02` gives + +.. math:: + :label: chem_eulerian01_eq04 + + \dot{\omega}_A = -\rho 3\pi \cos(6\pi t)/2 + +which has units of kg\ |cdot|\ m\ :math:`^{-3}`\ |cdot| sec\ :math:`^{-1}`. Two modifications are required to implement this Eulerian reaction rate into MFIX-Exa: + +- Eq. :eq:`chem_eulerian01_eq04` needs to be divided by the molecular weight of species A because Eulerian reaction rates in MFIX-Exa are provided in units of mol\ |cdot|\ m\ :math:`^{-3}`\ |cdot| sec\ :math:`^{-1}`. +- The negative sign is omitted because species :math:`A` is a reactant. Specifically, by inspection of chemical equation :eq:`chem_eulerian01_eq01`, species :math:`A` is a reactant when the rate is positive (forward reaction), and a product when the rate is negative (backward reaction). + +The resulting Eulerian reaction rate is + +.. math:: + :label: chem_eulerian01_eq54 + + R_A = \frac{\rho 3\pi \cos(6\pi t)}{2 M_A} + +Setup +~~~~~ + +The domain is a single cuboid cell with 0.0025 m edge length and convection and diffusion terms are set to zero for all governing equations. The fluid has a constant temperature of 300 K at 60,795 Pa, and the initial composition is :math:`X_A=X_B=0.5`. The density is chosen to be 2 kg\ |cdot|\ m\ :math:`^{-3}`; therefore, the component and mixture molecular weights are computed from the ideal gas law :math:`M=\rho RT / p_{therm} \approx 0.0821` kg\ |cdot|\ mol\ :math:`^{-1}`. + + +Results +~~~~~~~ + +The test is run at five fixed time-step sizes with a refinement factor of 2: 0.2, 0.1, 0.05, 0.025, 0.0125 milliseconds. The :math:`L_1`\ -norm is computed by dividing the sum of the absolute difference between the analytical and numerical solution over all time steps by the total number of time steps. + +.. math:: + + L_1 = \frac{\sum_n \| X_A(t_n) - X_A^{\mathrm{\texttt{MFIX-Exa}}}\|}{n} + + +Forward Euler +''''''''''''' + +The analytical solution and absolute error with dt = 0.2 msec are shown in :numref:`fig_chem_eulerian01_ForwardEuler_sol`. The :math:`L_1` norm is used to compute the observed order of accuracy shown in :numref:`fig_chem_eulerian01_ForwardEuler_ooa`. + + +.. _fig_chem_eulerian01_ForwardEuler_sol: + +.. figure:: ./images/eulerian01_ForwardEuler_solution.png + :width: 85% + :align: center + :alt: Eulerian01 test numerical solution and absolute error + + Numerical solution for species mass fraction and absolute error. + + +.. _fig_chem_eulerian01_ForwardEuler_ooa: + +.. figure:: ./images/eulerian01_ForwardEuler_accuracy.png + :width: 45% + :align: center + :alt: Eulerian01 test observed order + + Observed order of species mass fraction. diff --git a/docs/source_docs/test_benchmarks/verification/chemistry/images/eulerian01_ForwardEuler_accuracy.png b/docs/source_docs/test_benchmarks/verification/chemistry/images/eulerian01_ForwardEuler_accuracy.png new file mode 100644 index 0000000000000000000000000000000000000000..030b20f09a875e48c41589c9cc3beeda93f56eda Binary files /dev/null and b/docs/source_docs/test_benchmarks/verification/chemistry/images/eulerian01_ForwardEuler_accuracy.png differ diff --git a/docs/source_docs/test_benchmarks/verification/chemistry/images/eulerian01_ForwardEuler_solution.png b/docs/source_docs/test_benchmarks/verification/chemistry/images/eulerian01_ForwardEuler_solution.png new file mode 100644 index 0000000000000000000000000000000000000000..463c3bc37674932ac38c8d22b410d304b8c4110d Binary files /dev/null and b/docs/source_docs/test_benchmarks/verification/chemistry/images/eulerian01_ForwardEuler_solution.png differ diff --git a/docs/source_docs/test_benchmarks/verification/index.rst b/docs/source_docs/test_benchmarks/verification/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..6d96dde0d626fb6e96dbd031c09c3a82f1f08bd1 --- /dev/null +++ b/docs/source_docs/test_benchmarks/verification/index.rst @@ -0,0 +1,27 @@ +==================== +Chemistry code tests +==================== + +The test cases presented in this chapter for the MFIX fluid solver are summarized below. + +.. "Eulerian01", "C", "A", " ", " ", ":math:`{\checkmark}`" + + +.. |check| replace:: :math:`{\checkmark}` + ++-------------------+---------+---------+--------+-----------+---------+---------+---------+ +| Test | Freq\ † | Data\ ‡ | Phases | Momentum | Density | Species | Energy | ++===================+=========+=========+========+===========+=========+=========+=========+ +| Eulerian01 | C | A | Fluid | | |check| | | | ++-------------------+---------+---------+--------+-----------+---------+---------+---------+ + +† C-Incorporated into the continuous integration server; M-Monthly; Q-Quarterly; X-Manual; D-Disabled + +‡ A-Analytical solution; P-Published benchmark data; R-Regression data from previous code versions + +.. toctree:: + :numbered: + :caption: Validation and Verification + :maxdepth: 1 + + chemistry/eulerian01