Skip to content

Commit a1a8124

Browse files
authored
remove the static compresssible compare page (#252)
and add the KH comparison to the new notebook this makes the comparison reproducible.
1 parent 2b2488e commit a1a8124

File tree

6 files changed

+212
-139
lines changed

6 files changed

+212
-139
lines changed

docs/source/compressible-rt-compare.ipynb

Lines changed: 197 additions & 6 deletions
Large diffs are not rendered by default.

docs/source/compressible_compare.rst

Lines changed: 0 additions & 119 deletions
This file was deleted.

docs/source/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ new ideas.
5959
advection_basics
6060
burgers_basics
6161
compressible_basics
62-
compressible_compare
6362
diffusion_basics
6463
incompressible_basics
6564
incompressible_viscous_basics
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
[kh]
22
rho_1 = 1
3-
v_1 = -1.0
3+
u_1 = -1.0
44

55
rho_2 = 2
6-
v_2 = 1.0
6+
u_2 = 1.0
7+
8+
bulk_velocity = 0.0
79

810

pyro/compressible/problems/inputs.kh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ cvisc = 0.1
1010

1111
[io]
1212
basename = kh_
13-
tplot = 0.01
1413

1514

1615
[eos]
@@ -32,10 +31,10 @@ yrboundary = periodic
3231

3332
[kh]
3433
rho_1 = 1
35-
v_1 = -0.5
34+
u_1 = -0.5
3635

3736
rho_2 = 2
38-
v_2 = 0.5
37+
u_2 = 0.5
3938

4039

4140
[vis]

pyro/compressible/problems/kh.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,18 @@ def init_data(my_data, rp):
3131
ymom[:, :] = 0.0
3232

3333
rho_1 = rp.get_param("kh.rho_1")
34-
v_1 = rp.get_param("kh.v_1")
34+
u_1 = rp.get_param("kh.u_1")
3535
rho_2 = rp.get_param("kh.rho_2")
36-
v_2 = rp.get_param("kh.v_2")
36+
u_2 = rp.get_param("kh.u_2")
37+
bulk_velocity = rp.get_param("kh.bulk_velocity")
3738

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

4041
myg = my_data.grid
4142

4243
dy = 0.025
4344
w0 = 0.01
44-
vm = 0.5*(v_1 - v_2)
45+
vm = 0.5*(u_1 - u_2)
4546
rhom = 0.5*(rho_1 - rho_2)
4647

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)