Skip to content

Commit 7e2f49f

Browse files
authored
add docstrings to all the compressible problem setups (#272)
1 parent 903285e commit 7e2f49f

14 files changed

Lines changed: 57 additions & 3 deletions

File tree

pyro/compressible/problems/acoustic_pulse.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""The acoustic pulse problem described in McCorquodale & Colella
2+
2011. This uses a uniform background and a small pressure
3+
perturbation that drives a low Mach number soundwave. This problem is
4+
useful for testing convergence of a compressible solver.
5+
6+
"""
7+
18
import numpy as np
29

310
from pyro.util import msg
@@ -10,7 +17,7 @@
1017

1118
def init_data(myd, rp):
1219
"""initialize the acoustic_pulse problem. This comes from
13-
McCourquodale & Coella 2011"""
20+
McCorquodale & Coella 2011"""
1421

1522
if rp.get_param("driver.verbose"):
1623
msg.bold("initializing the acoustic pulse problem...")

pyro/compressible/problems/advect.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""A simple advection test. A density perturbation is set with a
2+
constant pressure in the domain and a velocity field is set to advect
3+
the profile across the domain. This is useful for testing
4+
convergence.
5+
6+
"""
7+
18
import numpy as np
29

310
from pyro.util import msg

pyro/compressible/problems/bubble.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""A buoyant perturbation (bubble) is placed in an isothermal
2+
hydrostatic atmosphere (plane-parallel). It will rise and deform (due
3+
to shear)"""
4+
15
import numpy as np
26

37
from pyro.util import msg

pyro/compressible/problems/gresho.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""The Gresho vortex problem sets up a toroidal velocity field that is
2+
balanced by a radial pressure gradient. This is in equilibrium and
3+
the state should remain unchanged in time. This version of the problem
4+
is based on Miczek, Roepke, and Edelmann 2014."""
5+
16
import numpy as np
27

38
from pyro.util import msg

pyro/compressible/problems/hse.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""Initialize an isothermal hydrostatic atmosphere. It should remain
2+
static. This is a test of our treatment of the gravitational source
3+
term."""
4+
15
import numpy as np
26

37
from pyro.util import msg

pyro/compressible/problems/kh.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""A Kelvin-Helmholtz shear problem. There are 2 shear layers, with the and an optional
2+
vertical bulk velocity. This can be used to test the numerical dissipation in the solver.
3+
This setup is based on McNally et al. 2012."""
4+
15
import numpy as np
26

37
from pyro.util import msg
@@ -68,7 +72,6 @@ def init_data(my_data, rp):
6872
dens[idx4] = rho_1 - rhom*np.exp((0.75 - myg.y2d[idx4])/dy)
6973
xmom[idx4] = u_1 - vm*np.exp((0.75 - myg.y2d[idx4])/dy)
7074

71-
# upper half
7275
xmom[:, :] *= dens
7376
ymom[:, :] = dens * (bulk_velocity + w0 * np.sin(4*np.pi*myg.x2d))
7477

pyro/compressible/problems/logo.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
"""Generate the pyro logo! The word "pyro" is written in the center
2+
of the domain and perturbations are placed in the 4 corners to drive
3+
converging shocks inward to scramble the logo.
4+
5+
"""
6+
17
import matplotlib.pyplot as plt
28
import numpy as np
39

pyro/compressible/problems/quad.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
"""The quadrant problem from Shulz-Rinne et al. 1993; Lax and Lui 1998.
2+
Four different states are initialized in the quadrants of the domain, driving
3+
shocks and other hydrodynamic waves at the interfaces. This can be used to
4+
test the symmetry of the solver.
5+
"""
6+
17
import numpy as np
28

39
from pyro.util import msg

pyro/compressible/problems/ramp.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
"""A shock hitting a ramp at an oblique angle. This is based on
2+
Woodward & Colella 1984."""
3+
14
import math
25

36
import numpy as np

pyro/compressible/problems/rt.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""A single-mode Rayleigh-Taylor instability."""
2+
13
import numpy as np
24

35
from pyro.util import msg

0 commit comments

Comments
 (0)