From 3630777c175165ee992295db7e9261d3a27b1ddc Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Sun, 12 May 2024 19:58:14 -0400 Subject: [PATCH] fix some issues with the pert docs (#450) --- sphinx_docs/source/pert.rst | 339 ++++++++++++++++++------------------ 1 file changed, 169 insertions(+), 170 deletions(-) diff --git a/sphinx_docs/source/pert.rst b/sphinx_docs/source/pert.rst index 30228518e..26355cc27 100644 --- a/sphinx_docs/source/pert.rst +++ b/sphinx_docs/source/pert.rst @@ -28,23 +28,24 @@ would appear as: .. math:: - \begin{aligned} - \phi_{i+1/2,j}^{n+1/2} &=& \phi_{i,j}^n + \begin{align*} + \phi_{i+1/2,j}^{n+1/2} &= \phi_{i,j}^n + \left . \frac{\Delta x}{2} \frac{\partial \phi}{\partial x} \right |_{i,j} + \left . \frac{\Delta t}{2} \frac{\partial \phi}{\partial t} \right |_{i,j} \\ - &=& \phi_{i,j}^n + &= \phi_{i,j}^n + \left . \frac{\Delta x}{2} \frac{\partial \phi}{\partial x} \right |_{i,j} + \frac{\Delta t}{2} \left ( -u \frac{\partial \phi}{\partial x} -v \frac{\partial \phi}{\partial y} + f \right ) \\ - &=& \phi_{i,j}^n + \frac{\Delta x}{2} \left ( 1 - \frac{\Delta t}{\Delta x} u \right ) + &= \phi_{i,j}^n + \frac{\Delta x}{2} \left ( 1 - \frac{\Delta t}{\Delta x} u \right ) \frac{\partial \phi}{\partial x} - \underbrace{- \frac{\Delta t}{2} v \frac{\partial \phi}{\partial y}}_{\text{``transverse~term''}} + \frac{\Delta t}{2} f\end{aligned} + \underbrace{- \frac{\Delta t}{2} v \frac{\partial \phi}{\partial y}}_{\text{``transverse~term''}} + \frac{\Delta t}{2} f + \end{align*} (see the Godunov notes section for more details). Here, the -“transverse term” is accounted for in ``make_edge_scal``. Any +“transverse term” is accounted for in ``MakeEdgeScal``. Any additional forces should be added to :math:`f`. For the perturbation form of equations, we add additional advection-like terms to :math:`f` by calling -``modify_scal_force``. This will be noted below. +``ModifyScalForce``. This will be noted below. Conservative form ----------------- @@ -57,24 +58,24 @@ Now a piecewise linear prediction of :math:`\phi` to the interface is .. math:: - \begin{aligned} - \phi_{i+1/2,j}^{n+1/2} &=& \phi_{i,j}^n + \begin{align*} + \phi_{i+1/2,j}^{n+1/2} &= \phi_{i,j}^n + \left . \frac{\Delta x}{2} \frac{\partial \phi}{\partial x} \right |_{i,j} + \left . \frac{\Delta t}{2} \frac{\partial \phi}{\partial t} \right |_{i,j} \\ - &=& \phi_{i,j}^n + &= \phi_{i,j}^n + \left . \frac{\Delta x}{2} \frac{\partial \phi}{\partial x} \right |_{i,j} + \frac{\Delta t}{2} \left ( -\frac{\partial (\phi u)}{\partial x} -\frac{\partial (\phi v)}{\partial y} + f \right ) \\ - &=& \phi_{i,j}^n + \frac{\Delta x}{2} \left ( 1 - \frac{\Delta t}{\Delta x} u \right ) + &= \phi_{i,j}^n + \frac{\Delta x}{2} \left ( 1 - \frac{\Delta t}{\Delta x} u \right ) \frac{\partial \phi}{\partial x} \underbrace{- \frac{\Delta t}{2} \phi \frac{\partial u}{\partial x} }_{\text{``non-advective~term''}} - \underbrace{- \frac{\Delta t}{2} \frac{\partial (\phi v)}{\partial y}}_{\text{``transverse~term''}} + \frac{\Delta t}{2} f\end{aligned} + \underbrace{- \frac{\Delta t}{2} \frac{\partial (\phi v)}{\partial y}}_{\text{``transverse~term''}} + \frac{\Delta t}{2} f\end{align*} Here the “transverse term” is now in conservative form, and an additional term, the non-advective portion of the :math:`x`-flux (for the :math:`x`-prediction) appears. Both of the underbraced terms are -accounted for in ``make_edge_scal`` automatically when we call it -with ``is_conservative = .true.``. +accounted for in ``MakeEdgeScal`` automatically when we call it +with ``is_conservative = true``. .. _sec:pred:density: @@ -87,21 +88,23 @@ Basic equations The full density evolution equation is .. math:: - \begin{aligned} - \frac{\partial\rho}{\partial t} &=& -\nabla\cdot(\rho\Ub) \nonumber \\ - &=& -\Ub\cdot\nabla\rho - \rho\nabla\cdot\Ub \, . - \end{aligned} :label: rho equation + \begin{align*} + \frac{\partial\rho}{\partial t} &= -\nabla\cdot(\rho\Ub) \nonumber \\ + &= -\Ub\cdot\nabla\rho - \rho\nabla\cdot\Ub \, . + \end{align*} + The species are evolved according to .. math:: - \begin{aligned} - \frac{\partial(\rho X_k)}{\partial t} &=& -\nabla\cdot(\rho\Ub X_k) + \rho \omegadot_k \nonumber \\ - &=& -\Ub\cdot\nabla(\rho X_k) - \rho X_k \nabla\cdot\Ub + \rho \omegadot_k \, . - \end{aligned} :label: species equation + \begin{align*} + \frac{\partial(\rho X_k)}{\partial t} &= -\nabla\cdot(\rho\Ub X_k) + \rho \omegadot_k \nonumber \\ + &= -\Ub\cdot\nabla(\rho X_k) - \rho X_k \nabla\cdot\Ub + \rho \omegadot_k \, . + \end{align*} + In practice, only the species evolution equation is evolved, and the total density is set as @@ -114,7 +117,7 @@ edges as a single quantity, or predict :math:`\rho` and :math:`X` separately (either in full or perturbation form). In the notes below, we use the subscript ‘edge’ to indicate what quantity was *predicted* to the edges. In MAESTROeX, the different methods of computing :math:`(\rho X)` on -edges are controlled by the ``species_pred_type parameter``. The +edges are controlled by the ``species_pred_type`` parameter. The quantities predicted to edges and the resulting edge state are shown in the :numref:`table:pred:species`. @@ -136,9 +139,6 @@ resulting edge state are shown in the :numref:`table:pred:species`. | | :math:`(X_k)_\mathrm{edge}` | | +---------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------+ -We note the labels ``predict_rhoprime_and_X``, ``predict_rhoX``, and -``predict_rho_and_X`` are provided by the ``pred_parameters`` -module. Method 1: species_pred_type = predict_rhoprime_and_X ---------------------------------------------------- @@ -176,9 +176,9 @@ Predicting :math:`\rho'` at edges ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We define :math:`\rho' = \rho^{(1)} - \rho_0^n`. Then we predict :math:`\rho'` to -edges using ``make_edge_scal`` in ``density_advance`` and the +edges using ``MakeEdgeScal`` in ``DensityAdvance`` and the underbraced term in :eq:`rhoprime equation` as the forcing. This -force is computed in ``modify_scal_force``. This prediction is +force is computed in ``ModifyScalForce``. This prediction is done in advective form. .. _Predicting rho0 at edges: @@ -234,8 +234,8 @@ Predicting :math:`X_k` at edges Predicting :math:`X_k` is straightforward. We convert the cell-centered :math:`(\rho X_k)` to :math:`X_k` by dividing by :math:`\rho` in each zone and then we -just call ``make_edge_scal`` in ``density_advance`` on :math:`X_k`. -The force seen by ``make_edge_scal`` is 0. The prediction is +just call ``MakeEdgeScal`` in ``DensityAdvance`` on :math:`X_k`. +The force seen by ``MakeEdgeScal`` is 0. The prediction is done in advective form. Method 2: species_pred_type = predict_rhoX @@ -250,8 +250,8 @@ Here we wish to construct :math:`(\rho X_k)_\mathrm{edge}` by predicting \frac{\partial(\rho X_k)}{\partial t} = -\nabla \cdot (\rho \Ub X_k) + \rho \omegadot_k \, . \nonumber -The edge state is created by calling ``make_edge_scal`` in -``density_advance`` with ``is_conservative = .true.``. +The edge state is created by calling ``MakeEdgeScal`` in +``DensityAdvance`` with ``is_conservative = true``. We do not consider the :math:`\rho \omegadot_k` term in the forcing when Strang-splitting. @@ -265,20 +265,19 @@ Method 3: species_pred_type = predict_rho_and_X Here we wish to construct :math:`\rho_\mathrm{edge} (X_k)_\mathrm{edge}` by predicting :math:`\rho` and :math:`X_k` to the edges separately. -Predicting :math:`X_k` to the edges proceeds exactly as described in -§ \ `2.2.4 <#sec:pert:predict_X>`__. +Predicting :math:`X_k` to the edges proceeds exactly as described above. Predicting the full :math:`\rho` begins with :eq:`rho equation`: .. math:: + :label: rho equation labeled + \frac{\partial\rho}{\partial t} = -\Ub\cdot\nabla\rho \, \underbrace{- \rho\nabla\cdot\Ub}_{``\rho~\text{force''}} \, . - :label: rho equation labeled Using this, :math:`\rho` is predicted to the edges using -``make_edge_scal`` in ``density_advance``, with the underbraced -force computed in ``modify_scal_force`` with ``fullform = -.true.``. +``MakeEdgeScal`` in ``DensityAdvance``, with the underbraced +force computed in ``ModifyScaleForce`` with ``fullform = true``. .. _Advancing rhoX_k: @@ -286,7 +285,7 @@ Advancing :math:`\rho X_k` -------------------------- The evolution equation for :math:`\rho X_k`, ignoring the reaction -terms that were already accounted for in ``react_state``, and the +terms that were already accounted for in ``React``, and the associated discretization is: * ``species_pred_type = predict_rhoprime_and_X`` : @@ -326,12 +325,13 @@ The full enthalpy equation is .. math:: - \begin{aligned} - \frac{\partial(\rho h)}{\partial t} &=& -\nabla\cdot(\rho h \Ub) + \frac{Dp_0}{Dt} - + \nabla\cdot \kth \nabla T + \rho H_{\rm nuc} + \rho H_{\rm ext} \nonumber \\ - &=& \underbrace{-\Ub\cdot\nabla(\rho h) - \rho h\nabla\cdot\Ub}_{-\nabla\cdot(\rho h\Ub)} - + \underbrace{\psi + (\Ubt \cdot \er) \frac{\partial p_0}{\partial r}}_{\frac{Dp_0}{Dt}} - + \nabla\cdot\kth\nabla T + \rho H_{\rm nuc} + \rho H_{\rm ext}.\end{aligned} + \begin{align*} + \frac{\partial(\rho h)}{\partial t} &= -\nabla\cdot(\rho h \Ub) + \frac{Dp_0}{Dt} + + \nabla\cdot \kth \nabla T + \rho H_{\rm nuc} + \rho H_{\rm ext} \nonumber \\ + &= \underbrace{-\Ub\cdot\nabla(\rho h) - \rho h\nabla\cdot\Ub}_{-\nabla\cdot(\rho h\Ub)} + + \underbrace{\psi + (\Ubt \cdot \er) \frac{\partial p_0}{\partial r}}_{{Dp_0}/{Dt}} + + \nabla\cdot\kth\nabla T + \rho H_{\rm nuc} + \rho H_{\rm ext}. + \end{align*} Due to Strang-splitting of the reactions, the call to react_state has already been made. Hence, the goal is to compute @@ -348,15 +348,15 @@ react_state, so our equation becomes We define the base state enthalpy evolution equation as .. math:: - \begin{aligned} - \frac{\partial(\rho h)_0}{\partial t} &=& -\nabla\cdot[(\rho h)_0 w_0\eb_r] - + \frac{D_0p_0}{Dt} \nonumber \\ - &=& -w_0\frac{\partial(\rho h)_0}{\partial r} - - \underbrace{(\rho h)_0\frac{\partial w_0}{\partial r}+ \psi}_{``(\rho h)_0 ~ \text{force}"} - . - \end{aligned} :label: rhoh0 equation + \begin{align*} + \frac{\partial(\rho h)_0}{\partial t} &= -\nabla\cdot[(\rho h)_0 w_0\eb_r] + + \frac{D_0p_0}{Dt} \nonumber \\ + &= -w_0\frac{\partial(\rho h)_0}{\partial r} + - \underbrace{(\rho h)_0\frac{\partial w_0}{\partial r}+ \psi}_{``(\rho h)_0 ~ \text{force}"} + \end{align*} + Perturbational enthalpy formulation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -364,16 +364,17 @@ Subtracting :eq:`rhoh0 equation` from :eq:`rhoh equation` and rearranging terms gives the perturbational enthalpy equation .. math:: - \begin{aligned} - \frac{\partial(\rho h)'}{\partial t} &=& -\nabla\cdot[(\rho h)'\Ub] - - \nabla\cdot[(\rho h)_0\Ubt] + (\Ubt \cdot \er)\frac{\partial p_0}{\partial r} - + \nabla\cdot\kth\nabla T\nonumber \\ - &=& -\Ub\cdot\nabla(\rho h)' \underbrace{- (\rho h)'\nabla\cdot\Ub - - \nabla\cdot[(\rho h)_0\Ubt] + (\Ubt \cdot \er)\frac{\partial p_0}{\partial r} - + \nabla\cdot\kth\nabla T}_{``(\rho h)' ~ \text{force}"}, - \end{aligned} :label: rhohprime equation + \begin{align*} + \frac{\partial(\rho h)'}{\partial t} &= -\nabla\cdot[(\rho h)'\Ub] + - \nabla\cdot[(\rho h)_0\Ubt] + (\Ubt \cdot \er)\frac{\partial p_0}{\partial r} + + \nabla\cdot\kth\nabla T\nonumber \\ + &= -\Ub\cdot\nabla(\rho h)' \underbrace{- (\rho h)'\nabla\cdot\Ub + - \nabla\cdot[(\rho h)_0\Ubt] + (\Ubt \cdot \er)\frac{\partial p_0}{\partial r} + + \nabla\cdot\kth\nabla T}_{``(\rho h)' ~ \text{force}"}, + \end{align*} + Temperature formulation ~~~~~~~~~~~~~~~~~~~~~~~ @@ -429,11 +430,11 @@ The general procedure for making the :math:`(\rho h)` edge state is as follows: #. predict :math:`(\rho h)`, :math:`(\rho h)'`, :math:`h`, or :math:`T` to the edges (depending on ``enthalpy_pred_type`` ) using - ``make_edge_scal`` and the forces identified in the appropriate + ``MakeEdgeScal`` and the forces identified in the appropriate evolution equation (:eq:`rhohprime equation`, :eq:`T equation labeled`, or :eq:`h equation labeled` respectively). - The appropriate forces are summaried in :numref:`table:pred:hforce`. + The appropriate forces are summaried below. #. if we predicted :math:`T`, convert this predicted edge state to an intermediate “enthalpy” state (the quotes @@ -494,155 +495,161 @@ The behavior of ``enthalpy_pred_type`` is: The combination of ``species_pred_type`` and ``enthalpy_pred_type`` determine how we construct the edge state. The variations are: -* ``species_pred_type = 1`` (``predict_rhoprime_and_X``) and ``enthalpy_pred_type = 0`` (``predict_rhoh``) : +* ``species_pred_type = 1`` (``predict_rhoprime_and_X``) + + * ``enthalpy_pred_type = 0`` (``predict_rhoh``) : + + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`(\rho h)` - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`(\rho h)` + * intermediate "enthalpy" edge state : :math:`(\rho h)_\mathrm{edge}` - * intermediate "enthalpy" edge state : :math:`(\rho h)_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho'_\mathrm{edge}` - * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho'_\mathrm{edge}` + * final :math:`(\rho h)` edge state : :math:`(\rho h)_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`(\rho h)_\mathrm{edge}` + * ``enthalpy_pred_type = 1`` (``predict_rhohprime``) : -* ``species_pred_type = 1`` (``predict_rhoprime_and\_X``) and ``enthalpy_pred_type = 1`` (``predict_rhohprime``) : + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`(\rho h)'` - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`(\rho h)'` + * intermediate "enthalpy" edge state : :math:`(\rho h)'_\mathrm{edge}` - * intermediate "enthalpy" edge state : :math:`(\rho h)'_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho'_\mathrm{edge}` - * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho'_\mathrm{edge}` + * final :math:`(\rho h)` edge state : :math:`\left [ (\rho h)_0^{n+\myhalf,{\rm avg}} + (\rho h)'_\mathrm{edge} \right ]` - * final :math:`(\rho h)` edge state : :math:`\left [ (\rho h)_0^{n+\myhalf,{\rm avg}} + (\rho h)'_\mathrm{edge} \right ]` + * ``enthalpy_pred_type = 2`` (``predict_h``) -* ``species_pred_type = 1`` (``predict_rhoprime_and_X``) and ``enthalpy_pred_type = 2`` (``predict_h``) + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`h` - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`h` + * intermediate "enthalpy" edge state : :math:`h_\mathrm{edge}` - * intermediate "enthalpy" edge state : :math:`h_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho'_\mathrm{edge}` - * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho'_\mathrm{edge}` + * final :math:`(\rho h)` edge state : :math:`\left ( \rho_0^{n+\myhalf,{\rm avg}} + \rho'_\mathrm{edge} \right ) h_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`\left ( \rho_0^{n+\myhalf,{\rm avg}} + \rho'_\mathrm{edge} \right ) h_\mathrm{edge}` + * ``enthalpy_pred_type = 3`` (``predict_T_then_rhohprime``) -* ``species_pred_type = 1`` (``predict_rhoprime_and_X``) and ``enthalpy_pred_type = 3`` (``predict_T_then_rhohprime``) + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`T` - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`T` + * intermediate "enthalpy" edge state : :math:`(\rho h)'_\mathrm{edge}` - * intermediate "enthalpy" edge state : :math:`(\rho h)'_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho'_\mathrm{edge}` - * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho'_\mathrm{edge}` + * final :math:`(\rho h)` edge state : :math:`\left [ (\rho h)_0^{n+\myhalf,{\rm avg}} + (\rho h)'_\mathrm{edge} \right ]` - * final :math:`(\rho h)` edge state : :math:`\left [ (\rho h)_0^{n+\myhalf,{\rm avg}} + (\rho h)'_\mathrm{edge} \right ]` + * ``enthalpy_pred_type = 4`` {``predict_T_then_h``) -* ``species_pred_type = 1`` (``predict_rhoprime_and_X``) and ``enthalpy_pred_type = 4`` {``predict_T_then_h``) + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`T` - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`T` + * intermediate "enthalpy" edge state : :math:`h_\mathrm{edge}` - * intermediate "enthalpy" edge state : :math:`h_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho'_\mathrm{edge}` - * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho'_\mathrm{edge}` + * final :math:`(\rho h)` edge state : :math:`\left ( \rho_0^{n+\myhalf,{\rm avg}} + \rho'_\mathrm{edge} \right ) h_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`\left ( \rho_0^{n+\myhalf,{\rm avg}} + \rho'_\mathrm{edge} \right ) h_\mathrm{edge}` +* ``species_pred_type = 2`` (``predict_rhoX``) -* ``species_pred_type = 2`` (``predict_rhoX``) and ``enthalpy_pred_type = 0`` (``predict_rhoh``) + * ``enthalpy_pred_type = 0`` (``predict_rhoh``) - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`(\rho h)` + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`(\rho h)` - * intermediate "enthalpy" edge state : :math:`(\rho h)_\mathrm{edge}` + * intermediate "enthalpy" edge state : :math:`(\rho h)_\mathrm{edge}` - * species quantity available in ``mkflux`` : :math:`(\rho X)_\mathrm{edge}`, :math:`\sum(\rho X)_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`(\rho X)_\mathrm{edge}`, :math:`\sum(\rho X)_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`(\rho h)_\mathrm{edge}` + * final :math:`(\rho h)` edge state : :math:`(\rho h)_\mathrm{edge}` -* ``species_pred_type = 2`` (``predict_rhoX``) and ``enthalpy_pred_type = 1`` (``predict_rhohprime``) + * ``enthalpy_pred_type = 1`` (``predict_rhohprime``) - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`(\rho h)'` + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`(\rho h)'` - * intermediate "enthalpy" edge state : :math:`(\rho h)'_\mathrm{edge}` + * intermediate "enthalpy" edge state : :math:`(\rho h)'_\mathrm{edge}` - * species quantity available in ``mkflux`` : :math:`(\rho X)_\mathrm{edge}`, :math:`\sum(\rho X)_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`(\rho X)_\mathrm{edge}`, :math:`\sum(\rho X)_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`\left [ (\rho h)_0^{n+\myhalf,{\rm avg}} + (\rho h)'_\mathrm{edge} \right ]` + * final :math:`(\rho h)` edge state : :math:`\left [ (\rho h)_0^{n+\myhalf,{\rm avg}} + (\rho h)'_\mathrm{edge} \right ]` -* ``species_pred_type = 2`` (``predict_rhoX``) and ``enthalpy_pred_type = 2`` (``predict_h``) + * ``enthalpy_pred_type = 2`` (``predict_h``) - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`h` + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`h` - * intermediate "enthalpy" edge state : :math:`h_\mathrm{edge}` + * intermediate "enthalpy" edge state : :math:`h_\mathrm{edge}` - * species quantity available in ``mkflux`` : :math:`(\rho X)_\mathrm{edge}`, :math:`\sum(\rho X)_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`(\rho X)_\mathrm{edge}`, :math:`\sum(\rho X)_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`\sum(\rho X)_\mathrm{edge} h_\mathrm{edge}` + * final :math:`(\rho h)` edge state : :math:`\sum(\rho X)_\mathrm{edge} h_\mathrm{edge}` -* ``species_pred_type = 2`` (``predict_rhoX``) and ``enthalpy_pred_type = 3`` (``predict_T_then_rhohprime``) + * ``enthalpy_pred_type = 3`` (``predict_T_then_rhohprime``) - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`T$` + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`T$` - * intermediate "enthalpy" edge state : :math:`(\rho h)'_\mathrm{edge}` + * intermediate "enthalpy" edge state : :math:`(\rho h)'_\mathrm{edge}` - * species quantity available in ``mkflux`` : :math:`(\rho X)_\mathrm{edge}`, :math:`\sum(\rho X)_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`(\rho X)_\mathrm{edge}`, :math:`\sum(\rho X)_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`\left [ (\rho h)_0^{n+\myhalf,{\rm avg}} + (\rho h)'_\mathrm{edge} \right ]` + * final :math:`(\rho h)` edge state : :math:`\left [ (\rho h)_0^{n+\myhalf,{\rm avg}} + (\rho h)'_\mathrm{edge} \right ]` -* ``species_pred_type = 2`` (``predict_rhoX``) and ``enthalpy_pred_type = 4`` (``predict_T_then_h``) + * ``enthalpy_pred_type = 4`` (``predict_T_then_h``) - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`T` + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`T` - * intermediate "enthalpy" edge state : :math:`h_\mathrm{edge}` + * intermediate "enthalpy" edge state : :math:`h_\mathrm{edge}` - * species quantity available in ``mkflux`` : :math:`(\rho X)_\mathrm{edge}`, :math:`\sum(\rho X)_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`(\rho X)_\mathrm{edge}`, :math:`\sum(\rho X)_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`\sum(\rho X)_\mathrm{edge} h_\mathrm{edge}` + * final :math:`(\rho h)` edge state : :math:`\sum(\rho X)_\mathrm{edge} h_\mathrm{edge}` -* ``species_pred_type = 3`` (``predict_rho_and_X``) and ``enthalpy_pred_type = 0`` (``predict_rhoh``) +* ``species_pred_type = 3`` (``predict_rho_and_X``) - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`(\rho h)` + * ``enthalpy_pred_type = 0`` (``predict_rhoh``) - * intermediate "enthalpy" edge state : :math:`(\rho h)_\mathrm{edge}` + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`(\rho h)` - * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho_\mathrm{edge}` + * intermediate "enthalpy" edge state : :math:`(\rho h)_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`(\rho h)_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho_\mathrm{edge}` -* ``species_pred_type = 3`` (``predict_rho_and_X``) and ``enthalpy_pred_type = 1`` (``predict_rhohprime``) + * final :math:`(\rho h)` edge state : :math:`(\rho h)_\mathrm{edge}` - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`(\rho h)'` + * ``enthalpy_pred_type = 1`` (``predict_rhohprime``) - * intermediate "enthalpy" edge state : :math:`(\rho h)'_\mathrm{edge}` + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`(\rho h)'` - * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho_\mathrm{edge}` + * intermediate "enthalpy" edge state : :math:`(\rho h)'_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`\left [ (\rho h)_0^{n+\myhalf,{\rm avg}} + (\rho h)'_\mathrm{edge} \right ]` + * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho_\mathrm{edge}` -* ``species_pred_type = 3`` (``predict_rho_and_X``) and ``enthalpy_pred_type = 2`` (``predict_h``) + * final :math:`(\rho h)` edge state : :math:`\left [ (\rho h)_0^{n+\myhalf,{\rm avg}} + (\rho h)'_\mathrm{edge} \right ]` - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`h` + * ``enthalpy_pred_type = 2`` (``predict_h``) - * intermediate "enthalpy" edge state : :math:`h_\mathrm{edge}` + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`h` - * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho_\mathrm{edge}` + * intermediate "enthalpy" edge state : :math:`h_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`\rho_\mathrm{edge} h_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho_\mathrm{edge}` -* ``species_pred_type = 3`` (``predict_rho_and_X``) and ``enthalpy_pred_type = 3`` (``predict_T_then_rhohprime``) + * final :math:`(\rho h)` edge state : :math:`\rho_\mathrm{edge} h_\mathrm{edge}` - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`T` + * ``enthalpy_pred_type = 3`` (``predict_T_then_rhohprime``) - * intermediate "enthalpy" edge state : :math:`(\rho h)'_\mathrm{edge}` + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`T` - * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho_\mathrm{edge}` + * intermediate "enthalpy" edge state : :math:`(\rho h)'_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`\left [ (\rho h)_0^{n+\myhalf,{\rm avg}} + (\rho h)'_\mathrm{edge} \right ]` + * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho_\mathrm{edge}` -* ``species_pred_type = 3`` (``predict_rho_and_X``) and ``enthalpy_pred_type = 4`` (``predict_T_then_h``) + * final :math:`(\rho h)` edge state : :math:`\left [ (\rho h)_0^{n+\myhalf,{\rm avg}} + (\rho h)'_\mathrm{edge} \right ]` - * cell-centered quantity predicted in ``make_edge_scal`` : :math:`T` + * ``enthalpy_pred_type = 4`` (``predict_T_then_h``) - * intermediate "enthalpy" edge state : :math:`h_\mathrm{edge}` + * cell-centered quantity predicted in ``MakeEdgeScal`` : :math:`T` - * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho_\mathrm{edge}` + * intermediate "enthalpy" edge state : :math:`h_\mathrm{edge}` - * final :math:`(\rho h)` edge state : :math:`\rho_\mathrm{edge} h_\mathrm{edge}` + * species quantity available in ``mkflux`` : :math:`X_\mathrm{edge}`, :math:`\rho_\mathrm{edge}` + + * final :math:`(\rho h)` edge state : :math:`\rho_\mathrm{edge} h_\mathrm{edge}` @@ -650,7 +657,7 @@ Method 0: enthalpy_pred_type = predict_rhoh ------------------------------------------- Here we wish to construct :math:`(\rho h)_\mathrm{edge}` by predicting -:math:`(\rho h)` to the edges directly. We use ``make_edge_scal`` with +:math:`(\rho h)` to the edges directly. We use ``MakeEdgeScal`` with ``is_conservative = .true.`` on :math:`(\rho h)`, with the underbraced term in :eq:`rhoh equation` as the force (computed in ``mkrhohforce``). @@ -666,9 +673,9 @@ Predicting :math:`(\rho h)'` at edges ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We define :math:`(\rho h)' = (\rho h)^{(1)} - (\rho h)_0^n`. Then we predict -:math:`(\rho h)'` to edges using ``make_edge_scal`` in ``enthalpy_advance`` +:math:`(\rho h)'` to edges using ``MakeEdgeScal`` in ``enthalpy_advance`` and the underbraced term in :eq:`rhohprime equation` as the forcing (see -also :numref:`table:pred:hforce` for the forcing term). +below for the forcing term). The first two terms in :math:`(\rho h)'` force are computed in ``modify_scal_force``, and the last two terms are accounted for in ``mkrhohforce``. For spherical problems, we have found that a different @@ -716,9 +723,9 @@ Predicting :math:`h` at edges ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We define :math:`h = (\rho h)^{(1)}/\rho^{(1)}`. Then we predict :math:`h` to edges -using ``make_edge_scal`` in ``enthalpy_advance`` and the +using ``MakeEdgeScal`` in ``enthalpy_advance`` and the underbraced term in :eq:`h equation labeled` as the forcing (see -also :numref:`table:pred:hforce`. This force is computed by +below). This force is computed by ``mkrhohforce`` and then divided by :math:`\rho`. Note: ``mkrhoforce`` knows about the different ``enthalpy_pred_types`` and computes the correct force for this type. @@ -734,12 +741,12 @@ Computing :math:`\rho h` at edges edges>`__ for computing :math:`\rho_\mathrm{edge}` from :math:`\rho_0` and :math:`\rho'_\mathrm{edge}` and then multiply by :math:`h_\mathrm{edge}`. -|   +| | ``species_pred_types``: ``predict_rhoX``: | We already have :math:`\sum(\rho X_k)_\mathrm{edge}` and simply multiply by :math:`h_\mathrm{edge}`. -|   +| | ``species_pred_types``: ``predict_rho_and_X``: | We already have :math:`\rho_\mathrm{edge}` and simply multiply by :math:`h_\mathrm{edge}`. @@ -753,10 +760,10 @@ converting this to :math:`(\rho h)'_\mathrm{edge}` via the EOS. Predicting :math:`T` at edges ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -We predict :math:`T` to edges using ``make_edge_scal`` in +We predict :math:`T` to edges using ``MakeEdgeScal`` in ``enthalpy_advance`` and the underbraced term in Eq. \ `[T equation labeled] <#T equation - labeled>`__ as the forcing (see also :numref:`table:pred:hforce`). + labeled>`__ as the forcing (see below). This force is computed by ``mktempforce``. Converting :math:`T_\mathrm{edge}` to :math:`(\rho h)'_\mathrm{edge}` @@ -768,29 +775,21 @@ h)'_\mathrm{edge}`. For the EOS call, we need :math:`X_\mathrm{edge}` and :math:`\rho_\mathrm{edge}`. This construction depends on ``species_pred_type``, since the species edge states may differ between the various prediction types (see the “species quantity” -column in :numref:`table:pred:hoverview`. The EOS inputs are +notes below). The EOS inputs are constructed as: -.. raw:: latex - - \centering - -+-----------------------+-----------------------+-----------------------+ -| species_pred_type | :math:`\rho` edge | :math:`X_k` edge | -| | state | state | -+=======================+=======================+=======================+ -| predict_rhoprime_and_ | :math:`\rho_0^{n+\myh | :math:`(X_k)_\mathrm{ | -| X | alf,\rm{avg}} + \rho' | edge}` | -| | _\mathrm{edge}` | | -+-----------------------+-----------------------+-----------------------+ -| predict_rhoX | :math:`\sum_k (\rho X | :math:`(\rho X_k)_\ma | -| | _k)_\mathrm{edge}` | thrm{edge}/\sum_k (\r | -| | | ho X_k)_\mathrm{edge} | -| | | ` | -+-----------------------+-----------------------+-----------------------+ -| predict_rho_and_X | :math:`\rho_\mathrm{e | :math:`(X_k)_\mathrm{ | -| | dge}` | edge}` | -+-----------------------+-----------------------+-----------------------+ + ++-----------------------------+------------------------------------------------------+--------------------------------------------------------------+ +| ``species_pred_type`` | :math:`\rho` edge | :math:`X_k` edge | +| | state | state | ++=============================+======================================================+==============================================================+ +| ``predict_rhoprime_and_X`` | $\rho_0^{n+\myhalf,\rm{avg}} + \rho'_\mathrm{edge}$ | $(X_k)_\mathrm{edge}$ | ++-----------------------------+------------------------------------------------------+--------------------------------------------------------------+ +| ``predict_rhoX`` | $\sum_k (\rho X_k)_\mathrm{edge}$ | $(\rho X_k)_\mathrm{edge} / \sum_k (\rho X_k)_\mathrm{edge}$ | ++-----------------------------+------------------------------------------------------+--------------------------------------------------------------+ +| ``predict_rho_and_X`` | $\rho_\mathrm{edge}$ | $(X_k)_\mathrm{edge}$ | ++-----------------------------+------------------------------------------------------+--------------------------------------------------------------+ + After calling the EOS, the output of ``makeHfromRhoT_edge`` is :math:`(\rho h)'_\mathrm{edge}`. @@ -811,13 +810,13 @@ quantities are present. In all cases, the enthalpy state is found by predicting :math:`T` to the edges and then converting this to :math:`h_\mathrm{edge}` via the EOS. -For ``species_pred_types``:`` predict_rhoprime_and_X,`` we wish to +For ``species_pred_types`: ``predict_rhoprime_and_X`` we wish to construct :math:`(\rho_0 + \rho'_\mathrm{edge} ) h_\mathrm{edge}`. -For ``species_pred_types``: ``predict_rhoX``, we wish to +For ``species_pred_type``: ``predict_rhoX``, we wish to construct :math:`\sum(\rho X_k)_\mathrm{edge} h_\mathrm{edge}`. -For ``species_pred_types``: ``predict_rho_and_X``, we wish to +For ``species_pred_type``: ``predict_rho_and_X``, we wish to construct :math:`\rho_\mathrm{edge} h_\mathrm{edge}`. .. _predicting-t-at-edges-1: