Skip to content

Commit

Permalink
more problem docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Sep 14, 2024
1 parent 1a2abc3 commit 557c7cd
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 32 deletions.
28 changes: 23 additions & 5 deletions docs/source/burgers_basics.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
*****************
Burgers' Equation
==================
*****************

Burgers' Equation is a nonlinear hyperbolic equation. It has the same form as the advection equation, except that the quantity being advected is the velocity itself.
Burgers' Equation is a nonlinear hyperbolic equation. It has the same
form as the advection equation, except that the quantity being
advected is the velocity itself.

``Inviscid Burgers``
--------------------------------
====================

A 2D inviscid Burgers' Equation has the following form:

Expand All @@ -29,14 +32,25 @@ The parameters for this solver are:

.. include:: burgers_defaults.inc

.. include:: burgers_problems.inc

Example
-------

.. image:: burgers.png
:align: center

The figure above is generated using ``burgers/problems/test.py``, which is used to test the validity of the solver. Bottom-left of the domain has a higher velocity than the top-right domain. With :math:`u_{i,j}=v_{i,j}`, the wave travels diagonally to the top-right with a constant velocity that is equal to the shock speed. ``burgers/problem/verify.py`` can be used to calculate the wave speed using outputs from ``test.py`` and compare to the theoretical shock speed.
The figure above is generated using ``burgers/problems/test.py``,
which is used to test the validity of the solver. Bottom-left of the
domain has a higher velocity than the top-right domain. With
:math:`u_{i,j}=v_{i,j}`, the wave travels diagonally to the top-right
with a constant velocity that is equal to the shock
speed. ``burgers/problem/verify.py`` can be used to calculate the wave
speed using outputs from ``test.py`` and compare to the theoretical
shock speed.

``Viscous Burgers``
--------------------------------
===================

A 2D viscous Burgers' Equation has the following form:

Expand All @@ -60,6 +74,10 @@ The parameters for this solver are:

.. include:: burgers_viscous_defaults.inc

.. include:: burgers_problems.inc

Example
-------

.. image:: viscous_burgers.png
:align: center
Expand Down
49 changes: 22 additions & 27 deletions docs/source/compressible_basics.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**********************************
Compressible hydrodynamics solvers
==================================
**********************************

The Euler equations of compressible hydrodynamics take the form:

Expand Down Expand Up @@ -27,7 +28,7 @@ direction is allowed.
directory in the solver's directory.

``compressible`` solver
-----------------------
=======================

:py:mod:`pyro.compressible` is based on a directionally unsplit (the corner
transport upwind algorithm) piecewise linear method for the Euler
Expand All @@ -38,8 +39,11 @@ The parameters for this solver are:

.. include:: compressible_defaults.inc

.. include:: compressible_problems.inc


``compressible_rk`` solver
--------------------------
==========================

:py:mod:`pyro.compressible_rk` uses a method of lines time-integration
approach with piecewise linear spatial reconstruction for the Euler
Expand All @@ -49,8 +53,10 @@ The parameters for this solver are:

.. include:: compressible_rk_defaults.inc

.. include:: compressible_rk_problems.inc

``compressible_fv4`` solver
---------------------------
===========================

:py:mod:`pyro.compressible_fv4` uses a 4th order accurate method with RK4
time integration, following :cite:`mccorquodalecolella`.
Expand All @@ -59,9 +65,10 @@ The parameter for this solver are:

.. include:: compressible_fv4_defaults.inc

.. include:: compressible_fv4_problems.inc

``compressible_sdc`` solver
---------------------------
===========================

:py:mod:`pyro.compressible_sdc` uses a 4th order accurate method with
spectral-deferred correction (SDC) for the time integration. This
Expand All @@ -72,9 +79,10 @@ The parameters for this solver are:

.. include:: compressible_sdc_defaults.inc

.. include:: compressible_sdc_problems.inc

Example problems
----------------
================

.. note::

Expand All @@ -88,7 +96,7 @@ Example problems


Sod
^^^
---

The Sod problem is a standard hydrodynamics problem. It is a
one-dimensional shock tube (two states separated by an interface),
Expand Down Expand Up @@ -119,7 +127,7 @@ is discussed in the notes above, and can be improved in the PPM method
with contact steepening.

Sedov
^^^^^
-----

The Sedov blast wave problem is another standard test with an analytic
solution (Sedov 1959). A lot of energy is point into a point in a
Expand Down Expand Up @@ -154,7 +162,7 @@ This shows good agreement with the analytic solution.


quad
^^^^
----

The quad problem sets up different states in four regions of the
domain and watches the complex interfaces that develop as shocks
Expand All @@ -172,7 +180,7 @@ online by Pawel Artymowicz). It is run as:


rt
^^
--

The Rayleigh-Taylor problem puts a dense fluid over a lighter one and
perturbs the interface with a sinusoidal velocity. Hydrostatic
Expand All @@ -192,7 +200,7 @@ escape the domain. It is run as:


bubble
^^^^^^
------

The bubble problem initializes a hot spot in a stratified domain and
watches it buoyantly rise and roll up. This is run as:
Expand All @@ -211,10 +219,10 @@ above that rains down on our atmosphere. Also note the acoustic signal
propagating outward from the bubble (visible in the U and e panels).

Exercises
---------
=========

Explorations
^^^^^^^^^^^^
------------

* Measure the growth rate of the Rayleigh-Taylor instability for
different wavenumbers.
Expand All @@ -228,7 +236,7 @@ Explorations


Extensions
^^^^^^^^^^
----------

* Limit on the characteristic variables instead of the primitive
variables. What changes do you see? (the notes show how to implement
Expand All @@ -246,16 +254,3 @@ Extensions
* Swap the piecewise linear reconstruction for piecewise parabolic
(PPM). The notes and the Miller and Colella paper provide a good basis
for this. Research the Roe Riemann solver and implement it in pyro.


Going further
-------------

The compressible algorithm presented here is essentially the
single-grid hydrodynamics algorithm used in the `Castro code <https://amrex-astro.github.io/Castro/>`_—an
adaptive mesh radiation hydrodynamics code developed at
CCSE/LBNL. `Castro is freely available for download <https://github.com/AMReX-Astro/Castro>`_.

A simple, pure Fortran, 1-d compressible hydrodynamics code that does
piecewise constant, linear, or parabolic (PPM) reconstruction is also
available. See the `hydro1d <https://zingale.github.io/hydro1d/>`_ page.

0 comments on commit 557c7cd

Please sign in to comment.