Skip to content

Commit df454ad

Browse files
committed
cleanup
1 parent d2a4bb2 commit df454ad

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

adirondax/hydro/mhd2d.py

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ def get_flux_hlld(
185185
)
186186

187187
# Step 2
188-
# Compute left & right wave speeds according to Miyoshi & Kusano, eqn. (67)
189-
#
188+
# Compute left & right wave speeds according to Miyoshi & Kusano, eqn. (67)
190189

191190
pbl = 0.5 * (Bxi**2 + By_L**2)
192191
pbr = 0.5 * (Bxi**2 + By_R**2)
@@ -205,7 +204,6 @@ def get_flux_hlld(
205204

206205
# Step 3
207206
# Compute L/R fluxes
208-
#
209207

210208
# total pressure
211209
ptl = P_L + pbl
@@ -223,14 +221,12 @@ def get_flux_hlld(
223221
FR_By = By_R * vx_R - Bxi * vy_R
224222

225223
# Step 4
226-
# Return upwind flux if flow is supersonic
227-
#
224+
# Return upwind flux if flow is supersonic
228225

229226
# deferred to the end
230227

231228
# Step 5
232-
# Compute middle and Alfven wave speeds
233-
#
229+
# Compute middle and Alfven wave speeds
234230

235231
sdl = spd1 - vx_L
236232
sdr = spd5 - vx_R
@@ -254,7 +250,6 @@ def get_flux_hlld(
254250

255251
# Step 6
256252
# Compute intermediate states
257-
#
258253

259254
ptst = ptl + rho_L * sdl * (sdl - sdml)
260255

@@ -273,7 +268,7 @@ def get_flux_hlld(
273268
ULst_By = (By_L) * isDegen + (By_L * tmp) * (~isDegen)
274269

275270
vbstl = (ULst_Mx * Bxi + ULst_My * ULst_By) / ULst_d
276-
# eqn (48) of M&K#
271+
# eqn (48) of M&K
277272
ULst_E = (
278273
sdl * E_L - ptl * vx_L + ptst * spd3 + Bxi * (vx_L * Bxi + vy_L * By_L - vbstl)
279274
) / sdml
@@ -302,8 +297,8 @@ def get_flux_hlld(
302297

303298
WRst_vy = URst_My / URst_d
304299

305-
# Ul** and Ur** - if Bx is zero, same as * -states
306-
# if(Bxi == 0.0)
300+
# Ul** and Ur** - if Bx is zero, same as *-states
301+
# if(Bxi == 0.0)
307302
isDegen = 0.5 * Bxsq / jnp.minimum(pbl, pbr) < (epsilon) ** 2
308303
ULdst_d = ULst_d * isDegen
309304
ULdst_Mx = ULst_Mx * isDegen
@@ -349,8 +344,7 @@ def get_flux_hlld(
349344
URdst_E = URdst_E + (URst_E + sqrtdr * Bxsig * (vbstr - tmp)) * (~isDegen)
350345

351346
# Step 7
352-
# Compute flux
353-
#
347+
# Compute flux
354348

355349
flux_Mass = FL_d * (spd1 >= 0)
356350
flux_Momx = FL_Mx * (spd1 >= 0)
@@ -365,15 +359,15 @@ def get_flux_hlld(
365359
flux_By += FR_By * (spd5 <= 0)
366360

367361
# if(spd2 >= 0)
368-
# return Fl * #
362+
# return Fl*
369363
flux_Mass += (FL_d + spd1 * (ULst_d - rho_L)) * ((spd1 < 0) & (spd2 >= 0))
370364
flux_Momx += (FL_Mx + spd1 * (ULst_Mx - Mx_L)) * ((spd1 < 0) & (spd2 >= 0))
371365
flux_Momy += (FL_My + spd1 * (ULst_My - My_L)) * ((spd1 < 0) & (spd2 >= 0))
372366
flux_Energy += (FL_E + spd1 * (ULst_E - E_L)) * ((spd1 < 0) & (spd2 >= 0))
373367
flux_By += (FL_By + spd1 * (ULst_By - By_L)) * ((spd1 < 0) & (spd2 >= 0))
374368

375369
# elseif(spd3 >= 0)
376-
# return Fl * *
370+
# return Fl**
377371
tmp = spd2 - spd1
378372
flux_Mass += (FL_d - spd1 * rho_L - tmp * ULst_d + spd2 * ULdst_d) * (
379373
(spd2 < 0) & (spd3 >= 0)
@@ -392,7 +386,7 @@ def get_flux_hlld(
392386
)
393387

394388
# elseif(spd4 > 0)
395-
# return Fr * *
389+
# return Fr**
396390
tmp = spd4 - spd5
397391
flux_Mass += (FR_d - spd5 * rho_R - tmp * URst_d + spd4 * URdst_d) * (
398392
(spd3 < 0) & (spd4 > 0)
@@ -411,7 +405,7 @@ def get_flux_hlld(
411405
)
412406

413407
# else
414-
# return Fr *
408+
# return Fr*
415409
flux_Mass += (FR_d + spd5 * (URst_d - rho_R)) * ((spd4 <= 0) & (spd5 > 0))
416410
flux_Momx += (FR_Mx + spd5 * (URst_Mx - Mx_R)) * ((spd4 <= 0) & (spd5 > 0))
417411
flux_Momy += (FR_My + spd5 * (URst_My - My_R)) * ((spd4 <= 0) & (spd5 > 0))

0 commit comments

Comments
 (0)