@@ -253,14 +253,14 @@ \subsection{Piecewise linear}
253
253
expansion is used for $ \Rb\Lb \overline {\Delta \qb }$ . In fact, any vector
254
254
can be decomposed in this fashion:
255
255
\begin {equation }
256
- {\boldsymbol {\chi }} = {\bf I} {\boldsymbol {\chi }} = \Rb \Lb {\boldsymbol {\chi }} =
256
+ {\boldsymbol {\chi }} = {\bf I} {\boldsymbol {\chi }} = \Rb \Lb {\boldsymbol {\chi }} =
257
257
\sum _\nu (\lb ^\enu \cdot {\boldsymbol {\chi }}) \rb ^\enu
258
258
\end {equation }
259
259
And then it is easy to see that the above manipulations for $ \Ab \Delta \qb $
260
260
can be expressed as:
261
261
\begin {equation }
262
- \Ab \Delta \qb = \Ab \sum _\nu (\lb ^\enu \cdot \overline {\Delta \qb }) \rb ^\enu =
263
- \sum _\nu (\lb ^\enu \cdot \overline {\Delta \qb }) \Ab \rb ^\enu =
262
+ \Ab \Delta \qb = \Ab \sum _\nu (\lb ^\enu \cdot \overline {\Delta \qb }) \rb ^\enu =
263
+ \sum _\nu (\lb ^\enu \cdot \overline {\Delta \qb }) \Ab \rb ^\enu =
264
264
\sum _\nu (\lb ^\enu \cdot \overline {\Delta \qb }) \lambda ^\enu \rb ^\enu
265
265
\end {equation }
266
266
where we used $ \Ab \rb ^\enu = \lambda ^\enu \rb ^\enu $ . The quantity $ (\lb ^\enu
@@ -735,18 +735,18 @@ \subsection{Limiting on characteristic variables}
735
735
limiting on the characteristic variables rather than the primitive
736
736
variables. The characteristic slopes for the quantity carried by the
737
737
wave $ \nu $ can be found from the primitive variables
738
- as:
738
+ as:
739
739
%
740
- \begin {equation }
741
- \Delta w^{(\nu )} = \lb ^{(\nu )} \cdot \Delta \qb
742
- \end {equation }
740
+ \begin {equation }
741
+ \Delta w^{(\nu )} = \lb ^{(\nu )} \cdot \Delta \qb
742
+ \end {equation }
743
743
%
744
744
any limiting would then be done to $ \Delta w^{(\nu )}$ and the limited
745
745
primitive variables would be recovered as:
746
746
\begin {equation }
747
747
\overline {\Delta \qb } = \sum _\nu \overline {\Delta w}^{(\nu )}
748
- \rb ^{(\nu )}
749
- \end {equation }
748
+ \rb ^{(\nu )}
749
+ \end {equation }
750
750
(here we use an overline to indicate limiting).
751
751
752
752
This is attractive because it is more in the spirit of the linear
@@ -775,7 +775,7 @@ \section{Riemann solvers}
775
775
\includegraphics [width=\linewidth ]{multiple_interfaces}
776
776
\caption [Riemann wave structure at each interface]{\label {fig:euler:multiple_interfaces }
777
777
The Riemann wave structure resulting from the separate Riemann problems at each interface. For each
778
- interface, we find the state on the interface and use this to evaluate the flux through the interface.}
778
+ interface, we find the state on the interface and use this to evaluate the flux through the interface.}
779
779
\end {figure }
780
780
781
781
As discussed in \S ~\ref {Euler:riemann:solution }, we need to determine
@@ -817,8 +817,8 @@ \section{Riemann solvers}
817
817
approximation does a reasonable job near the intersection and only
818
818
diverges significantly for small $ p$ (which is where the solution
819
819
should really be a
820
- rarefaction).\\
821
- \hydroexdoit {\href {https://github.com/zingale /hydro_examples/blob/master/compressible/riemann-2shock.py}{riemann-2shock.py}}}
820
+ rarefaction).\\
821
+ \hydroexdoit {\href {https://github.com/python-hydro /hydro_examples/blob/master/compressible/riemann-2shock.py}{riemann-2shock.py}}}
822
822
\end {figure }
823
823
824
824
An additional approximation concerns rarefactions. Recall that a
@@ -856,7 +856,7 @@ \section{Conservative update}
856
856
857
857
Once we have the fluxes, the conservative update is done as
858
858
\begin {equation }
859
- \Uc ^{n+1}_i = \Uc ^n_i + \frac {\Delta t}{\Delta x}
859
+ \Uc ^{n+1}_i = \Uc ^n_i + \frac {\Delta t}{\Delta x}
860
860
\left ( \Fb _{i-\myhalf }^{n+\myhalf } - \Fb _{i+\myhalf }^{n+\myhalf } \right )
861
861
\end {equation }
862
862
The timestep, $ \Delta t$ is determined by the time it takes for the
@@ -1152,7 +1152,7 @@ \section{Source terms}
1152
1152
1153
1153
Note that the source here is cell-centered. This expansion is
1154
1154
second-order accurate. This is the approach outlined in Miller
1155
- \& Colella \cite {millercolella:2002 }. Also notice the
1155
+ \& Colella \cite {millercolella:2002 }. Also notice the
1156
1156
similarity of this source term to a second-order Euler method
1157
1157
for integrating ODEs.
1158
1158
@@ -1215,22 +1215,22 @@ \section{Source terms}
1215
1215
\end {align }
1216
1216
As written, this appears to be an implicit update (since $ \Uc ^{n+1}$
1217
1217
depends on $ \Hb ^{n+1}$ ), but often, the form of the source terms allows
1218
- you to update the equations in sequence explicitly.
1218
+ you to update the equations in sequence explicitly.
1219
1219
1220
1220
Again, using a constant gravitational acceleration as an example, and
1221
1221
looking in 1-d for simplicity, $ \Uc = (\rho , \rho u, \rho E)^\intercal $
1222
1222
and $ \Hb = (0 , \rho g, \rho u g)^\intercal $ , so our update sequence is:
1223
1223
\begin {align }
1224
- \rho ^{n+1}_i = \rho ^n_i &+ \frac {\Delta t}{\Delta x}
1225
- \left [\rho _{i-\myhalf }^{n+\myhalf } u_{i-\myhalf }^{n+\myhalf } -
1224
+ \rho ^{n+1}_i = \rho ^n_i &+ \frac {\Delta t}{\Delta x}
1225
+ \left [\rho _{i-\myhalf }^{n+\myhalf } u_{i-\myhalf }^{n+\myhalf } -
1226
1226
\rho _{i+\myhalf }^{n+\myhalf } u_{i+\myhalf }^{n+\myhalf } \right ] \\
1227
- (\rho u)^{n+1}_i = (\rho u)^n_i &+ \frac {\Delta t}{\Delta x}
1228
- \left [ \rho _{i-\myhalf }^{n+\myhalf } (u_{i-\myhalf }^{n+\myhalf })^2 -
1227
+ (\rho u)^{n+1}_i = (\rho u)^n_i &+ \frac {\Delta t}{\Delta x}
1228
+ \left [ \rho _{i-\myhalf }^{n+\myhalf } (u_{i-\myhalf }^{n+\myhalf })^2 -
1229
1229
\rho _{i+\myhalf }^{n+\myhalf } (u_{i+\myhalf }^{n+\myhalf })^2 \right ]
1230
- + \frac {\Delta t}{\Delta x} \left ( p_{i-\myhalf }^{n+\myhalf } -
1230
+ + \frac {\Delta t}{\Delta x} \left ( p_{i-\myhalf }^{n+\myhalf } -
1231
1231
p_{i+\myhalf }^{n+\myhalf } \right ) \nonumber \\
1232
1232
&+ \frac {\Delta t}{2}(\rho ^n_i + \rho ^{n+1}_i) g \\
1233
- (\rho E)^{n+1}_i = (\rho E)^n_i &+ \frac {\Delta t}{\Delta x}
1233
+ (\rho E)^{n+1}_i = (\rho E)^n_i &+ \frac {\Delta t}{\Delta x}
1234
1234
\left [ \left (\rho _{i-\myhalf }^{n+\myhalf } E_{i-\myhalf }^{n+\myhalf } + p_{i-\myhalf }^{n+\myhalf } \right ) u_{i-\myhalf }^{n+\myhalf } - \right . \nonumber \\
1235
1235
&\phantom {+ \frac {\Delta t}{\Delta x} \left [ \right .} \left . \left (\rho _{i+\myhalf }^{n+\myhalf } E_{i+\myhalf }^{n+\myhalf } + p_{i+\myhalf }^{n+\myhalf } \right ) u_{i+\myhalf }^{n+\myhalf } \right ]
1236
1236
+ \frac {\Delta t}{2} \left [ (\rho u)^n + (\rho u)^{n+1} \right ] g
@@ -1282,19 +1282,19 @@ \section{Simple geometries}
1282
1282
the same ideas as in \S ~\ref {euler:sec:sourceterms }.
1283
1283
1284
1284
The conservative update now needs to include the geometry factors. However,
1285
- it is complicated by the fact that in the momentum equation, the pressure
1286
- term is a gradient, not a divergence, and therefore has different
1285
+ it is complicated by the fact that in the momentum equation, the pressure
1286
+ term is a gradient, not a divergence, and therefore has different
1287
1287
geometic factors. The update of the system appears as:
1288
1288
\begin {align }
1289
- \rho ^{n+1}_i = \rho ^n_i &+ \frac {\Delta t}{V_i}
1290
- \left [A_{i-\myhalf } \rho _{i-\myhalf }^{n+\myhalf } u_{i-\myhalf }^{n+\myhalf } -
1289
+ \rho ^{n+1}_i = \rho ^n_i &+ \frac {\Delta t}{V_i}
1290
+ \left [A_{i-\myhalf } \rho _{i-\myhalf }^{n+\myhalf } u_{i-\myhalf }^{n+\myhalf } -
1291
1291
A_{i+\myhalf } \rho _{i+\myhalf }^{n+\myhalf } u_{i+\myhalf }^{n+\myhalf } \right ] \\
1292
- (\rho u)^{n+1}_i = (\rho u)^n_i &+ \frac {\Delta t}{V_i}
1293
- \left [ A_{i-\myhalf } \rho _{i-\myhalf }^{n+\myhalf } (u_{i-\myhalf }^{n+\myhalf })^2 -
1292
+ (\rho u)^{n+1}_i = (\rho u)^n_i &+ \frac {\Delta t}{V_i}
1293
+ \left [ A_{i-\myhalf } \rho _{i-\myhalf }^{n+\myhalf } (u_{i-\myhalf }^{n+\myhalf })^2 -
1294
1294
A_{i+\myhalf } \rho _{i+\myhalf }^{n+\myhalf } (u_{i+\myhalf }^{n+\myhalf })^2 \right ]\nonumber \\
1295
- & + \frac {\Delta t}{\Delta r} \left ( p_{i-\myhalf }^{n+\myhalf } -
1295
+ & + \frac {\Delta t}{\Delta r} \left ( p_{i-\myhalf }^{n+\myhalf } -
1296
1296
p_{i+\myhalf }^{n+\myhalf } \right ) \\
1297
- (\rho E)^{n+1}_i = (\rho E)^n_i &+ \frac {\Delta t}{V_i}
1297
+ (\rho E)^{n+1}_i = (\rho E)^n_i &+ \frac {\Delta t}{V_i}
1298
1298
\left [ A_{i-\myhalf } \left (\rho _{i-\myhalf }^{n+\myhalf } E_{i-\myhalf }^{n+\myhalf } + p_{i-\myhalf }^{n+\myhalf } \right ) u_{i-\myhalf }^{n+\myhalf } - \right . \nonumber \\
1299
1299
&\phantom {+ \frac {\Delta t}{V_i} \left [ \right .} \left . A_{i+\myhalf } \left (\rho _{i+\myhalf }^{n+\myhalf } E_{i+\myhalf }^{n+\myhalf } + p_{i+\myhalf }^{n+\myhalf } \right ) u_{i+\myhalf }^{n+\myhalf } \right ]
1300
1300
\end {align }
@@ -1349,7 +1349,7 @@ \section{Simple geometries}
1349
1349
Just as with the 1-d spherical case, the pressure term in the momentum
1350
1350
equation needs to be treated separately from the flux, since it enters
1351
1351
as a gradient and not a divergence.\footnote {It is common to see the divergence
1352
- term expressed as
1352
+ term expressed as
1353
1353
\begin {equation }
1354
1354
\nabla \cdot {\boldsymbol {\phi }} = \frac {1}{r^\alpha } \ddr {(r^\alpha \phi ^{(r)})} + \ldots
1355
1355
\end {equation }
@@ -1541,7 +1541,7 @@ \subsection{Sedov blast wave}
1541
1541
\begin {figure }[t]
1542
1542
\centering
1543
1543
\includegraphics [width=0.75\linewidth ]{sedov_compare}
1544
- \caption [2-d cylindrical Sedov problem]{\label {fig:Euler:sedov2d_compare } Angle-average
1544
+ \caption [2-d cylindrical Sedov problem]{\label {fig:Euler:sedov2d_compare } Angle-average
1545
1545
profile for the 2-d Sedov explosion from Figure~\ref {fig:Euler:sedov2d } shown
1546
1546
with the analytic solution. This was constructed using the {\tt sedov\_ compare.py}
1547
1547
script in \pyro .}
@@ -1552,7 +1552,7 @@ \subsection{Advection}
1552
1552
1553
1553
We can run a simple advection test analogous to the tests we used in
1554
1554
Ch.~\ref {ch:advection }. However, because we are now doing hydrodynamics,
1555
- we need to suppress the dynamics. This is accomplished by putting the
1555
+ we need to suppress the dynamics. This is accomplished by putting the
1556
1556
profile we want to advect in the density field and then put it in
1557
1557
pressure equilibrium by adjusting the internal energy. For example, consider
1558
1558
a Gaussian profile. We initialize the density as:
@@ -1598,9 +1598,9 @@ \subsection{Slow moving shock}
1598
1598
Slow moving (or stationary) shocks can be difficult to model, as
1599
1599
oscillations can be setup behind the shock (this is discussed a little
1600
1600
in \cite {colellawoodward:1984 ,leveque:2002 }). We can produce a slow
1601
- moving shock as a shock tube, and we can use the jump conditions
1601
+ moving shock as a shock tube, and we can use the jump conditions
1602
1602
across a shock that were derived for the Riemann problem to find the
1603
- conditions to setup a stationary (or slow-moving) shock.
1603
+ conditions to setup a stationary (or slow-moving) shock.
1604
1604
1605
1605
The speed of a right-moving shock was found (see
1606
1606
Eq.~\ref {eq:euler:shockspeedjump }) as:
@@ -1619,7 +1619,7 @@ \subsection{Slow moving shock}
1619
1619
(which was the star state when we discussed the Riemann problem) using
1620
1620
the jump conditions, Eqs.~\ref {eq:euler:shockrhojump } and
1621
1621
\ref {eq:euler:shockujump }.\footnote {The script
1622
- \href {https://github.com/zingale /hydro_examples/blob/master/compressible/slow_shock.py}{\tt
1622
+ \href {https://github.com/python-hydro /hydro_examples/blob/master/compressible/slow_shock.py}{\tt
1623
1623
slow\_ shock.py} will find the initial conditions to generate a
1624
1624
stationary shock.}
1625
1625
@@ -1660,7 +1660,7 @@ \subsection{Two-dimensional Riemann problems}
1660
1660
problems initialize the 4 quadrants of the domain with different
1661
1661
states, and watch the ensuing evolution. There are some
1662
1662
analytic estimates that can be compared to, but also these
1663
- tests can provide a means of assessing the symmetry of
1663
+ tests can provide a means of assessing the symmetry of
1664
1664
a code in the presence of complex flows. We use the setup
1665
1665
corresponding to {\em configuration 3} in that paper (this
1666
1666
same setup is used in \cite {leveque:1997 }).
@@ -1811,12 +1811,12 @@ \subsection{General equation of state}
1811
1811
1812
1812
The above methods were formulated with a constant gamma equation of
1813
1813
state. A general equation of state (such as degenerate electrons)
1814
- requires a more complex method. Most methods are designed to
1814
+ requires a more complex method. Most methods are designed to
1815
1815
reduce the need to call a complex equation of state frequently,
1816
- and work by augmenting the vector of primitive variables with
1817
- additional thermodynamic information. There are two parts of the
1818
- adaption to a general equation of state: the interface states and
1819
- the Riemann problem.
1816
+ and work by augmenting the vector of primitive variables with
1817
+ additional thermodynamic information. There are two parts of the
1818
+ adaption to a general equation of state: the interface states and
1819
+ the Riemann problem.
1820
1820
1821
1821
\subsubsection {Carrying $ \gamma _e$ }
1822
1822
@@ -1851,8 +1851,8 @@ \subsubsection{Carrying $\gamma_e$}
1851
1851
in the tracing in the construction of interface states%
1852
1852
\footnote {A {\sf Jupyter} notebook using {\sf SymPy} that derives these
1853
1853
eigenvectors is available here:
1854
- \hydroexdoit {\href {https://github.com/zingale /hydro_examples/blob/master/compressible/euler-generaleos.ipynb}{euler-generaleos.ipynb}}}.
1855
- If we write
1854
+ \hydroexdoit {\href {https://github.com/python-hydro /hydro_examples/blob/master/compressible/euler-generaleos.ipynb}{euler-generaleos.ipynb}}}.
1855
+ If we write
1856
1856
our system as
1857
1857
\begin {equation }
1858
1858
\qb = \left ( \begin {array }{c} \tau \\ u \\ p \\ \gamma _e \end {array } \right )
@@ -1996,6 +1996,3 @@ \subsubsection{Carrying $(\rho e)$}
1996
1996
explicitly adds the transverse terms found in the multi-dimensional form
1997
1997
of Eq.~\ref {eq:euler:pgeneral }
1998
1998
to the normal states of $ p$ .
1999
-
2000
-
2001
-
0 commit comments