Commit 5e9d629
JWL solver wiring: cons-prim conversions, sound speed, Riemann solvers (5-eq model)
Wire the JWL EOS into the solver hot path for the five-equation model
(model_eqns = 2, Allaire et al. JCP 2002). All changes are guarded by
jwl_idx > 0 and model_eqns == model_eqns_5eq so non-JWL cases are
unaffected.
m_variables_conversion:
- s_convert_conservative_to_primitive_variables: after s_compute_pressure
gives the stiffened-gas pressure, override it with s_jwl_mix_pressure_er
using Y = alpha_rho(jwl_idx)/rho and alpha = alpha(jwl_idx). Without
this, the solver uses the wrong EOS to recover pressure from conserved
variables, giving thermodynamically inconsistent primitive fields.
- s_convert_primitive_to_conservative_variables: add JWL branch that
computes E = rho*e_mix(rho,p,Y,alpha) + 0.5*rho|u|^2 + qv via
s_jwl_mix_energy_pr instead of the stiffened-gas E = gamma*p + pi_inf
formula, keeping prim->cons consistent with cons->prim.
- s_compute_speed_of_sound: add JWL branch using
s_jwl_mixture_sound_speed_squared (frozen mass-weighted rule). Accepts
an optional alpha_rho_j argument for the correct Y_j = alpha_rho_j/rho;
falls back to the rho0 proxy alpha_j*rho0/rho when not supplied (e.g.
avg-state calls).
- Export s_jwl_mixture_sound_speed_squared via the module public list.
m_riemann_solver_hll / m_riemann_solver_hllc:
- Add use m_jwl to both modules.
- In every E_L/E_R reconstruction block: when jwl_idx > 0 and 5-eq,
compute e_L/e_R from pressure via s_jwl_mix_energy_pr and form
E = rho*e + 0.5*rho|u|^2 instead of the stiffened-gas gamma*p + pi_inf
formula. This keeps the Riemann wave-speed estimates thermodynamically
consistent with the JWL EOS for both HLL and HLLC solvers.
- In m_riemann_solver_hll: pass alpha_rho_j to both s_compute_speed_of_sound
calls so the sound speed uses the actual phasic partial density for Y_j
rather than the rho0 proxy.1 parent d83068f commit 5e9d629
3 files changed
Lines changed: 130 additions & 18 deletions
File tree
- src
- common
- simulation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
693 | 694 | | |
694 | 695 | | |
695 | 696 | | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
696 | 709 | | |
697 | 710 | | |
698 | 711 | | |
| |||
939 | 952 | | |
940 | 953 | | |
941 | 954 | | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
942 | 965 | | |
943 | 966 | | |
944 | 967 | | |
| |||
1268 | 1291 | | |
1269 | 1292 | | |
1270 | 1293 | | |
1271 | | - | |
| 1294 | + | |
1272 | 1295 | | |
1273 | 1296 | | |
1274 | 1297 | | |
| |||
1280 | 1303 | | |
1281 | 1304 | | |
1282 | 1305 | | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
1288 | 1312 | | |
1289 | 1313 | | |
1290 | 1314 | | |
| |||
1294 | 1318 | | |
1295 | 1319 | | |
1296 | 1320 | | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
1297 | 1340 | | |
1298 | 1341 | | |
1299 | 1342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
318 | | - | |
319 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
320 | 336 | | |
321 | 337 | | |
322 | 338 | | |
| |||
356 | 372 | | |
357 | 373 | | |
358 | 374 | | |
359 | | - | |
| 375 | + | |
360 | 376 | | |
361 | 377 | | |
362 | | - | |
| 378 | + | |
363 | 379 | | |
364 | 380 | | |
365 | 381 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
245 | | - | |
246 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
247 | 262 | | |
248 | 263 | | |
249 | 264 | | |
| |||
612 | 627 | | |
613 | 628 | | |
614 | 629 | | |
615 | | - | |
616 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
617 | 646 | | |
618 | 647 | | |
619 | 648 | | |
| |||
871 | 900 | | |
872 | 901 | | |
873 | 902 | | |
874 | | - | |
875 | | - | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
876 | 917 | | |
877 | 918 | | |
878 | 919 | | |
| |||
1313 | 1354 | | |
1314 | 1355 | | |
1315 | 1356 | | |
1316 | | - | |
1317 | | - | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1318 | 1371 | | |
1319 | 1372 | | |
1320 | 1373 | | |
| |||
0 commit comments