Skip to content

Commit

Permalink
temp change for mirgecom
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson2981 committed Jul 19, 2024
1 parent 41897b7 commit 1a3833f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
3 changes: 2 additions & 1 deletion buildMirge.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

# default branch for building mirgecom for this driver
mirge_branch="production"
#mirge_branch="production"
mirge_branch="use-pilot-loopy"
# conda environment name
conda_env="mirgeDriver.Y3prediction"

Expand Down
33 changes: 24 additions & 9 deletions y3prediction/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def _element_average_cv(dcoll, dd, cv, volumes=None):


def limit_fluid_state_liu(dcoll, cv, temperature_seed, gas_model, dd):
r"""Element average positivity preserving limiter
r"""lement average positivity preserving limiter
Follows loosely the implementation outline in Liu, et. al.
Limits the density and mass fractions based on global minima
Expand Down Expand Up @@ -629,8 +629,9 @@ def limit_fluid_state_lv(dcoll, cv, temperature_seed, gas_model, dd,
nspecies = cv.nspecies
dim = cv.dim
toler = 1.e-13
ones = actx.np.zeros_like(cv.mass)
element_vols = abs(op.elementwise_integral(dcoll, dd,
actx.zeros_like(cv.mass) + 1.0))
actx.np.zeros_like(cv.mass) + 1.0))

print_stuff = False
index = 118
Expand Down Expand Up @@ -676,7 +677,7 @@ def limit_fluid_state_lv(dcoll, cv, temperature_seed, gas_model, dd,
actx.np.greater(cell_avgs, rho_lim), cell_avgs, rho_lim)
#print(f"modified rho_avg {cell_avgs}")

theta_rho = actx.np.maximum(0.,
theta_rho = ones*actx.np.maximum(0.,
actx.np.where(actx.np.less(mmin_i + toler, mmin),
(mmin-mmin_i)/(cell_avgs - mmin_i),
0.)
Expand Down Expand Up @@ -776,7 +777,7 @@ def limit_fluid_state_lv(dcoll, cv, temperature_seed, gas_model, dd,
0.)
)

theta_spec[i] = _theta
theta_spec[i] = _theta*ones

#print(f"species {i}, {_theta=}")

Expand Down Expand Up @@ -975,7 +976,7 @@ def limit_fluid_state_lv(dcoll, cv, temperature_seed, gas_model, dd,
print(f"{theta_savg=}")
"""

theta_pressure = actx.np.maximum(0.,
theta_pressure = ones*actx.np.maximum(0.,
actx.np.where(actx.np.less(theta_smin_i + toler, mmin),
(mmin-theta_smin_i)/(theta_savg - theta_smin_i),
0.)
Expand Down Expand Up @@ -5643,10 +5644,10 @@ def compute_viz_fields_coupled(fluid_state, wv, wdv, time):

wv = wv + 0.*wall_rhs

av_smu = actx.zeros_like(cv.mass)
av_sbeta = actx.zeros_like(cv.mass)
av_skappa = actx.zeros_like(cv.mass)
av_sd = actx.zeros_like(cv.mass)
av_smu = actx.np.zeros_like(cv.mass)
av_sbeta = actx.np.zeros_like(cv.mass)
av_skappa = actx.np.zeros_like(cv.mass)
av_sd = actx.np.zeros_like(cv.mass)

# now compute the smoothness part
if use_av == 1:
Expand Down Expand Up @@ -5905,6 +5906,7 @@ def my_write_viz(step, t, t_wall, viz_state, viz_dv,
if viz_level > 2:

if use_species_limiter:
print(f"{theta_rho.shape=}")
viz_ext = [("theta_rho", theta_rho),
("theta_Y", theta_Y),
("theta_pressure", theta_pres)]
Expand Down Expand Up @@ -5969,6 +5971,19 @@ def my_write_viz(step, t, t_wall, viz_state, viz_dv,
for i in range(nspecies))
fluid_viz_fields.extend(viz_ext)

# write out the grid metrics
from grudge.geometry import inverse_metric_derivative_mat
metric = inverse_metric_derivative_mat(
actx, dcoll, dd_vol_fluid,
_use_geoderiv_connection=actx.supports_nonscalar_broadcasting)

viz_ext = [("metric_x", metric[0]),
("metric_y", metric[1])]
if dim == 3:
viz_ext.extend([("metric_z", metric[2])])

fluid_viz_fields.extend(viz_ext)

"""
if use_wall:
viz_ext = [("grad_temperature_wall", grad_wall_t)]
Expand Down

0 comments on commit 1a3833f

Please sign in to comment.