Skip to content

Commit

Permalink
allow non-smooth velocity/temperture in shock1d
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson2981 committed Dec 4, 2023
1 parent d18abb5 commit 0b249f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 0 additions & 2 deletions y3prediction/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,8 +1272,6 @@ def _compiled_stepper_wrapper(state, t, dt, rhs):
fuel_location[0] = fuel_loc_x

# parameters to adjust the shape of the initialization
vel_sigma = 1000
temp_sigma = 1250
temp_wall = 300

# normal shock properties
Expand Down
11 changes: 5 additions & 6 deletions y3prediction/shock1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ def __call__(self, dcoll, x_vec, eos, *, time=0.0):
dist = np.dot(x0_species - x_vec, self._normal)
xtanh = 1.0/self._sigma*dist
weight = 0.5*(1.0 - actx.np.tanh(xtanh))
y = self._yl + (self._yr - self._yl)*weight
y = np.zeros(self._nspecies, dtype=object)
if self._nspecies > 0:
y = self._yl + (self._yr - self._yl)*weight

# now solve for T, P, velocity
dist = np.dot(x0 - x_vec, self._normal)
Expand Down Expand Up @@ -171,11 +173,8 @@ def __call__(self, dcoll, x_vec, eos, *, time=0.0):
smoothing_bottom = smooth_step(actx, sigma*(ypos - y_bottom))
velocity[0] = velocity[0]*smoothing_top*smoothing_bottom

if self._nspecies:
mass = eos.get_density(pressure, temperature,
species_mass_fractions=y)
else:
mass = pressure/temperature/eos.gas_const()
mass = eos.get_density(pressure, temperature,
species_mass_fractions=y)

specmass = mass * y
mom = mass * velocity
Expand Down

0 comments on commit 0b249f4

Please sign in to comment.