Skip to content

Commit b6cbd55

Browse files
committed
Change repo references to python-hydro.
Fixes issue Open-Astrophysics-Bookshelf#9.
1 parent 3b6dc62 commit b6cbd55

File tree

15 files changed

+406
-416
lines changed

15 files changed

+406
-416
lines changed

Euler/Euler-methods.tex

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,14 @@ \subsection{Piecewise linear}
253253
expansion is used for $\Rb\Lb \overline{\Delta \qb}$. In fact, any vector
254254
can be decomposed in this fashion:
255255
\begin{equation}
256-
{\boldsymbol{\chi}} = {\bf I} {\boldsymbol{\chi}} = \Rb \Lb {\boldsymbol{\chi}} =
256+
{\boldsymbol{\chi}} = {\bf I} {\boldsymbol{\chi}} = \Rb \Lb {\boldsymbol{\chi}} =
257257
\sum_\nu (\lb^\enu \cdot {\boldsymbol{\chi}}) \rb^\enu
258258
\end{equation}
259259
And then it is easy to see that the above manipulations for $\Ab \Delta \qb$
260260
can be expressed as:
261261
\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 =
264264
\sum_\nu (\lb^\enu \cdot \overline{\Delta \qb}) \lambda^\enu \rb^\enu
265265
\end{equation}
266266
where we used $\Ab \rb^\enu = \lambda^\enu \rb^\enu$. The quantity $(\lb^\enu
@@ -735,18 +735,18 @@ \subsection{Limiting on characteristic variables}
735735
limiting on the characteristic variables rather than the primitive
736736
variables. The characteristic slopes for the quantity carried by the
737737
wave $\nu$ can be found from the primitive variables
738-
as:
738+
as:
739739
%
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}
743743
%
744744
any limiting would then be done to $\Delta w^{(\nu)}$ and the limited
745745
primitive variables would be recovered as:
746746
\begin{equation}
747747
\overline{\Delta \qb} = \sum_\nu \overline{\Delta w}^{(\nu)}
748-
\rb^{(\nu)}
749-
\end{equation}
748+
\rb^{(\nu)}
749+
\end{equation}
750750
(here we use an overline to indicate limiting).
751751

752752
This is attractive because it is more in the spirit of the linear
@@ -775,7 +775,7 @@ \section{Riemann solvers}
775775
\includegraphics[width=\linewidth]{multiple_interfaces}
776776
\caption[Riemann wave structure at each interface]{\label{fig:euler:multiple_interfaces}
777777
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.}
779779
\end{figure}
780780

781781
As discussed in \S~\ref{Euler:riemann:solution}, we need to determine
@@ -817,8 +817,8 @@ \section{Riemann solvers}
817817
approximation does a reasonable job near the intersection and only
818818
diverges significantly for small $p$ (which is where the solution
819819
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}}}
822822
\end{figure}
823823

824824
An additional approximation concerns rarefactions. Recall that a
@@ -856,7 +856,7 @@ \section{Conservative update}
856856

857857
Once we have the fluxes, the conservative update is done as
858858
\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}
860860
\left ( \Fb_{i-\myhalf}^{n+\myhalf} - \Fb_{i+\myhalf}^{n+\myhalf} \right )
861861
\end{equation}
862862
The timestep, $\Delta t$ is determined by the time it takes for the
@@ -1152,7 +1152,7 @@ \section{Source terms}
11521152

11531153
Note that the source here is cell-centered. This expansion is
11541154
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
11561156
similarity of this source term to a second-order Euler method
11571157
for integrating ODEs.
11581158

@@ -1215,22 +1215,22 @@ \section{Source terms}
12151215
\end{align}
12161216
As written, this appears to be an implicit update (since $\Uc^{n+1}$
12171217
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.
12191219

12201220
Again, using a constant gravitational acceleration as an example, and
12211221
looking in 1-d for simplicity, $\Uc = (\rho, \rho u, \rho E)^\intercal$
12221222
and $\Hb = (0, \rho g, \rho u g)^\intercal$, so our update sequence is:
12231223
\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} -
12261226
\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 -
12291229
\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} -
12311231
p_{i+\myhalf}^{n+\myhalf} \right ) \nonumber \\
12321232
&+ \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}
12341234
\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 \\
12351235
&\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 ]
12361236
+ \frac{\Delta t}{2} \left [ (\rho u)^n + (\rho u)^{n+1} \right] g
@@ -1282,19 +1282,19 @@ \section{Simple geometries}
12821282
the same ideas as in \S~\ref{euler:sec:sourceterms}.
12831283

