Skip to content

Commit

Permalink
derivative bug fix in divu calculation (#263)
Browse files Browse the repository at this point in the history
divu in spherical is 1/r^2 d/dr(r^2 * u).
  • Loading branch information
zhichen3 authored Sep 9, 2024
1 parent 73d8038 commit d11ac15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyro/compressible/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ def artificial_viscosity(ng, dx, dy, Lx, Ly,
vb = 0.5 * (v[i, j - 1] + v[i - 1, j - 1])

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

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

0 comments on commit d11ac15

Please sign in to comment.