Skip to content

Commit

Permalink
Merge branch 'compressible_geometric_term' of github.com:zhichen3/pyr…
Browse files Browse the repository at this point in the history
…o2 into compressible_geometric_term
  • Loading branch information
zhichen3 committed Jul 21, 2024
2 parents 1ebe1ad + 1bdecc7 commit e272347
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 4 additions & 3 deletions pyro/compressible/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ def states(idir, ng, dx, dt,
q[irho] / cs, 0.0, 0.5 / (cs * cs)]
lvec[1, :ns] = [1.0, 0.0,
0.0, -1.0 / (cs * cs)]
lvec[2, :ns] = [0.0, 0.0, 1.0, 0.0]
lvec[2, :ns] = [0.0, 0.0, 1.0, 0.0]
lvec[3, :ns] = [0.0, 0.5 *
q[irho] / cs, 0.0, 0.5 / (cs * cs)]

rvec[0, :ns] = [1.0, -cs / q[irho], 0.0, cs * cs]
rvec[1, :ns] = [1.0, 0.0, 0.0, 0.0]
rvec[2, :ns] = [0.0, 0.0, 1.0, 0.0]
rvec[1, :ns] = [1.0, 0.0, 0.0, 0.0]
rvec[2, :ns] = [0.0, 0.0, 1.0, 0.0]
rvec[3, :ns] = [1.0, cs / q[irho], 0.0, cs * cs]

# now the species -- they only have a 1 in their corresponding slot
Expand Down Expand Up @@ -194,6 +194,7 @@ def states(idir, ng, dx, dt,
for m in range(nvar):
asum = np.dot(lvec[m, :], dq)

# Should we change to max(e_val[3], 0.0) and min(e_val[0], 0.0)?
betal[m] = dtdx4 * (e_val[3] - e_val[m]) * \
(np.copysign(1.0, e_val[m]) + 1.0) * asum
betar[m] = dtdx4 * (e_val[0] - e_val[m]) * \
Expand Down
9 changes: 4 additions & 5 deletions pyro/compressible/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,14 @@ def evolve(self):
old_ymom = ymom.copy()

# conservative update
dtdx = self.dt/myg.dx
dtdy = self.dt/myg.dy
dtdV = self.dt / g.V.v(n=n)

for n in range(self.ivars.nvar):
var = self.cc_data.get_var_by_index(n)

var.v()[:, :] += \
dtdx*(Flux_x.v(n=n) - Flux_x.ip(1, n=n)) + \
dtdy*(Flux_y.v(n=n) - Flux_y.jp(1, n=n))
var.v()[:, :] += dtdV * \
(Flux_x.v(n=n)*g.Ax_l.v(n=n) - Flux_x.ip(1, n=n)*g.Ax_r.v(n=n) +
Flux_y.v(n=n)*g.Ay_l.v(n=n) - Flux_y.jp(1, n=n)*g.Ay_r.v(n=n))

# gravitational source terms
ymom[:, :] += 0.5*self.dt*(dens[:, :] + old_dens[:, :])*grav
Expand Down

0 comments on commit e272347

Please sign in to comment.