12841284
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
12871287
geometic factors. The update of the system appears as:
12881288
\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} -
12911291
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 -
12941294
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} -
12961296
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}
12981298
\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 \\
12991299
&\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 ]
13001300
\end{align}
@@ -1349,7 +1349,7 @@ \section{Simple geometries}
13491349
Just as with the 1-d spherical case, the pressure term in the momentum
13501350
equation needs to be treated separately from the flux, since it enters
13511351
as a gradient and not a divergence.\footnote{It is common to see the divergence
1352-
term expressed as
1352+
term expressed as
13531353
\begin{equation}
13541354
\nabla \cdot {\boldsymbol{\phi}} = \frac{1}{r^\alpha} \ddr{(r^\alpha \phi^{(r)})} + \ldots
13551355
\end{equation}
@@ -1541,7 +1541,7 @@ \subsection{Sedov blast wave}
15411541
\begin{figure}[t]
15421542
\centering
15431543
\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
15451545
profile for the 2-d Sedov explosion from Figure~\ref{fig:Euler:sedov2d} shown
15461546
with the analytic solution. This was constructed using the {\tt sedov\_compare.py}
15471547
script in \pyro.}
@@ -1552,7 +1552,7 @@ \subsection{Advection}
15521552

15531553
We can run a simple advection test analogous to the tests we used in
15541554
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
15561556
profile we want to advect in the density field and then put it in
15571557
pressure equilibrium by adjusting the internal energy. For example, consider
15581558
a Gaussian profile. We initialize the density as:
@@ -1598,9 +1598,9 @@ \subsection{Slow moving shock}
15981598
Slow moving (or stationary) shocks can be difficult to model, as
15991599
oscillations can be setup behind the shock (this is discussed a little
16001600
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
16021602
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.
16041604

16051605
The speed of a right-moving shock was found (see
16061606
Eq.~\ref{eq:euler:shockspeedjump}) as:
@@ -1619,7 +1619,7 @@ \subsection{Slow moving shock}
16191619
(which was the star state when we discussed the Riemann problem) using
16201620
the jump conditions, Eqs.~\ref{eq:euler:shockrhojump} and
16211621
\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
16231623
slow\_shock.py} will find the initial conditions to generate a
16241624
stationary shock.}
16251625

@@ -1660,7 +1660,7 @@ \subsection{Two-dimensional Riemann problems}
16601660
problems initialize the 4 quadrants of the domain with different
16611661
states, and watch the ensuing evolution. There are some
16621662
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
16641664
a code in the presence of complex flows. We use the setup
16651665
corresponding to {\em configuration 3} in that paper (this
16661666
same setup is used in \cite{leveque:1997}).
@@ -1811,12 +1811,12 @@ \subsection{General equation of state}
18111811

18121812
The above methods were formulated with a constant gamma equation of
18131813
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
18151815
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.
18201820

18211821
\subsubsection{Carrying $\gamma_e$}
18221822

@@ -1851,8 +1851,8 @@ \subsubsection{Carrying $\gamma_e$}
18511851
in the tracing in the construction of interface states%
18521852
\footnote{A {\sf Jupyter} notebook using {\sf SymPy} that derives these
18531853
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
18561856
our system as
18571857
\begin{equation}
18581858
\qb = \left ( \begin{array}{c} \tau \\ u \\ p \\ \gamma_e \end{array} \right )
@@ -1996,6 +1996,3 @@ \subsubsection{Carrying $(\rho e)$}
19961996
explicitly adds the transverse terms found in the multi-dimensional form
19971997
of Eq.~\ref{eq:euler:pgeneral}
19981998
to the normal states of $p$.
1999-
2000-
2001-

0 commit comments

Comments
 (0)