Skip to content

Commit

Permalink
update riemann_flux
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 committed Aug 29, 2024
1 parent 12750e4 commit 5f6e593
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions pyro/compressible/riemann.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def riemann_prim(idir, ng,


@njit(cache=True)
def riemann_hllc(idir, ng, coord_type,
def riemann_hllc(idir, ng,
idens, ixmom, iymom, iener, irhoX, nspec,
lower_solid, upper_solid, # pylint: disable=unused-argument
gamma, U_l, U_r):
Expand Down Expand Up @@ -627,6 +627,9 @@ def riemann_hllc(idir, ng, coord_type,
Conserved flux
"""

# Only Cartesian2d is supported in HLLC
coord_type = 0

qx, qy, nvar = U_l.shape

F = np.zeros((qx, qy, nvar))
Expand Down Expand Up @@ -898,19 +901,18 @@ def riemann_flux(idir, U_l, U_r, my_data, rp, ivars,
riemann_method = rp.get_param("compressible.riemann")
gamma = rp.get_param("eos.gamma")

riemannFunc = None
if riemann_method == "HLLC":
riemannFunc = riemann_hllc
elif riemann_method == "CGF":
riemannFunc = riemann_cgf
else:
riemann_solvers = {"HLLC": riemann_hllc, "CGF": riemann_cgf}

if riemann_method not in riemann_solvers:
msg.fail("ERROR: Riemann solver undefined")

_f = riemannFunc(idir, myg.ng, myg.coord_type,
ivars.idens, ivars.ixmom, ivars.iymom,
ivars.iener, ivars.irhox, ivars.naux,
lower_solid, upper_solid,
gamma, U_l, U_r)
riemannFunc = riemann_solvers[riemann_method]

_f = riemann_hllc(idir, myg.ng,
ivars.idens, ivars.ixmom, ivars.iymom,
ivars.iener, ivars.irhox, ivars.naux,
lower_solid, upper_solid,
gamma, U_l, U_r)

# If riemann_method is not HLLC, then it outputs interface conserved states
if riemann_method != "HLLC":
Expand Down

0 comments on commit 5f6e593

Please sign in to comment.