2
2
Reaction ODE System
3
3
*******************
4
4
5
- .. note ::
5
+ .. important ::
6
6
7
7
This describes the integration done when doing Strang operator-splitting, which is the
8
8
default mode of coupling burning to application codes.
@@ -122,6 +122,8 @@ The overall flow of the integrator is (using VODE as the example):
122
122
123
123
#. normalize the abundances so they sum to 1.
124
124
125
+ .. index :: integrator.subtract_internal_energy
126
+
125
127
.. note ::
126
128
127
129
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):
134
136
Network Routines
135
137
----------------
136
138
137
- .. note ::
139
+ .. important ::
138
140
139
141
Microphysics integrates the reaction system in terms of mass
140
142
fractions, :math: `X_k`, but most astrophysical networks use molar
@@ -179,7 +181,7 @@ be computed as:
179
181
y(i) = state.xn[i-1] * aion_inv[i-1];
180
182
}
181
183
182
- .. note ::
184
+ .. warning ::
183
185
184
186
We use 1-based indexing for ``ydot `` for legacy reasons, so watch out when filling in
185
187
this array based on 0-indexed C arrays.
@@ -227,8 +229,17 @@ flow is (for VODE):
227
229
Jacobian implementation
228
230
^^^^^^^^^^^^^^^^^^^^^^^
229
231
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:
232
243
233
244
.. code-block :: c++
234
245
@@ -260,10 +271,11 @@ The form looks like:
260
271
\end {matrix}
261
272
\right )
262
273
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
+
267
279
268
280
Jacobian wrapper
269
281
^^^^^^^^^^^^^^^^
@@ -279,13 +291,15 @@ flow is (for VODE):
279
291
wrapper above which did the ``clean_state `` and
280
292
``update_thermodynamics `` calls.
281
293
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 ``
283
297
284
298
#. call ``actual_jac() `` to have the network fill the Jacobian array
285
299
286
300
#. convert the derivative to be mass-fraction-based
287
301
288
- #. apply any boosting to the rates if ``react_boost `` > 0
302
+ #. apply any boosting to the rates if ``integrator. react_boost `` > 0
289
303
290
304
291
305
@@ -295,38 +309,43 @@ Thermodynamics and :math:`e` Evolution
295
309
======================================
296
310
297
311
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.
300
319
301
320
At initialization, :math: `e` is set to the value from the EOS consistent
302
321
with the initial temperature, density, and composition:
303
322
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 )
305
326
306
- In the integration routines, this is termed the “ energy offset” .
327
+ In the integration routines, this is termed the * energy offset * .
307
328
308
329
As the system is integrated, :math: `e` is updated to account for the
309
330
nuclear energy release,
310
331
311
332
.. math :: e(t) = e_0 + \int_{t_0}^t f(\dot{Y}_k) dt
312
333
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
314
335
the returned ``burn_t `` type from the ``actual_integrator ``
315
336
call represents the energy *release * during the burn.
316
337
317
338
Integration of Equation :eq: `eq:enuc_integrate `
318
339
requires an evaluation of the temperature at each integration step
319
340
(since the RHS for the species is given in terms of :math: `T`, not :math: `e`).
320
341
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
-
326
342
Note also that for the Jacobian, we need the specific heat, :math: `c_v`, since we
327
343
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