Skip to content

Commit

Permalink
remove the static compresssible compare page
Browse files Browse the repository at this point in the history
and add the KH comparison to the new notebook
this makes the comparison reproducible.
  • Loading branch information
zingale committed Sep 5, 2024
1 parent 2b2488e commit 01c5faa
Show file tree
Hide file tree
Showing 6 changed files with 212 additions and 139 deletions.
203 changes: 197 additions & 6 deletions docs/source/compressible-rt-compare.ipynb

Large diffs are not rendered by default.

119 changes: 0 additions & 119 deletions docs/source/compressible_compare.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ new ideas.
advection_basics
burgers_basics
compressible_basics
compressible_compare
diffusion_basics
incompressible_basics
incompressible_viscous_basics
Expand Down
6 changes: 4 additions & 2 deletions pyro/compressible/problems/_kh.defaults
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[kh]
rho_1 = 1
v_1 = -1.0
u_1 = -1.0

rho_2 = 2
v_2 = 1.0
u_2 = 1.0

bulk_velocity = 0.0


5 changes: 2 additions & 3 deletions pyro/compressible/problems/inputs.kh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ cvisc = 0.1

[io]
basename = kh_
tplot = 0.01


[eos]
Expand All @@ -32,10 +31,10 @@ yrboundary = periodic

[kh]
rho_1 = 1
v_1 = -0.5
u_1 = -0.5

rho_2 = 2
v_2 = 0.5
u_2 = 0.5


[vis]
Expand Down
17 changes: 9 additions & 8 deletions pyro/compressible/problems/kh.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ def init_data(my_data, rp):
ymom[:, :] = 0.0

rho_1 = rp.get_param("kh.rho_1")
v_1 = rp.get_param("kh.v_1")
u_1 = rp.get_param("kh.u_1")
rho_2 = rp.get_param("kh.rho_2")
v_2 = rp.get_param("kh.v_2")
u_2 = rp.get_param("kh.u_2")
bulk_velocity = rp.get_param("kh.bulk_velocity")

gamma = rp.get_param("eos.gamma")

myg = my_data.grid

dy = 0.025
w0 = 0.01
vm = 0.5*(v_1 - v_2)
vm = 0.5*(u_1 - u_2)
rhom = 0.5*(rho_1 - rho_2)

idx1 = myg.y2d < 0.25
Expand All @@ -53,23 +54,23 @@ def init_data(my_data, rp):

# lower quarter
dens[idx1] = rho_1 - rhom*np.exp((myg.y2d[idx1] - 0.25)/dy)
xmom[idx1] = v_1 - vm*np.exp((myg.y2d[idx1] - 0.25)/dy)
xmom[idx1] = u_1 - vm*np.exp((myg.y2d[idx1] - 0.25)/dy)

# second quarter
dens[idx2] = rho_2 + rhom*np.exp((0.25 - myg.y2d[idx2])/dy)
xmom[idx2] = v_2 + vm*np.exp((0.25 - myg.y2d[idx2])/dy)
xmom[idx2] = u_2 + vm*np.exp((0.25 - myg.y2d[idx2])/dy)

# third quarter
dens[idx3] = rho_2 + rhom*np.exp((myg.y2d[idx3] - 0.75)/dy)
xmom[idx3] = v_2 + vm*np.exp((myg.y2d[idx3] - 0.75)/dy)
xmom[idx3] = u_2 + vm*np.exp((myg.y2d[idx3] - 0.75)/dy)

# fourth quarter
dens[idx4] = rho_1 - rhom*np.exp((0.75 - myg.y2d[idx4])/dy)
xmom[idx4] = v_1 - vm*np.exp((0.75 - myg.y2d[idx4])/dy)
xmom[idx4] = u_1 - vm*np.exp((0.75 - myg.y2d[idx4])/dy)

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

p = 2.5
ener[:, :] = p/(gamma - 1.0) + 0.5*(xmom[:, :]**2 + ymom[:, :]**2)/dens[:, :]
Expand Down

0 comments on commit 01c5faa

Please sign in to comment.