Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pyro/compressible/problems/convection.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ def init_data(my_data, rp):
ymom[:, :] = 0.0
dens[:, :] = dens_cutoff

# create a seeded random number generator
rng = np.random.default_rng(12345)

# set the density to be stratified in the y-direction
myg = my_data.grid

Expand Down Expand Up @@ -75,7 +78,7 @@ def init_data(my_data, rp):
ener[:, :] = p[:, :]/(gamma - 1.0)

# pairs of random numbers between [-1, 1]
vel_pert = 2.0 * np.random.random_sample((myg.qx, myg.qy, 2)) - 1
vel_pert = 2.0 * rng.random(size=(myg.qx, myg.qy, 2)) - 1

cs = np.sqrt(gamma * p / dens)

Expand Down
Loading