Initial Models
Here we briefly describe the various routines for generating initial models for the main MAESTROeX problems and how the initial model is used to initialize both the base state and the full Cartesian state.
Note
When run, MAESTROeX outputs info that’s useful to check, including dr
of
base state and dr
of the input file, which should be the same at the
finest level; and Maximum HSE Error, which should be some small number.
Creating the Model Data from Raw Data
We have found that for the best performance, the MAESTROeX
initialization procedure should be given model data with the same
resolution as the base state resolution,
For planar problems,
.For multilevel planar problems, we use
equal to at the finest resolution.For spherical problems we set
.
We generate our initial model either analytically or from raw data,
Here is the raw data file for each test problem:
We use a C++ program
to interpolate the raw data, yielding the model data,
to a user defined tolerance. The shared initial_models
git repo
(https://github.com/AMReX-Astro/initial_models) has the routines used
for creating initial models. Here are the names of the initial_models
directories used for different problems:
problem name
initial_models routine
reacting_bubble
test2
test_convect
test2
wdconvect
none
spherical_heat
spherical
The model data is not generated at run-time—it must be generated in advance of running any MAESTROeX examples. The inputs file should point to the file containing the model data.
Creating the Initial Data from the Model Data
In base_state.f90, using the subroutine
init_base_state (which is actually a terrible name since we
are computing 1D initial data, which is not quite the same thing
as the base satte), we set the initial
data
For multilevel planar problems, we generate initial data at the non-finest levels by using linear interpolation from the two nearest model points (see the figure below). Note that the initial data is not in HSE nor is it thermodynamically consistent on non-finest cells. We will enforce these on the base state and full state later.

Fig. 11 Multilevel Initialization. The data from the initial model is represented by the dots on the right. The initial data at the finest level is represented by the circles. The initial data at non-finest levels is represented by the squares. We copy data from the dots directly into the circles. We use linear interpolation using the two nearest points to copy data from the dots to the squares.
We deal with the edge of the star by tracking the first coarse cell
in which the density falls below base_cutoff_density. We note
the radius of this cell center, and the values of
Creating the Base State and Full State
Given
Fill
, and onto a multifab to obtain the full state , and .If perturb_model = T, a user-defined perturbation is added. This routine should make sure that the EOS is called so that there is some sense of thermodynamic consistency.
Set
.Compute
using enforce_HSE.Compute
.Set
.Compute
. Note that we only use as a diagnostic and as a seed for EOS calls.
Now
Coarse-Fine enforce_HSE Discretization
When integrating the HSE discretization upward, we must use a
different differencing procedure at coarse-fine interfaces. The
figure below shows the transition from coarse (level

Fig. 12 A coarse-fine interface in the 1-d base state
To find the zone-centered pressure in the first fine zone,
First we integrate up to the coarse-fine interface from the coarse-cell center as:
We can rewrite this as an expression for the pressure at the coarse-fine interface:
Next we integrate up from the coarse-fine interface to the fine-cell center:
We can rewrite this as an expression for the pressure at the fine-cell center:
Combining Eq.98 and Eq.100 gives
We can simplify using
and by interpolating the cell-centered densities to the coarse-fine interface as:
Because we carry both the cell- and edge-centered gravitational accelerations, we
do not need to interpolate
Finally, we note for constant
When integrating across a fine-coarse interface (see the figure below), the proceduce is similar.

Fig. 13 A fine-coarse interface in the 1-d base state
The expression for general gravity becomes:
and for spatially-constant gravity, it simplifies to: