|
| 1 | +.. _sec:burn_cell_sdc: |
| 2 | + |
| 3 | +***************** |
| 4 | +``burn_cell_sdc`` |
| 5 | +***************** |
| 6 | + |
| 7 | +.. index:: burn_cell_sdc |
| 8 | + |
| 9 | +``burn_cell_sdc`` is a simple one-zone burn analogous to :ref:`sec:burn_cell` that |
| 10 | +exercises the simplified-SDC code paths in the integrator. |
| 11 | +The system that is evolved |
| 12 | +has the form: |
| 13 | + |
| 14 | +.. math:: |
| 15 | +
|
| 16 | + \begin{align*} |
| 17 | + \frac{d(\rho X_k)}{dt} &= \Adv{\rho X_k}^{n+1/2} + \rho \dot{\omega}_k(\rho, X_k, T) \\ |
| 18 | + \frac{d(\rho e)}{dt} &= \Adv{\rho e}^{n+1/2} + \rho \epsilon(\rho, X_k, T) |
| 19 | + \end{align*} |
| 20 | +
|
| 21 | +with density constructed as needed via: |
| 22 | + |
| 23 | +$$\rho(t) = \rho^n + \Adv{\rho}^{n+1/2} (t - t^n)$$ |
| 24 | + |
| 25 | +In this system, we now need to specify the advective terms for the unit test. |
| 26 | + |
| 27 | +.. note:: |
| 28 | + |
| 29 | + This test can also be used with NSE to test how the integration |
| 30 | + bails out into NSE if the ``in_nse()`` test is true. |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +Getting Started |
| 36 | +=============== |
| 37 | + |
| 38 | +The ``burn_cell_sdc`` code is located in |
| 39 | +``Microphysics/unit_test/burn_cell_sdc``. By default, ``USE_SIMPLIFIED_SDC=TRUE`` |
| 40 | +is set in the ``GNUmakefile``. |
| 41 | + |
| 42 | + |
| 43 | +Setting the thermodynamics |
| 44 | +-------------------------- |
| 45 | + |
| 46 | +The parameters that affect the thermodynamics are: |
| 47 | + |
| 48 | +* ``unit_test.density`` : the initial density |
| 49 | + |
| 50 | +* ``unit_test.temperature`` : the initial temperature |
| 51 | + |
| 52 | +* ``unit_test.rhoe`` : the initial $(rho e)$. If this is not set (or |
| 53 | + set to be $< 0$), then it will be computed from the temperature |
| 54 | + using the EOS. |
| 55 | + |
| 56 | +The composition can be set either by specifying individual mass fractions |
| 57 | +or setting ``unit_test.uniform_xn`` as described in :ref:`sec:defining_unit_test_composition`. |
| 58 | + |
| 59 | +Aux composition |
| 60 | +--------------- |
| 61 | + |
| 62 | +When built with ``USE_NSE_TABLE=TRUE`` (see :ref:`tabulated_nse`) or with |
| 63 | +``USE_AUX_THERMO=TRUE`` (see :ref:`aux_eos_comp`) then the auxiliary |
| 64 | +composition, $Y_e$, $\bar{A}$, $\langle |
| 65 | +B/A\rangle$, is defined. |
| 66 | + |
| 67 | +The auxiliary composition can either be initialized directly via |
| 68 | +``unit_test.Aux1``, ``unit_test.Aux2``, and ``unit_test.Aux3``, or |
| 69 | +their values can be computed at initialization from the mass fractions |
| 70 | +if ``unit_test.recompute_aux=1`` is set. |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +Advective terms |
| 75 | +--------------- |
| 76 | + |
| 77 | +But default, the advective terms are set to zero. In this mode, |
| 78 | +``burn_cell_sdc`` largely mimics ``burn_cell`` (although with a |
| 79 | +slightly different ODE system integrated). |
| 80 | + |
| 81 | +The advective terms can be set manually via |
| 82 | + |
| 83 | +* ``unit_test.Adv_rho`` : $\Adv{\rho}^{n+1/2}$ |
| 84 | +* ``unit_test.Adv_rhoe`` : $\Adv{\rho e}^{n+1/2}$ |
| 85 | +* ``unit_test.Adv_X1``, ``unit_test.Adv_X2``, ... : $\Adv{\rho X_1}^{n+1/2}$, $\Adv{\rho X_2}^{n+1/2}$, ... (up to $X_{35}$) |
| 86 | +* ``unit_test.Adv_Aux1``, ``unit_test.Adv_Aux2``, ``unit_test.Adv_Aux3`` : $\Adv{\rho \alpha_1}^{n+1/2}$, $\Adv{\rho \alpha_2}^{n+1/2}$, $\Adv{\rho \alpha_3}^{n+1/2}$ |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +Controlling time |
| 92 | +---------------- |
| 93 | + |
| 94 | +The integration time and output frequency are controlled by the |
| 95 | +same set of parameters as in ``burn_cell``. see :ref:`sec:burn_cell_time`. |
| 96 | + |
| 97 | + |
| 98 | +Integration parameters |
| 99 | +---------------------- |
| 100 | + |
| 101 | +The tolerances, choice of Jacobian, and other integration parameters |
| 102 | +can be set via the usual Microphysics runtime parameters, e.g. |
| 103 | +``integrator.atol_spec``. |
| 104 | + |
| 105 | + |
| 106 | +Rerunning a burn fail |
| 107 | +--------------------- |
| 108 | + |
| 109 | +.. index:: parse_integration_failure.py, USE_GPU_PRINTF |
| 110 | + |
| 111 | +When a network integration encounters a failure, it will output the |
| 112 | +entire burn state to ``stdout`` (for GPU builds, this needs to be |
| 113 | +enabled explicitly by building with ``USE_GPU_PRINTF``). |
| 114 | + |
| 115 | +The script ``unit_test/burn_cell_sdc/parse_integration_failure.py`` |
| 116 | +can be used to parse the output (copy and paste the full error into a |
| 117 | +file) and produce the runtime parameter settings needed to reproduce |
| 118 | +the burn. This is especially important with SDC, since it will contain |
| 119 | +all of the advective terms. |
| 120 | + |
| 121 | + |
| 122 | +Building and Running the Code |
| 123 | +============================= |
| 124 | + |
| 125 | +The code can be built simply as: |
| 126 | + |
| 127 | +.. prompt:: bash |
| 128 | + |
| 129 | + make |
| 130 | + |
| 131 | +and the network and integrator can be changed using the normal |
| 132 | +Microphysics build system parameters. |
| 133 | + |
| 134 | +.. important:: |
| 135 | + |
| 136 | + You need to do a ``make clean`` before rebuilding with a different |
| 137 | + network or integrator. |
| 138 | + |
| 139 | + |
| 140 | +To run the code, in the ``burn_cell_sdc`` directory run:: |
| 141 | + |
| 142 | + ./main3d.gnu.ex inputs |
| 143 | + |
| 144 | +where ``inputs`` is the name of your inputs file. |
0 commit comments