From 557c7cd14c9aa3701b3b77d9f99e180c1c071737 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Sat, 14 Sep 2024 18:15:19 -0400 Subject: [PATCH] more problem docs --- docs/source/burgers_basics.rst | 28 ++++++++++++++--- docs/source/compressible_basics.rst | 49 +++++++++++++---------------- 2 files changed, 45 insertions(+), 32 deletions(-) diff --git a/docs/source/burgers_basics.rst b/docs/source/burgers_basics.rst index 9f299d1ea..523ad6a9b 100644 --- a/docs/source/burgers_basics.rst +++ b/docs/source/burgers_basics.rst @@ -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: @@ -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: @@ -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 diff --git a/docs/source/compressible_basics.rst b/docs/source/compressible_basics.rst index deb7c1f44..5ee2ef74d 100644 --- a/docs/source/compressible_basics.rst +++ b/docs/source/compressible_basics.rst @@ -1,5 +1,6 @@ +********************************** Compressible hydrodynamics solvers -================================== +********************************** The Euler equations of compressible hydrodynamics take the form: @@ -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 @@ -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 @@ -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`. @@ -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 @@ -72,9 +79,10 @@ The parameters for this solver are: .. include:: compressible_sdc_defaults.inc +.. include:: compressible_sdc_problems.inc Example problems ----------------- +================ .. note:: @@ -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), @@ -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 @@ -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 @@ -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 @@ -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: @@ -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. @@ -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 @@ -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 `_—an -adaptive mesh radiation hydrodynamics code developed at -CCSE/LBNL. `Castro is freely available for download `_. - -A simple, pure Fortran, 1-d compressible hydrodynamics code that does -piecewise constant, linear, or parabolic (PPM) reconstruction is also -available. See the `hydro1d `_ page.