Skip to content

Commit cfe27ad

Browse files
authored
start of some doc fixes (#1667)
this improves the landing page and eliminates the preface also remove some old text that is no longer accurate finally, start working on the index
1 parent 9d58404 commit cfe27ad

File tree

13 files changed

+120
-70
lines changed

13 files changed

+120
-70
lines changed

sphinx_docs/source/data_structures.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ EOS
1313
``eos_t``
1414
---------
1515

16+
.. index:: eos_t
17+
1618
The main data structure for interacting with the EOS is ``eos_t``.
1719
This is a collection of data specifying the microphysical state of the
1820
fluid that we are evaluating. This has many components. For a
@@ -49,6 +51,8 @@ Networks
4951
``burn_t``
5052
----------
5153

54+
.. index:: burn_t
55+
5256
The main data structure for interacting with the reaction networks is
5357
``burn_t``. This holds the composition (mass fractions), thermodynamic
5458
state, and a lot of internal information used by the reaction network
@@ -89,14 +93,18 @@ the user will only need to fill/use the following information:
8993
``rate_t``, ``rate_fr_t``
9094
-------------------------
9195

92-
The ``rate_t`` and ``rate_fr_t`` structures are used internally in a network to pass the
96+
.. index:: rate_t
97+
98+
The ``rate_t`` structure is used internally in a network to pass the
9399
raw reaction rate information (usually just the temperature-dependent
94100
terms) between various subroutines. It does not come out of the
95101
network-specific righthand side or Jacobian routines.
96102

97103
``burn_type.H``
98104
---------------
99105

106+
.. index:: burn_type.H
107+
100108
In addition to defining the ``burn_t`` type, the header ``burn_type.H``
101109
also defines integer indices into the solution vector that can be used
102110
to access the different components of the state:

sphinx_docs/source/eos.rst

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ an EOS module in case you want to build your own.
99
Available Equations of State
1010
============================
1111

12+
.. index:: eos_t
13+
1214
The following equations of state are available in Microphysics.
1315
Except where noted, each of these EOSs will provide the full
1416
thermodynamic data (including all derivatives) in the ``eos_t``
@@ -22,32 +24,27 @@ equation of state:
2224

2325
.. math:: p = (\gamma - 1) \rho e.
2426

25-
:math:`\gamma` is specified by the runtime parameter ``eos_gamma``. For
27+
:math:`\gamma` is specified by the runtime parameter ``eos.eos_gamma``. For
2628
an ideal gas, this represents the ratio of specific heats. The gas is
2729
assumed to be ideal, with the pressure given by
2830

2931
.. math:: p = \frac{\rho k T}{\mu m_u}
3032

3133
where :math:`k` is Boltzmann’s constant and :math:`\mu` is the mean molecular
3234
weight, calculated from the composition, :math:`X_k`. This EOS assumes
33-
the gas is either completely neutral (``assume_neutral = T``),
35+
the gas is either completely neutral (``eos.assume_neutral = 1``),
3436
giving:
3537

3638
.. math:: \mu^{-1} = \sum_k \frac{X_k}{A_k}
3739

38-
or completely ionized (``assume_neutral = F``), giving:
40+
or completely ionized (``eos.assume_neutral = 0``), giving:
3941

4042
.. math:: \mu^{-1} = \sum_k \left ( 1 + Z_k \right ) \frac{X_k}{A_k}
4143

4244
The entropy comes from the Sackur-Tetrode equation. Because of the
4345
complex way that composition enters into the entropy, the entropy
4446
formulation here is only correct for a :math:`\gamma = 5/3` gas.
4547

46-
Note that the implementation provided in Microphysics is the same as
47-
the version shipped with MAESTRO, but more general than the
48-
``gamma_law`` EOS provided with CASTRO. CASTRO’s default EOS only
49-
fills the thermodynamic information in ``eos_t`` that is required
50-
by the hydrodynamics module in CASTRO.
5148

5249
polytrope
5350
---------
@@ -63,21 +60,21 @@ only independent variable; there is no temperature dependence. The
6360
user either selects from a set of predefined options reflecting
6461
physical polytropes (e.g. a non-relativistic, fully degenerate
6562
electron gas) or inputs their own values for :math:`K` and :math:`\gamma`
66-
via ``polytrope_K`` and ``polytrope_gamma``.
63+
via ``eos.polytrope_K`` and ``eos.polytrope_gamma``.
6764

68-
The runtime parameter ``polytrope_type`` selects the pre-defined
65+
The runtime parameter ``eos.polytrope_type`` selects the pre-defined
6966
polytropic relations. The options are:
7067

71-
- ``polytrope_type = 1``: sets :math:`\gamma = 5/3` and
68+
- ``eos.polytrope_type = 1``: sets :math:`\gamma = 5/3` and
7269

7370
.. math:: K = \left ( \frac{3}{\pi} \right)^{2/3} \frac{h^2}{20 m_e m_p^{5/3}} \frac{1}{\mu_e^{5/3}}
7471

75-
where :math:`mu_e` is the mean molecular weight per electron, specified via ``polytrope_mu_e``
72+
where :math:`mu_e` is the mean molecular weight per electron, specified via ``eos.polytrope_mu_e``
7673

7774
This is the form appropriate for a non-relativistic
7875
fully-degenerate electron gas.
7976

80-
- ``polytrope_type = 2``: sets :math:`\gamma = 4/3` and
77+
- ``eos.polytrope_type = 2``: sets :math:`\gamma = 4/3` and
8178

8279
.. math:: K = \left ( \frac{3}{\pi} \right)^{1/3} \frac{hc}{8 m_p^{4/3}} \frac{1}{\mu_e^{4/3}}
8380

@@ -161,12 +158,12 @@ and :math:`p = \rho e (\gamma_\mathrm{effective} - 1)`.
161158
This equation of state takes several runtime parameters that can set
162159
the :math:`\gamma_i` for a specific species. The parameters are:
163160

164-
- ``eos_gamma_default``: the default :math:`\gamma` to apply for all
161+
- ``eos.eos_gamma_default``: the default :math:`\gamma` to apply for all
165162
species
166163

167-
- ``species_X_name`` and ``species_X_gamma``: set the
164+
- ``eos.species_X_name`` and ``eos.species_X_gamma``: set the
168165
:math:`\gamma_i` for the species whose name is given as
169-
``species_X_name`` to the value provided by ``species_X_gamma``.
166+
``eos.species_X_name`` to the value provided by ``eos.species_X_gamma``.
170167
Here, ``X`` can be one of the letters: ``a``, ``b``, or
171168
``c``, allowing us to specify custom :math:`\gamma_i` for up to three
172169
different species.
@@ -209,6 +206,8 @@ appropriate interpolation table from that site to use this.
209206
Interface and Modes
210207
===================
211208

209+
.. index:: eos_t, eos_re_t, eos_rep_t, eos_rh_t, chem_eos_t
210+
212211
The EOS is called as:
213212

214213
.. code:: c++
@@ -244,6 +243,11 @@ The *eos_type* passed in is one of
244243

245244
* ``eos_rep_t`` : expands on ``eos_re_t`` to include pressure information
246245

246+
* ``eos_rh_t`` : expands on ``eos_rep_t`` to include enthalpy information
247+
248+
* ``chem_eos_t`` : adds some quantities needed for the primordial chemistry EOS
249+
and explicitly does not include the mass fractions.
250+
247251
In general, you should use the type that has the smallest set of
248252
information needed, since we optimize out needless quantities at
249253
compile type (via C++ templating) for ``eos_re_t`` and ``eos_rep_t``.
@@ -260,6 +264,7 @@ compile type (via C++ templating) for ``eos_re_t`` and ``eos_rep_t``.
260264
Auxiliary Composition
261265
---------------------
262266

267+
.. index:: USE_AUX_THERMO
263268

264269
With ``USE_AUX_THERMO=TRUE``, we interpret the composition from the auxiliary variables.
265270
The auxiliary variables are
@@ -298,6 +303,21 @@ The equation of state also needs :math:`\bar{Z}` which is easily computed as
298303
\bar{Z} = \bar{A} Y_e
299304
300305
306+
Composition Derivatives
307+
-----------------------
308+
309+
.. index:: eos_extra_t, eos_re_extra_t, eos_rep_extra_t
310+
311+
The derivatives $\partial p/\partial A$, $\partial p/\partial Z$,
312+
and $\partial e/\partial A$, $\partial e/\partial Z$ are available via
313+
the ``eos_extra_t``, ``eos_re_extra_t``, ``eos_rep_extra_t``, which
314+
extends the non-"extra" variants with these additional fields.
315+
316+
The composition derivatives can be used via the ``composition_derivatives()`` function
317+
in ``eos_composition.H``
318+
to compute :math:`\partial p/\partial X_k |_{\rho, T, X_j}`, :math:`\partial e/\partial X_k |_{\rho, T, X_j}`, and :math:`\partial h/\partial X_k |_{\rho, T, X_j}`.
319+
320+
301321
Initialization and Cutoff Values
302322
================================
303323

@@ -328,6 +348,3 @@ appropriate time for, say, loading an interpolation table into memory.
328348

329349
The main evaluation routine is called ``actual_eos``. It should
330350
accept an eos_input and an eos_t state; see Section :ref:`data_structures`.
331-
332-
333-

sphinx_docs/source/getting_started.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Getting Started
55
Standalone
66
==========
77

8+
.. index:: AMREX_HOME
9+
810
Microphysics can be used in a "standalone" fashion to run the unit
911
tests and explore the behavior of the reaction networks. The main
1012
requirement is a copy of AMReX:
@@ -23,6 +25,8 @@ to set the ``AMREX_HOME`` environment variable to point to the
2325

2426
(where you change ``/path/to/amrex`` to your actual path).
2527

28+
.. index:: burn_cell
29+
2630
A good unit test to start with is ``burn_cell`` -- this is simply a
2731
one-zone burn. In ``Microphysics/`` do:
2832

@@ -45,6 +49,8 @@ Here ``inputs_aprox21`` is the inputs file that sets options.
4549
Running with AMReX Application Code
4650
===================================
4751

52+
.. index:: MICROPHYSICS_HOME
53+
4854
Getting started with Microphysics using either CASTRO or MAESTROeX is
4955
straightforward. Because the modules here are already in a format that
5056
the AMReX codes understand, you only need to provide to the code

sphinx_docs/source/index.rst

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,36 @@
66
AMReX-Astro Microphysics
77
************************
88

9-
A collection of microphysics routines (equations of state,
9+
AMReX-Astro Microphysics is a collection of microphysics routines (equations of state,
1010
reaction networks, ...) and utilities (ODE integrators, NSE solvers)
1111
for astrophysical simulation codes.
1212

13-
.. toctree::
14-
:maxdepth: 1
13+
The original design was to support the `AMReX
14+
<https://github.com/amrex-codes/amrex>`_ codes `CASTRO
15+
<https://github.com/amrex-astro/Castro>`_ and MAESTRO (now `MAESTROeX
16+
<https://github.com/amrex-astro/MAESTROeX>`_). These all have a
17+
consistent interface and the separate Microphysics repository allows
18+
them to share the same equation of state, reaction networks, and more.
19+
Later, Microphysics was adopted by the `Quokka <https://github.com/quokka-astro/quokka>`_
20+
simulation code.
21+
22+
While there are a number of unit tests that exercise the functionality,
23+
Microphysics is primarily intended to be used along with another simulation
24+
code. At the moment, the interfaces and
25+
build stubs are compatible with the AMReX codes and use the AMReX build
26+
system.
27+
28+
A number of the routines contained here we authored by other people.
29+
We bundle them here with permission, usually changing the interfaces
30+
to be compatible with our standardized interface. We in particular
31+
thank Frank Timmes for numerous reaction networks and his equation
32+
of state routines.
1533

16-
preface
1734

1835
.. toctree::
1936
:maxdepth: 1
2037
:caption: Microphysics overview
38+
:hidden:
2139

2240
getting_started
2341
design
@@ -28,13 +46,15 @@ for astrophysical simulation codes.
2846
.. toctree::
2947
:maxdepth: 1
3048
:caption: EOS and transport
49+
:hidden:
3150

3251
eos
3352
transport
3453

3554
.. toctree::
3655
:maxdepth: 1
3756
:caption: Reaction networks
57+
:hidden:
3858

3959
networks-overview
4060
networks
@@ -44,6 +64,7 @@ for astrophysical simulation codes.
4464
.. toctree::
4565
:maxdepth: 1
4666
:caption: ODE integrators
67+
:hidden:
4768

4869
integrators
4970
ode_integrators
@@ -53,6 +74,7 @@ for astrophysical simulation codes.
5374
.. toctree::
5475
:maxdepth: 1
5576
:caption: Unit tests
77+
:hidden:
5678

5779
unit_tests
5880
comprehensive_tests
@@ -61,13 +83,13 @@ for astrophysical simulation codes.
6183
.. toctree::
6284
:maxdepth: 1
6385
:caption: References
86+
:hidden:
6487

6588
zreferences
6689

90+
.. toctree::
91+
:maxdepth: 1
92+
:caption: Index
93+
:hidden:
6794

68-
Indices and tables
69-
==================
70-
71-
* :ref:`genindex`
72-
* :ref:`modindex`
73-
* :ref:`search`
95+
genindex

sphinx_docs/source/integrators.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ The equations we integrate to do a nuclear burn are:
1717
\frac{de}{dt} = f(\rho,X_k,T)
1818
:label: eq:enuc_integrate
1919
20-
Here, :math:`X_k` is the mass fraction of species :math:`k`, :math:`e` is the specific
21-
nuclear energy created through reactions. Also needed are density :math:`\rho`,
22-
temperature :math:`T`, and the specific heat. The function :math:`f` provides the energy release from reactions and can often be expressed in terms of the
23-
instantaneous reaction terms, :math:`\dot{X}_k`. As noted in the previous
24-
section, this is implemented in a network-specific manner.
20+
Here, :math:`X_k` is the mass fraction of species :math:`k`, :math:`e`
21+
is the specific nuclear energy created through reactions. Also needed
22+
are density :math:`\rho`, temperature :math:`T`, and the specific
23+
heat. The function :math:`f` provides the energy release from
24+
reactions and can often be expressed in terms of the instantaneous
25+
reaction terms, :math:`\dot{X}_k`. As noted in the previous section,
26+
this is implemented in a network-specific manner.
2527

2628
In this system, :math:`e` is equal to the total specific internal
2729
energy. This allows us to easily call the EOS during the burn to obtain the temperature.
@@ -223,7 +225,7 @@ flow is (for VODE):
223225
and zero out the temperature and energy derivatives if we are not integrating
224226
those quantities.
225227

226-
#. apply any boosting if ``react_boost`` > 0
228+
#. apply any boosting if ``integrator.react_boost`` > 0
227229

228230

229231
Jacobian implementation

sphinx_docs/source/networks-overview.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ There are two primary files within each network directory.
114114
state and (respectively) the time-derivatives and Jacobian
115115
elements to fill in.
116116

117-
Note: some networks do not provide an analytic Jacobian and instead
118-
rely on the numerical difference-approximation to the Jacobian. In
119-
this case, the interface ``actual_jac`` is still needed to compile.
117+
.. note::
118+
119+
Some networks do not provide an analytic Jacobian and instead
120+
rely on the numerical difference-approximation to the Jacobian. In
121+
this case, the interface ``actual_jac`` is still needed to compile.
120122

121123
Notice that these modules have initialization routines:
122124

sphinx_docs/source/networks.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ for plotfile variables, and the mass number, :math:`A`, and proton number, :math
5656

5757
The name of the inputs file by one of two make variables:
5858

59+
.. index:: NETWORK_INPUTS, GENERAL_NET_INPUTS
60+
5961
* ``NETWORK_INPUTS`` : this is simply the name of the "`.net`" file, without
6062
any path. The build system will look for it in the current directory
6163
and then in ``$(MICROPHYSICS_HOME)/networks/general_null/``.

sphinx_docs/source/nse.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ instead of integrating the entire network when the conditions are
77
appropriate. There are 2 different implementations of NSE in
88
Microphysics, that have slightly different use cases.
99

10+
.. index:: USE_NSE_TABLE, USE_NSE_NET
11+
1012
* :ref:`tabulated_nse` : this uses a table of NSE abundances given
1113
:math:`(\rho, T, Y_e)` generate from a large network (125 isotopes).
1214
The table also returns :math:`dY_e/dt` resulting from

sphinx_docs/source/one_zone_tests.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on a single zone to inspect the output directly.
99
``burn_cell``
1010
=============
1111

12+
.. index:: ``burn_cell``
13+
1214
``burn_cell`` is a simple one-zone burn that will evolve a state with
1315
a network for a specified amount of time. This can be used to
1416
understand the timescales involved in a reaction sequence or to

0 commit comments

Comments
 (0)