Skip to content

Commit a1d1576

Browse files
okBrianwilfonbasbryngelson
authored
Adding MUSCL Reconstruction (#966)
Co-authored-by: Ben Wilfong <bwilfong3@gatech.edu> Co-authored-by: Spencer Bryngelson <sbryngelson@gmail.com> Co-authored-by: Spencer Bryngelson <shb@gatech.edu>
1 parent 37cdc6a commit a1d1576

File tree

92 files changed

+7683
-344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+7683
-344
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ They are organized below.
165165

166166
* Shock and interface capturing schemes
167167
* First-order upwinding
168-
* WENO reconstructions of order 3, 5, and 7
168+
* MUSCL (order 2)
169+
* Slope limiters: minmod, monotonized central, Van Albada, Van Leer, superbee
170+
* WENO reconstructions (orders 3, 5, and 7)
169171
* WENO variants: WENO-JS, WENO-M, WENO-Z, TENO
170172
* Monotonicity-preserving reconstructions
171173
* Reliable handling of large density ratios
@@ -187,7 +189,7 @@ They are organized below.
187189
* Ideal weak scaling to 100% of the largest GPU and superchip supercomputers
188190
* \>36K AMD APUs (MI300A) on [LLNL El Capitan](https://hpc.llnl.gov/hardware/compute-platforms/el-capitan)
189191
* \>3K AMD APUs (MI300A) on [LLNL Tuolumne](https://hpc.llnl.gov/hardware/compute-platforms/tuolumne)
190-
* \>33K AMD GPUs (MI250X) on the first exascale computer, [OLCF Frontier](https://www.olcf.ornl.gov/frontier/)
192+
* \>33K AMD GPUs (MI250X) on [OLCF Frontier](https://www.olcf.ornl.gov/frontier/)
191193
* \>10K NVIDIA GPUs (V100) on [OLCF Summit](https://www.olcf.ornl.gov/summit/)
192194
* Near compute roofline behavior
193195
* RDMA (remote data memory access; GPU-GPU direct communication) via GPU-aware MPI on NVIDIA (CUDA-aware MPI) and AMD GPU systems
@@ -197,7 +199,7 @@ They are organized below.
197199

198200
* [Fypp](https://fypp.readthedocs.io/en/stable/fypp.html) metaprogramming for code readability, performance, and portability
199201
* Continuous Integration (CI)
200-
* \>300 Regression tests with each PR.
202+
* Approx. 500 Regression tests with each PR.
201203
* Performed with GNU (GCC), Intel (oneAPI), Cray (CCE), and NVIDIA (NVHPC) compilers on NVIDIA and AMD GPUs.
202204
* Line-level test coverage reports via [Codecov](https://app.codecov.io/gh/MFlowCode/MFC) and `gcov`
203205
* Benchmarking to avoid performance regressions and identify speed-ups

docs/documentation/case.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ Details of implementation of viscosity in MFC can be found in [Coralic (2015)](r
379379
| `mixture_err` | Logical | Mixture properties correction |
380380
| `time_stepper` | Integer | Runge--Kutta order [1-3] |
381381
| `adap_dt` | Logical | Strang splitting scheme with adaptive time stepping |
382+
| `recon_type` | Integer | Reconstruction Type: [1] WENO; [2] MUSCL |
382383
| `adap_dt_tol` | Real | Tolerance for adaptive time stepping in Strang splitting scheme|
383384
| `adap_dt_max_iters` | Integer | Max iteration for adaptive time stepping in Strang splitting scheme |
384385
| `weno_order` | Integer | WENO order [1,3,5] |
@@ -390,6 +391,11 @@ Details of implementation of viscosity in MFC can be found in [Coralic (2015)](r
390391
| `teno_CT` | Real | TENO threshold for smoothness detection |
391392
| `null_weights` | Logical | Null WENO weights at boundaries |
392393
| `mp_weno` | Logical | Monotonicity preserving WENO |
394+
| `muscl_order` | Integer | MUSCL order [1,2] |
395+
| `muscl_lim` | Integer | MUSCL Slope Limiter: [1] minmod; [2] monotonized central; [3] Van Albada; [4] Van Leer; [5] SUPERBEE |
396+
| `int_comp` | Logical | THINC Interface Compression |
397+
| `ic_eps` | Real | Interface compression threshold (default: 1e-4) |
398+
| `ic_beta` | Real | Interface compression sharpness parameter (default: 1.6) |
393399
| `riemann_solver` | Integer | Riemann solver algorithm: [1] HLL*; [2] HLLC; [3] Exact*; [4] HLLD (only for MHD) |
394400
| `low_Mach` | Integer | Low Mach number correction for HLLC Riemann solver: [0] None; [1] Pressure (Chen et al. 2022); [2] Velocity (Thornber et al. 2008) |
395401
| `avg_state` | Integer | Averaged state evaluation method: [1] Roe average*; [2] Arithmetic mean |
@@ -476,7 +482,14 @@ It is recommended to set `weno_eps` to $10^{-6}$ for WENO-JS, and to $10^{-40}$
476482

477483
- `mp_weno` activates monotonicity preservation in the WENO reconstruction (MPWENO) such that the values of reconstructed variables do not reside outside the range spanned by WENO stencil ([Balsara and Shu, 2000](references.md); [Suresh and Huynh, 1997](references.md)).
478484

479-
- `riemann_solver` specifies the choice of the Riemann solver that is used in simulation by an integer from 1 through 3.
485+
- `muscl_order` specifies the order of the MUSCL scheme that is used for spatial reconstruction of variables by an integer of 1, or 2, that corresponds to the 1st, and 2nd order respectively. When using `muscl_order = 2`, `muscl_lim` must be defined.
486+
487+
- `muscl_lim` specifies the slope limiter that is used in 2nd order MUSCL Reconstruction by an integer from 1 through 5.
488+
`muscl_lim = 1`, `2`, `3`, `4`, and `5` correspond to minmod, monotonized central, Van Albada, Van Leer, and SUPERBEE, respectively.
489+
490+
- `int_comp` activates interface compression using THINC used in MUSCL Reconstruction, with control parameters (`ic_eps`, and `ic_beta`).
491+
492+
- `riemann_solver` specifies the choice of the Riemann solver that is used in simulation by an integer from 1 through 4.
480493
`riemann_solver = 1`, `2`, and `3` correspond to HLL, HLLC, and Exact Riemann solver, respectively ([Toro, 2013](references.md)).
481494
`riemann_solver = 4` is only for MHD simulations. It resolves 5 of the full seven-wave structure of the MHD equations ([Miyoshi and Kusano, 2005](references.md)).
482495

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/env python3
2+
import math
3+
import json
4+
5+
# Numerical setup
6+
Nx = 399
7+
dx = 1.0 / (1.0 * (Nx + 1))
8+
9+
Tend, Nt = 0.1, 1000
10+
mydt = Tend / (1.0 * Nt)
11+
12+
# Configuring case dictionary
13+
print(
14+
json.dumps(
15+
{
16+
# Logistics
17+
"run_time_info": "T",
18+
# Computational Domain Parameters
19+
"x_domain%beg": 0.0e00,
20+
"x_domain%end": 1.0e00,
21+
"m": Nx,
22+
"n": 0,
23+
"p": 0,
24+
"dt": mydt,
25+
"t_step_start": 0,
26+
"t_step_stop": int(Nt),
27+
"t_step_save": int(math.ceil(Nt / 10.0)),
28+
# Simulation Algorithm Parameters
29+
"num_patches": 2,
30+
"model_eqns": 2,
31+
"alt_soundspeed": "F",
32+
"num_fluids": 1,
33+
"mpp_lim": "F",
34+
"mixture_err": "F",
35+
"time_stepper": 3,
36+
"recon_type": 2,
37+
"muscl_order": 2,
38+
"muscl_lim": 2,
39+
"int_comp": "T",
40+
"riemann_solver": 2,
41+
"wave_speeds": 1,
42+
"avg_state": 2,
43+
"bc_x%beg": -3,
44+
"bc_x%end": -3,
45+
# Formatted Database Files Structure Parameters
46+
"format": 1,
47+
"precision": 2,
48+
"prim_vars_wrt": "T",
49+
"parallel_io": "T",
50+
# Patch 1 L
51+
"patch_icpp(1)%geometry": 1,
52+
"patch_icpp(1)%x_centroid": 0.25,
53+
"patch_icpp(1)%length_x": 0.5,
54+
"patch_icpp(1)%vel(1)": 0.0,
55+
"patch_icpp(1)%pres": 1.0,
56+
"patch_icpp(1)%alpha_rho(1)": 1.0e00,
57+
"patch_icpp(1)%alpha(1)": 1.0,
58+
# Patch 2 R
59+
"patch_icpp(2)%geometry": 1,
60+
"patch_icpp(2)%x_centroid": 0.75,
61+
"patch_icpp(2)%length_x": 0.5,
62+
"patch_icpp(2)%vel(1)": 0.0,
63+
"patch_icpp(2)%pres": 0.1,
64+
"patch_icpp(2)%alpha_rho(1)": 0.125e00,
65+
"patch_icpp(2)%alpha(1)": 1.0,
66+
# Fluids Physical Parameters
67+
"fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00),
68+
"fluid_pp(1)%pi_inf": 0.0,
69+
}
70+
)
71+
)

examples/2D_advection_muscl/case.py

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/usr/bin/env python3
2+
import json
3+
4+
# Configuring case dictionary
5+
print(
6+
json.dumps(
7+
{
8+
# Logistics
9+
"run_time_info": "T",
10+
# Computational Domain Parameters
11+
"x_domain%beg": 0.0e00,
12+
"x_domain%end": 1.0e00,
13+
"y_domain%beg": 0.0e00,
14+
"y_domain%end": 1.0e00,
15+
"m": 99,
16+
"n": 99,
17+
"p": 0,
18+
"dt": 5.0e-07,
19+
"t_step_start": 0,
20+
"t_step_stop": 1000,
21+
"t_step_save": 100,
22+
# Simulation Algorithm Parameters
23+
"num_patches": 2,
24+
"model_eqns": 3,
25+
"alt_soundspeed": "F",
26+
"num_fluids": 2,
27+
"mpp_lim": "T",
28+
"mixture_err": "T",
29+
"time_stepper": 3,
30+
"recon_type": 2,
31+
"muscl_order": 2,
32+
"muscl_lim": 2,
33+
"int_comp": "T",
34+
"null_weights": "F",
35+
"riemann_solver": 2,
36+
"wave_speeds": 1,
37+
"avg_state": 2,
38+
"bc_x%beg": -3,
39+
"bc_x%end": -3,
40+
"bc_y%beg": -3,
41+
"bc_y%end": -3,
42+
# Formatted Database Files Structure Parameters
43+
"format": 1,
44+
"precision": 2,
45+
"prim_vars_wrt": "T",
46+
"parallel_io": "T",
47+
# Patch 1: Base
48+
"patch_icpp(1)%geometry": 3,
49+
"patch_icpp(1)%x_centroid": 0.5e00,
50+
"patch_icpp(1)%y_centroid": 0.5e00,
51+
"patch_icpp(1)%length_x": 1.0e00,
52+
"patch_icpp(1)%length_y": 1.0e00,
53+
"patch_icpp(1)%vel(1)": 100.0e00,
54+
"patch_icpp(1)%vel(2)": 100.0e00,
55+
"patch_icpp(1)%pres": 1.0e05,
56+
"patch_icpp(1)%alpha_rho(1)": 1000.0e00,
57+
"patch_icpp(1)%alpha_rho(2)": 1.0,
58+
"patch_icpp(1)%alpha(1)": 1.0e-12,
59+
"patch_icpp(1)%alpha(2)": 1.0 - 1.0e-12,
60+
# Patch 2: Density to transport
61+
"patch_icpp(2)%geometry": 2,
62+
"patch_icpp(2)%smoothen": "T",
63+
"patch_icpp(2)%smooth_patch_id": 1,
64+
"patch_icpp(2)%smooth_coeff": 0.5e00,
65+
"patch_icpp(2)%x_centroid": 0.1e00,
66+
"patch_icpp(2)%y_centroid": 0.1e00,
67+
"patch_icpp(2)%radius": 0.1e00,
68+
"patch_icpp(2)%alter_patch(1)": "T",
69+
"patch_icpp(2)%vel(1)": 100.0e00,
70+
"patch_icpp(2)%vel(2)": 100.0e00,
71+
"patch_icpp(2)%pres": 1.0e05,
72+
"patch_icpp(2)%alpha_rho(1)": 1.0,
73+
"patch_icpp(2)%alpha_rho(2)": 1.0,
74+
"patch_icpp(2)%alpha(1)": 0,
75+
"patch_icpp(2)%alpha(2)": 1.0,
76+
# Fluids Physical Parameters
77+
"fluid_pp(1)%gamma": 1.0e00 / (2.35e00 - 1.0e00),
78+
"fluid_pp(1)%pi_inf": 2.35e00 * 1.0e09 / (2.35e00 - 1.0e00),
79+
"fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00),
80+
"fluid_pp(2)%pi_inf": 0.0e00,
81+
}
82+
)
83+
)
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#!/usr/bin/env python3
2+
import json
3+
import math
4+
5+
# Configuring case dictionary
6+
print(
7+
json.dumps(
8+
{
9+
# Logistics
10+
"run_time_info": "T",
11+
# Computational Domain Parameters
12+
"x_domain%beg": 0.0,
13+
"x_domain%end": 1.0,
14+
"y_domain%beg": 0.0,
15+
"y_domain%end": 1.0,
16+
"m": 499,
17+
"n": 499,
18+
"p": 0,
19+
"dt": 8e-05,
20+
"t_step_start": 0,
21+
"t_step_stop": 1000,
22+
"t_step_save": 100,
23+
# Simulation Algorithm Parameters
24+
"num_patches": 4,
25+
"model_eqns": 2,
26+
"alt_soundspeed": "F",
27+
"num_fluids": 1,
28+
"mpp_lim": "F",
29+
"mixture_err": "T",
30+
"time_stepper": 3,
31+
# "mp_weno": "F",
32+
"recon_type": 2,
33+
# "weno_order": 5,
34+
# "weno_eps": 1e-16,
35+
"muscl_order": 2,
36+
"muscl_lim": 1,
37+
"int_comp": "T",
38+
"riemann_solver": 2,
39+
"wave_speeds": 1,
40+
"avg_state": 2,
41+
"bc_x%beg": -3,
42+
"bc_x%end": -3,
43+
"bc_y%beg": -3,
44+
"bc_y%end": -3,
45+
# Formatted Database Files Structure Parameters
46+
"format": 1,
47+
"precision": 2,
48+
"prim_vars_wrt": "T",
49+
"parallel_io": "T",
50+
# Patch 1: Base
51+
"patch_icpp(1)%geometry": 3,
52+
"patch_icpp(1)%x_centroid": 0.4,
53+
"patch_icpp(1)%y_centroid": 0.4,
54+
"patch_icpp(1)%length_x": 0.8,
55+
"patch_icpp(1)%length_y": 0.8,
56+
"patch_icpp(1)%vel(1)": 4 / math.sqrt(11),
57+
"patch_icpp(1)%vel(2)": 4 / math.sqrt(11),
58+
"patch_icpp(1)%pres": 9 / 310,
59+
"patch_icpp(1)%alpha_rho(1)": 77 / 558,
60+
"patch_icpp(1)%alpha(1)": 1,
61+
# Patch 1: Base
62+
"patch_icpp(2)%geometry": 3,
63+
"patch_icpp(2)%x_centroid": 0.4,
64+
"patch_icpp(2)%y_centroid": 0.9,
65+
"patch_icpp(2)%length_x": 0.8,
66+
"patch_icpp(2)%length_y": 0.2,
67+
"patch_icpp(2)%vel(1)": 4 / math.sqrt(11),
68+
"patch_icpp(2)%vel(2)": 0,
69+
"patch_icpp(2)%pres": 0.3,
70+
"patch_icpp(2)%alpha_rho(1)": 33 / 62,
71+
"patch_icpp(2)%alpha(1)": 1,
72+
# Patch 1: Base
73+
"patch_icpp(3)%geometry": 3,
74+
"patch_icpp(3)%x_centroid": 0.9,
75+
"patch_icpp(3)%y_centroid": 0.4,
76+
"patch_icpp(3)%length_x": 0.2,
77+
"patch_icpp(3)%length_y": 0.8,
78+
"patch_icpp(3)%vel(1)": 0,
79+
"patch_icpp(3)%vel(2)": 4 / math.sqrt(11),
80+
"patch_icpp(3)%pres": 0.3,
81+
"patch_icpp(3)%alpha_rho(1)": 33 / 62,
82+
"patch_icpp(3)%alpha(1)": 1,
83+
# Patch 1: Base
84+
"patch_icpp(4)%geometry": 3,
85+
"patch_icpp(4)%x_centroid": 0.9,
86+
"patch_icpp(4)%y_centroid": 0.9,
87+
"patch_icpp(4)%length_x": 0.2,
88+
"patch_icpp(4)%length_y": 0.2,
89+
"patch_icpp(4)%vel(1)": 0,
90+
"patch_icpp(4)%vel(2)": 0,
91+
"patch_icpp(4)%pres": 1.5,
92+
"patch_icpp(4)%alpha_rho(1)": 1.5,
93+
"patch_icpp(4)%alpha(1)": 1.0,
94+
# Fluids Physical Parameters
95+
"fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00),
96+
"fluid_pp(1)%pi_inf": 0.0e00,
97+
}
98+
)
99+
)

0 commit comments

Comments
 (0)