Skip to content

Commit

Permalink
make the RT problem initial conditions symmetric (#216)
Browse files Browse the repository at this point in the history
this reduces roundoff
  • Loading branch information
zingale authored Aug 31, 2024
1 parent a8415d3 commit e9df7b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyro/compressible/problems/rt.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ def init_data(my_data, rp):

j += 1

ymom[:, :] = amp*np.cos(2.0*np.pi*myg.x2d/(myg.xmax-myg.xmin))*np.exp(-(myg.y2d-ycenter)**2/sigma**2)

L = myg.xmax-myg.xmin
ymom[:, :] = amp * 0.5 * (np.cos(2.0*np.pi*myg.x2d/L) +
np.cos(2.0*np.pi*(L - myg.x2d)/L)) * np.exp(-(myg.y2d-ycenter)**2/sigma**2)
ymom *= dens

# set the energy (P = cs2*dens)
Expand Down

0 comments on commit e9df7b2

Please sign in to comment.