Skip to content

Commit

Permalink
updates for mixing_layer_hot
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson2981 committed May 21, 2024
1 parent 86621ff commit 3e4db5f
Show file tree
Hide file tree
Showing 4 changed files with 467 additions and 166 deletions.
13 changes: 11 additions & 2 deletions y3prediction/mixing_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class MixingLayerHot:

def __init__(
self, *, dim=2, nspecies=0,
inflow_profile
inflow_profile,
pressure
):
r"""Initialize mixture parameters.
Expand All @@ -35,6 +36,7 @@ def __init__(

self._dim = dim
self._nspecies = nspecies
self._pressure = pressure

self._inflow_y = inflow_profile["y"]
self._inflow_rho = inflow_profile["rho"]
Expand Down Expand Up @@ -127,10 +129,17 @@ def __call__(self, dcoll, x_vec, eos, *, time=0.0):
e_bottom = e_top
mf_bottom = mf_top

# recompute the density from the temperature and pressure
# this avoids initial pertubations
r = eos.gas_const(species_mass_fractions=mf)
# compute the density from the temperature and pressure
rho = self._pressure/r/temperature
internal_energy = eos.get_internal_energy(temperature, mf)

velocity[0] = vmag
mom = velocity*rho
#internal_energy = eos.get_internal_energy(temperature, mf)
internal_energy = energy
#internal_energy = energy

kinetic_energy = 0.5 * np.dot(velocity, velocity)
total_energy = rho*(internal_energy + kinetic_energy)
Expand Down
4 changes: 3 additions & 1 deletion y3prediction/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2270,10 +2270,12 @@ def get_data_from_hdf5(group):

#print(f"{inflow_data=}")

pressure = 101325.
from y3prediction.mixing_layer import MixingLayerHot
bulk_init = MixingLayerHot(
dim=dim, nspecies=nspecies,
inflow_profile=inflow_data
inflow_profile=inflow_data,
pressure=pressure
)

elif init_case == "flame1d":
Expand Down
Loading

0 comments on commit 3e4db5f

Please sign in to comment.