Skip to content

Commit c0d6b77

Browse files
authored
Merge branch 'development' into linear_algebra_unit_test
2 parents d93f2d1 + 348dad9 commit c0d6b77

File tree

3 files changed

+102
-13
lines changed

3 files changed

+102
-13
lines changed

networks/rhs.H

-4
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,6 @@ constexpr int is_jacobian_term_used ()
272272
#endif
273273
}
274274

275-
typedef amrex::Array1D<int, 1, INT_NEQS> IArray1D;
276-
typedef amrex::Array1D<amrex::Real, 1, INT_NEQS> RArray1D;
277-
typedef ArrayUtil::MathArray2D<1, INT_NEQS, 1, INT_NEQS> RArray2D;
278-
279275
AMREX_GPU_HOST_DEVICE AMREX_INLINE
280276
void dgesl (RArray2D& a1, RArray1D& b1)
281277
{

sphinx_docs/source/mathsymbols.tex

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
\newcommand{\Sc}{\mathbf{S}}
102102
\newcommand{\Shydro}{{{\bf S}^{\mathrm{hydro}}}}
103103
\newcommand{\Rb}{{\bf R}}
104+
\newcommand{\Rbs}[1]{{\bf R} \left ( #1 \right )}
104105
\newcommand{\Rq}{{\bf R}}
105106
\newcommand{\Adv}[1]{{\left [\boldsymbol{\mathcal{A}} \left(#1\right)\right]}}
106107
\newcommand{\Advs}[1]{{\boldsymbol{\mathcal{A}} \left(#1\right)}}

sphinx_docs/source/sdc.rst

+101-9
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Spectral Deferred Corrections
55
Introduction
66
============
77

8-
The Simplified-SDC method provides a means to more strongly couple the
9-
reactions to the hydrodynamics by evolving the reactions together with
10-
an approximation of the advection over the timestep. The full details
11-
of the algorithm are presented in :cite:`castro_simple_sdc`.
8+
Spectral deferred correction (SDC) methods strongly couple reactions
9+
and hydrodynamics, eliminating the splitting error that arises with
10+
Strang (operator) splitting. Microphysics supports two different
11+
SDC formulations.
1212

1313
We want to solve the coupled equations:
1414

@@ -33,14 +33,100 @@ hydrodynamical sources),
3333
and :math:`\Rb(\Uc)`
3434
is the reaction source term.
3535

36+
37+
.. note::
38+
39+
Application codes can set the make variables ``USE_TRUE_SDC`` or
40+
``USE_SIMPLIFIED_SDC``. But in Microphysics, both SDC formulations
41+
are supported by the same integrators, and both of these options
42+
will set the ``SDC`` preprocessor flag.
43+
44+
"True" SDC
45+
----------
46+
47+
The true SDC implementation is described in :cite:`castro_sdc`. It divides
48+
the timestep into temporal nodes and uses low-order approximations to update
49+
from one temporal node to the next. Iteration is used to increase the order of accuracy.
50+
51+
The update from one temporal node, $m$, to the next, $m$, for iteration
52+
$k+1$ appears as:
53+
54+
.. math::
55+
56+
\begin{align*}
57+
\Uc^{m+1,(k+1)} = \Uc^{m,(k+1)}
58+
&+ \delta t_m\left[\Advs{\Uc^{m,(k+1)}} - \Advs{\Uc^{m,(k)}}\right] +\\
59+
&+ \delta t_m\left[\Rbs{\Uc^{m+1,(k+1)}} - \Rbs{\Uc^{m+1,(k)}}\right]\\
60+
&+ \int_{t^m}^{t^{m+1}}\Advs{\Uc^{(k)}} + \Rbs{\Uc^{(k)}}d\tau.
61+
\end{align*}
62+
63+
Solving this requires a nonlinear solve of:
64+
65+
.. math::
66+
67+
\Uc^{m+1,(k+1)} - \delta t_m \Rbs{\Uc}^{m+1,(k+1)} = \Uc^{m,(k+1)} + \delta t_m {\bf C}
68+
69+
where the right-hand side is constructed only from known states, and we
70+
define ${\bf C}$ for convenience as:
71+
72+
.. math::
73+
74+
\begin{align}
75+
{\bf C} &= \left [ {\Advs{\Uc}}^{m,(k+1)} - {\Advs{\Uc}}^{m,(k)} \right ]
76+
- {\Rbs{\Uc}}^{{m+1},(k)} \nonumber \\
77+
&+ \frac{1}{\delta t_m} \int_{t^m}^{t^{m+1}} \left ( {\Advs{\Uc}}^{(k)} + {\Rbs{\Uc}}^{(k)}\right ) d\tau
78+
\end{align}
79+
80+
This can be cast as an ODE system as:
81+
82+
.. math::
83+
84+
\frac{d\Uc}{dt} \approx \frac{\Uc^{m+1} - \Uc^m}{\delta t_m} = \Rbs{\Uc} + {\bf C}
85+
86+
Simplified SDC
87+
--------------
88+
89+
The Simplified-SDC method uses the ideas of the SDC method above, but instead
90+
of dividing time into discrete temporary notes, it uses a piecewise-constant-in-time
91+
approximation to the advection update over the timestep (for instance, computed by the CTU PPM method) and solves the ODE system:
92+
93+
.. math::
94+
95+
\frac{\partial \Uc}{\partial t} = [\Advs{\Uc}]^{n+1/2} + \Rb(\Uc)
96+
97+
and uses iteration to improve the advective term based on the
98+
reactions. The full details of the algorithm are presented in
99+
:cite:`castro_simple_sdc`.
100+
101+
Common ground
102+
-------------
103+
104+
Both SDC formulations result in an ODE system of the form:
105+
106+
.. math::
107+
108+
\frac{d\Uc}{dt} = \Rb(\Uc) + \mbox{advective terms}
109+
110+
where $\Uc$ is only
111+
112+
.. math::
113+
114+
\Uc = \left ( \begin{array}{c} \rho X_k \\ \rho e \end{array} \right )
115+
116+
since those are the only components with reactive sources.
117+
The ``SDC`` burner includes storage for the advective terms.
118+
36119
Interface and Data Structures
37120
=============================
38121

39-
burn_t
40-
------
122+
For concreteness, we use the simplified-SDC formulation in the description below,
123+
but the true-SDC version is directly analogous.
124+
125+
``burn_t``
126+
----------
41127

42128
To accommodate the increased information required to evolve the
43-
coupled system, the `burn_t` used for Strang integration is extended
129+
coupled system, the ``burn_t`` used for Strang integration is extended
44130
to include the conserved state and the advective sources. This is
45131
used to pass information to/from the integration routine from the
46132
hydrodynamics code.
@@ -128,8 +214,8 @@ system we are integrating, including the advective terms.
128214
:math:`\dot{Y}_k` and the nuclear energy release, :math:`\dot{S}`.
129215

130216
#. Convert back to the integrator’s internal representation via ``rhs_to_int``
131-
This converts the ``ydot``s to mass fractions and adds the advective terms
132-
to all ``ydots``.
217+
This converts the ``ydot`` to mass fractions and adds the advective terms
218+
to ``ydot``.
133219

134220
Jacobian
135221
--------
@@ -147,3 +233,9 @@ the Jacobian as:
147233
where :math:`{\bf w} = (X_k, T)^\intercal` are the more natural variables
148234
for a reaction network.
149235

236+
.. note::
237+
238+
In the original "true SDC" paper :cite:`castro_sdc`, the matrix
239+
system was more complicated, and we included density in ${\bf w}$.
240+
This is not needed, and we use the Jacobian defined in
241+
:cite:`castro_simple_sdc` instead.

0 commit comments

Comments
 (0)