Skip to content

Commit db24f6f

Browse files
authored
a bit more cleaning / emphasis in the integrator docs (#1568)
1 parent 0cc5a37 commit db24f6f

File tree

1 file changed

+45
-26
lines changed

1 file changed

+45
-26
lines changed

sphinx_docs/source/integrators.rst

+45-26
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Reaction ODE System
33
*******************
44

5-
.. note::
5+
.. important::
66

77
This describes the integration done when doing Strang operator-splitting, which is the
88
default mode of coupling burning to application codes.
@@ -122,6 +122,8 @@ The overall flow of the integrator is (using VODE as the example):
122122

123123
#. normalize the abundances so they sum to 1.
124124

125+
.. index:: integrator.subtract_internal_energy
126+
125127
.. note::
126128

127129
Upon exit, ``burn_t burn_state.e`` is the energy *released* during
@@ -134,7 +136,7 @@ The overall flow of the integrator is (using VODE as the example):
134136
Network Routines
135137
----------------
136138

137-
.. note::
139+
.. important::
138140

139141
Microphysics integrates the reaction system in terms of mass
140142
fractions, :math:`X_k`, but most astrophysical networks use molar
@@ -179,7 +181,7 @@ be computed as:
179181
y(i) = state.xn[i-1] * aion_inv[i-1];
180182
}
181183

182-
.. note::
184+
.. warning::
183185

184186
We use 1-based indexing for ``ydot`` for legacy reasons, so watch out when filling in
185187
this array based on 0-indexed C arrays.
@@ -227,8 +229,17 @@ flow is (for VODE):
227229
Jacobian implementation
228230
^^^^^^^^^^^^^^^^^^^^^^^
229231

230-
The Jacobian is provided by ``actual_jac(state, jac)``, and takes the
231-
form:
232+
.. index:: integrator.jacobian
233+
234+
Either an analytic or numerical Jacobian is used for the implicit
235+
integrators, selected via the ``integrator.jacobian`` runtime
236+
parameter (``1`` = analytic; ``2`` = numerical). For VODE, the
237+
numerical Jacobian is computed internally. For the other integrators,
238+
a difference method is implemented in
239+
``integration/utils/numerical_jacobian.H``.
240+
241+
The analytic Jacobian is specific to each network and is provided by
242+
``actual_jac(state, jac)``. It takes the form:
232243

233244
.. code-block:: c++
234245

@@ -260,10 +271,11 @@ The form looks like:
260271
\end{matrix}
261272
\right )
262273
263-
Note: a network is not required to compute a Jacobian if a numerical
264-
Jacobian is used. This is set with the runtime parameter
265-
``jacobian`` = 2, and implemented directly in VODE or via
266-
``integration/utils/numerical_jacobian.H`` for other integrators.
274+
.. note::
275+
276+
A network is not required to provide a Jacobian if a numerical
277+
Jacobian is used.
278+
267279

268280
Jacobian wrapper
269281
^^^^^^^^^^^^^^^^
@@ -279,13 +291,15 @@ flow is (for VODE):
279291
wrapper above which did the ``clean_state`` and
280292
``update_thermodynamics`` calls.
281293

282-
#. call ``integrator_to_burn`` to update the ``burn_t``
294+
.. index:: integrator.react_boost
295+
296+
#. call ``integrator_to_burn()`` to update the ``burn_t``
283297

284298
#. call ``actual_jac()`` to have the network fill the Jacobian array
285299

286300
#. convert the derivative to be mass-fraction-based
287301

288-
#. apply any boosting to the rates if ``react_boost`` > 0
302+
#. apply any boosting to the rates if ``integrator.react_boost`` > 0
289303

290304

291305

@@ -295,38 +309,43 @@ Thermodynamics and :math:`e` Evolution
295309
======================================
296310

297311
The thermodynamic equation in our system is the evolution of the internal energy,
298-
:math:`e`. (Note: when the system is integrated in an operator-split approach,
299-
this responds only to the nuclear energy release and not pdV work.)
312+
:math:`e`.
313+
314+
.. note::
315+
316+
When the system is integrated in an operator-split approach, the
317+
energy equation accounts for only the nuclear energy release and
318+
not pdV work.
300319

301320
At initialization, :math:`e` is set to the value from the EOS consistent
302321
with the initial temperature, density, and composition:
303322

304-
.. math:: e_0 = e(\rho_0, T_0, {X_k}_0)
323+
.. math::
324+
325+
e_0 = e(\rho_0, T_0, {X_k}_0)
305326
306-
In the integration routines, this is termed the energy offset.
327+
In the integration routines, this is termed the *energy offset*.
307328

308329
As the system is integrated, :math:`e` is updated to account for the
309330
nuclear energy release,
310331

311332
.. math:: e(t) = e_0 + \int_{t_0}^t f(\dot{Y}_k) dt
312333

313-
Upon exit, we subtract off this initial offset, so ``state.e`` in
334+
As noted above, upon exit, we subtract off this initial offset, so ``state.e`` in
314335
the returned ``burn_t`` type from the ``actual_integrator``
315336
call represents the energy *release* during the burn.
316337

317338
Integration of Equation :eq:`eq:enuc_integrate`
318339
requires an evaluation of the temperature at each integration step
319340
(since the RHS for the species is given in terms of :math:`T`, not :math:`e`).
320341
This involves an EOS call and is the default behavior of the integration.
321-
322-
If desired, the EOS call can be skipped and the temperature kept
323-
frozen over the entire time interval of the integration. This is done
324-
by setting ``integrator.call_eos_in_rhs = 0``.
325-
326342
Note also that for the Jacobian, we need the specific heat, :math:`c_v`, since we
327343
usually calculate derivatives with respect to temperature (as this is the form
328-
the rates are commonly provided in). We use the specific heat at constant volume
329-
because it is most consistent with the operator split methodology we use (density
330-
is held constant during the burn when doing Strang splitting).
331-
Similar to temperature, this will automatically be updated at each integration
332-
step (unless you set ``integrator.call_eos_in_rhs = 0``).
344+
the rates are commonly provided in).
345+
346+
.. index:: integrator.call_eos_in_rhs
347+
348+
.. note::
349+
350+
If desired, the EOS call can be skipped and the temperature and $c_v$ kept
351+
frozen over the entire time interval of the integration by setting ``integrator.call_eos_in_rhs=0``.

0 commit comments

Comments
 (0)