Skip to content

Commit 3ed568e

Browse files
authored
add inviscid burger solver (#144)
add inviscid burger problem based on advection problem the interface state prediction follows the incompressible solver closely
1 parent 2fcec9a commit 3ed568e

26 files changed

Lines changed: 786 additions & 0 deletions

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ pyro provides the following solvers (all in 2-d):
132132
- `advection_weno`: a method-of-lines WENO solver for linear
133133
advection.
134134
135+
- `burgers': a second-order unsplit solver for invsicid Burgers' equation.
136+
135137
- `compressible`: a second-order unsplit solver for the Euler
136138
equations of compressible hydrodynamics. This uses characteristic
137139
tracing and corner coupling for the prediction of the interface

docs/source/burgers.png

35 KB
Loading

docs/source/burgers_basics.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Burgers' Equation
2+
==================
3+
4+
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.
5+
6+
``Inviscid Burgers``
7+
--------------------------------
8+
9+
A 2D Burgers' Equation has the following form:
10+
11+
.. math::
12+
13+
u_t + u u_x + v u_y = 0\\
14+
v_t + u v_x + v v_y = 0
15+
16+
Here we have two 2D advection equations, where the x-velocity, :math:`u`, and y-velocity, :math:`v`, are the two quantities that we wish to advect with.
17+
18+
:py:mod:`pyro.burgers` is modified based on the :py:mod:`pyro.advection` with a different Riemann solver and timestep restriction.
19+
20+
Since velocity is no longer a constant, the timestep is now restricted to the each minimum velocity in each cell:
21+
22+
.. math::
23+
24+
\Delta t < \min \left \{ \min \left \{ \frac{\Delta x}{|u_i|} \right \}, \min \left \{ \frac{\Delta y}{|v_i|} \right \} \right \}
25+
26+
The main difference of Burgers equation compared to the linear advection equation is the creation of shock and rarefactions due velocity been non-constant. This introduces a slightly different Riemann's problem which depends on shock speed by using the *Rankine-Hugoniot* jump condition.
27+
28+
The parameters for this solver are:
29+
30+
.. include:: burgers_defaults.inc
31+
32+
33+
.. image:: burgers.png
34+
:align: center
35+
36+
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.

docs/source/burgers_defaults.inc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
* section: [advection]
2+
3+
+----------------------------------+----------------+----------------------------------------------------+
4+
| option | value | description |
5+
+==================================+================+====================================================+
6+
| limiter | ``2`` | limiter (0 = none, 1 = 2nd order, 2 = 4th order) |
7+
+----------------------------------+----------------+----------------------------------------------------+
8+
9+
* section: [driver]
10+
11+
+----------------------------------+----------------+----------------------------------------------------+
12+
| option | value | description |
13+
+==================================+================+====================================================+
14+
| cfl | ``0.8`` | advective CFL number |
15+
+----------------------------------+----------------+----------------------------------------------------+
16+
17+
* section: [particles]
18+
19+
+----------------------------------+----------------+----------------------------------------------------+
20+
| option | value | description |
21+
+==================================+================+====================================================+
22+
| do_particles | ``0`` | |
23+
+----------------------------------+----------------+----------------------------------------------------+
24+
| particle_generator | ``grid`` | |
25+
+----------------------------------+----------------+----------------------------------------------------+
26+

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pyro: a python hydro code
3030
:caption: Solvers
3131

3232
advection_basics
33+
burgers_basics
3334
compressible_basics
3435
compressible_compare
3536
multigrid_basics
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
pyro.burgers.problems package
2+
===============================
3+
4+
.. automodule:: pyro.burgers.problems
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
9+
Submodules
10+
----------
11+
12+
pyro.burgers.problems.smooth module
13+
-------------------------------------
14+
15+
.. automodule:: pyro.burgers.problems.smooth
16+
:members:
17+
:undoc-members:
18+
:show-inheritance:
19+
20+
pyro.burgers.problems.tophat module
21+
-------------------------------------
22+
23+
.. automodule:: pyro.burgers.problems.tophat
24+
:members:
25+
:undoc-members:
26+
:show-inheritance:

docs/source/pyro.burgers.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
pyro.burgers package
2+
======================
3+
4+
.. automodule:: pyro.burgers
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
9+
Subpackages
10+
-----------
11+
12+
.. toctree::
13+
:maxdepth: 4
14+
15+
pyro.burgers.problems
16+
17+
Submodules
18+
----------
19+
20+
pyro.burgers.advective\_fluxes module
21+
---------------------------------------
22+
23+
.. automodule:: pyro.burgers.advective_fluxes
24+
:members:
25+
:undoc-members:
26+
:show-inheritance:
27+
28+
pyro.burgers.simulation module
29+
--------------------------------
30+
31+
.. automodule:: pyro.burgers.simulation
32+
:members:
33+
:undoc-members:
34+
:show-inheritance:

docs/source/pyro.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Subpackages
1717
pyro.advection_nonuniform
1818
pyro.advection_rk
1919
pyro.advection_weno
20+
pyro.burgers
2021
pyro.compressible
2122
pyro.compressible_fv4
2223
pyro.compressible_react

pyro/burgers/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""
2+
The pyro inviscid burgers solver. This implements a second-order,
3+
unsplit method for inviscid burgers equations based on the Colella 1990 paper.
4+
"""
5+
6+
__all__ = ['simulation']
7+
from .simulation import Simulation

pyro/burgers/_defaults

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[driver]
2+
cfl = 0.8 ; advective CFL number
3+
4+
5+
[advection]
6+
limiter = 2 ; limiter (0 = none, 1 = 2nd order, 2 = 4th order)
7+
8+
9+
[particles]
10+
do_particles = 0
11+
particle_generator = grid

0 commit comments

Comments
 (0)