Skip to content

Commit d11ac15

Browse files
authored
derivative bug fix in divu calculation (#263)
divu in spherical is 1/r^2 d/dr(r^2 * u).
1 parent 73d8038 commit d11ac15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyro/compressible/interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ def artificial_viscosity(ng, dx, dy, Lx, Ly,
329329
vb = 0.5 * (v[i, j - 1] + v[i - 1, j - 1])
330330

331331
# Finite difference to get ux and vy
332-
ux = (ur*rr - ul*rl) / (rc * dx)
333-
vy = (sint*vt - sinb*vb) / (rc * sinc * dy)
332+
ux = (ur * rr * rr - ul * rl * rl) / (rc * rc * dx)
333+
vy = (sint * vt - sinb * vb) / (rc * sinc * dy)
334334

335335
# Find div(U)_{i-1/2, j-1/2}
336336
divU[i, j] = ux + vy

0 commit comments

Comments
 (0)