Skip to content

Commit 81c5d13

Browse files
committed
mpi + case opt + bug fixes + add tests + regression test + m_checker +
added int_comp varaibles + documentation
1 parent c8fce8a commit 81c5d13

File tree

108 files changed

+36865
-371
lines changed

Some content is hidden

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

108 files changed

+36865
-371
lines changed

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
cmake_minimum_required(VERSION 3.20)
1010

11-
set(CMAKE_Fortran_STANDARD 2008)
12-
1311
# We include C as a language because - for some reason -
1412
# FIND_LIBRARY_USE_LIB64_PATHS is otherwise ignored.
1513

cpu.txt

Lines changed: 14093 additions & 0 deletions
Large diffs are not rendered by default.

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
| `weno_order` | Integer | WENO order [1,3,5] |
383384
| `weno_eps` | Real | WENO perturbation (avoid division by zero) |
384385
| `mapped_weno` | Logical | WENO-M (WENO with mapping of nonlinear weights) |
@@ -388,6 +389,11 @@ Details of implementation of viscosity in MFC can be found in [Coralic (2015)](r
388389
| `teno_CT` | Real | TENO threshold for smoothness detection |
389390
| `null_weights` | Logical | Null WENO weights at boundaries |
390391
| `mp_weno` | Logical | Monotonicity preserving WENO |
392+
| `muscl_order` | Integer | MUSCL order [1,2] |
393+
| `muscl_lim` | Integer | MUSCL Slope Limiter: [1] minmod; [2] monotonized central; [3] Van Albada; [4] Van Leer; [5] SUPERBEE |
394+
| `int_comp` | Logical | THINC Interface Compression |
395+
| `ic_eps` | Real | Interface compression threshold (default: 1e-4) |
396+
| `ic_beta` | Real | Interface compression sharpness parameter (default: 1.6) |
391397
| `riemann_solver` | Integer | Riemann solver algorithm: [1] HLL*; [2] HLLC; [3] Exact*; [4] HLLD (only for MHD) |
392398
| `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) |
393399
| `avg_state` | Integer | Averaged state evaluation method: [1] Roe average*; [2] Arithmetic mean |
@@ -474,7 +480,14 @@ It is recommended to set `weno_eps` to $10^{-6}$ for WENO-JS, and to $10^{-40}$
474480

475481
- `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)).
476482

477-
- `riemann_solver` specifies the choice of the Riemann solver that is used in simulation by an integer from 1 through 3.
483+
- `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.
484+
485+
- `muscl_lim` specifies the slope limiter that is used in 2nd order MUSCL Reconstruction by an integer from 1 through 5.
486+
`muscl_lim = 1`, `2`, `3`, `4`, and `5` correspond to minmod, monotonized central, Van Albada, Van Leer, and SUPERBEE, respectively.
487+
488+
- `int_comp` activates interface compression using THINC used in MUSCL Reconstruction, with control parameters (`ic_eps`, and `ic_beta`).
489+
490+
- `riemann_solver` specifies the choice of the Riemann solver that is used in simulation by an integer from 1 through 4.
478491
`riemann_solver = 1`, `2`, and `3` correspond to HLL, HLLC, and Exact Riemann solver, respectively ([Toro, 2013](references.md)).
479492
`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)).
480493

examples/1D_sodshocktube_muscl/case.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@
3535
"time_stepper": 3,
3636
"recon_type": 2,
3737
"muscl_order": 2,
38-
# "weno_order": 5,
39-
# "weno_eps": 1.0e-16,
40-
# "weno_Re_flux": "F",
41-
# "weno_avg": "F",
42-
# "mapped_weno": "T",
38+
"muscl_lim": 2,
39+
# "weno_order": 5,
40+
# "weno_eps": 1.0e-16,
41+
# "weno_Re_flux": "F",
42+
# "weno_avg": "F",
43+
# "mapped_weno": "T",
4344
"null_weights": "F",
44-
# "mp_weno": "F",
45+
# "mp_weno": "F",
4546
"riemann_solver": 2,
4647
"wave_speeds": 1,
4748
"avg_state": 2,

examples/2D_advection_muscl/case.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,9 @@
2929
"time_stepper": 3,
3030
"recon_type": 2,
3131
"muscl_order": 2,
32-
#"weno_order": 5,
33-
#"weno_eps": 1.0e-16,
34-
#"weno_Re_flux": "F",
35-
#"weno_avg": "F",
36-
#"mapped_weno": "T",
32+
"muscl_lim": 2,
33+
"int_comp": "T",
3734
"null_weights": "F",
38-
#"mp_weno": "F",
3935
"riemann_solver": 2,
4036
"wave_speeds": 1,
4137
"avg_state": 2,
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
"riemann_solver": 2,
38+
"wave_speeds": 1,
39+
"avg_state": 2,
40+
"bc_x%beg": -3,
41+
"bc_x%end": -3,
42+
"bc_y%beg": -3,
43+
"bc_y%end": -3,
44+
# Formatted Database Files Structure Parameters
45+
"format": 1,
46+
"precision": 2,
47+
"prim_vars_wrt": "T",
48+
"parallel_io": "T",
49+
# Patch 1: Base
50+
"patch_icpp(1)%geometry": 3,
51+
"patch_icpp(1)%x_centroid": 0.4,
52+
"patch_icpp(1)%y_centroid": 0.4,
53+
"patch_icpp(1)%length_x": 0.8,
54+
"patch_icpp(1)%length_y": 0.8,
55+
"patch_icpp(1)%vel(1)": 4 / math.sqrt(11),
56+
"patch_icpp(1)%vel(2)": 4 / math.sqrt(11),
57+
"patch_icpp(1)%pres": 9 / 310,
58+
"patch_icpp(1)%alpha_rho(1)": 77 / 558,
59+
"patch_icpp(1)%alpha(1)": 1,
60+
# Patch 1: Base
61+
"patch_icpp(2)%geometry": 3,
62+
"patch_icpp(2)%x_centroid": 0.4,
63+
"patch_icpp(2)%y_centroid": 0.9,
64+
"patch_icpp(2)%length_x": 0.8,
65+
"patch_icpp(2)%length_y": 0.2,
66+
"patch_icpp(2)%vel(1)": 4 / math.sqrt(11),
67+
"patch_icpp(2)%vel(2)": 0,
68+
"patch_icpp(2)%pres": 0.3,
69+
"patch_icpp(2)%alpha_rho(1)": 33 / 62,
70+
"patch_icpp(2)%alpha(1)": 1,
71+
# Patch 1: Base
72+
"patch_icpp(3)%geometry": 3,
73+
"patch_icpp(3)%x_centroid": 0.9,
74+
"patch_icpp(3)%y_centroid": 0.4,
75+
"patch_icpp(3)%length_x": 0.2,
76+
"patch_icpp(3)%length_y": 0.8,
77+
"patch_icpp(3)%vel(1)": 0,
78+
"patch_icpp(3)%vel(2)": 4 / math.sqrt(11),
79+
"patch_icpp(3)%pres": 0.3,
80+
"patch_icpp(3)%alpha_rho(1)": 33 / 62,
81+
"patch_icpp(3)%alpha(1)": 1,
82+
# Patch 1: Base
83+
"patch_icpp(4)%geometry": 3,
84+
"patch_icpp(4)%x_centroid": 0.9,
85+
"patch_icpp(4)%y_centroid": 0.9,
86+
"patch_icpp(4)%length_x": 0.2,
87+
"patch_icpp(4)%length_y": 0.2,
88+
"patch_icpp(4)%vel(1)": 0,
89+
"patch_icpp(4)%vel(2)": 0,
90+
"patch_icpp(4)%pres": 1.5,
91+
"patch_icpp(4)%alpha_rho(1)": 1.5,
92+
"patch_icpp(4)%alpha(1)": 1.0,
93+
# Fluids Physical Parameters
94+
"fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00),
95+
"fluid_pp(1)%pi_inf": 0.0e00,
96+
}
97+
)
98+
)

examples/2D_shockdroplet/case.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
eps = 1e-9
1717

1818
D = 0.048
19-
Ny = 299.0
20-
Nx = 1199.0
19+
Ny = 99.0
20+
Nx = 399.0
2121
dx = 0.25 / Nx # 8.3e-6
2222

2323
time_end = 0.005 # 50us
@@ -47,7 +47,7 @@
4747
"dt": dt,
4848
"t_step_start": 0,
4949
"t_step_stop": Nt,
50-
"t_step_save": Nt, # math.ceil(Nt/100),
50+
"t_step_save": math.ceil(Nt/100),
5151
# Simulation Algorithm Parameters
5252
"num_patches": 3,
5353
"model_eqns": 2,
@@ -56,7 +56,7 @@
5656
"mpp_lim": "T",
5757
"mixture_err": "T",
5858
"time_stepper": 3,
59-
"weno_order": 5,
59+
"weno_order": 3,
6060
"weno_eps": 1.0e-16,
6161
"weno_Re_flux": "F",
6262
"weno_avg": "F",
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#!/usr/bin/env python3
2+
import math
3+
import json
4+
5+
Ma = 1.4
6+
ps = 238558
7+
rho_post_a = 2.18
8+
rho_a = 1.204
9+
rho_w = 1000
10+
gam_a = 1.4
11+
gam_w = 6.12
12+
pi_w = 3.43e8
13+
vel = 226
14+
rho = 1
15+
c_l = math.sqrt(1.4 * ps / rho)
16+
eps = 1e-9
17+
18+
D = 0.048
19+
Ny = 99.0
20+
Nx = 399.0
21+
dx = 0.25 / Nx # 8.3e-6
22+
23+
time_end = 0.005 # 50us
24+
cfl = 0.25
25+
26+
dt = cfl * dx / c_l # 5.3E-9
27+
Nt = int(time_end / dt) # 10000
28+
29+
print(
30+
json.dumps(
31+
{
32+
# Logistics
33+
"run_time_info": "F",
34+
# Computational Domain Parameters
35+
"x_domain%beg": -4 * D,
36+
"x_domain%end": 20 * D,
37+
"y_domain%beg": 0,
38+
"y_domain%end": 6 * D,
39+
"stretch_y": "T",
40+
"a_y": 3.67,
41+
"y_a": -5.7 * D,
42+
"y_b": 5.7 * D,
43+
"loops_y": 2,
44+
"m": int(Nx),
45+
"n": int(Ny),
46+
"p": 0,
47+
"dt": dt,
48+
"t_step_start": 0,
49+
"t_step_stop": Nt,
50+
"t_step_save": math.ceil(Nt/100),
51+
# Simulation Algorithm Parameters
52+
"num_patches": 3,
53+
"model_eqns": 2,
54+
"alt_soundspeed": "F",
55+
"num_fluids": 2,
56+
"mpp_lim": "T",
57+
"mixture_err": "T",
58+
"time_stepper": 3,
59+
"recon_type": 2,
60+
"muscl_order": 2,
61+
"muscl_lim": 4,
62+
"int_comp": "F",
63+
"null_weights": "F",
64+
"riemann_solver": 2,
65+
"wave_speeds": 1,
66+
"avg_state": 2,
67+
"bc_x%beg": -6, # 11,
68+
"bc_x%end": -6, # 12
69+
"bc_y%beg": -2,
70+
"bc_y%end": -3,
71+
# Formatted Database Files Structure Parameters
72+
"format": 1,
73+
"precision": 2,
74+
"prim_vars_wrt": "T",
75+
"parallel_io": "T",
76+
# Patch 1: Background
77+
"patch_icpp(1)%geometry": 3,
78+
"patch_icpp(1)%x_centroid": 8 * D,
79+
"patch_icpp(1)%y_centroid": 6 * D,
80+
"patch_icpp(1)%length_x": 24 * D,
81+
"patch_icpp(1)%length_y": 14 * D,
82+
"patch_icpp(1)%vel(1)": 0.0,
83+
"patch_icpp(1)%vel(2)": 0.0e00,
84+
"patch_icpp(1)%pres": 101325.0,
85+
"patch_icpp(1)%alpha_rho(1)": eps * 1000,
86+
"patch_icpp(1)%alpha_rho(2)": (1 - eps) * 1.17,
87+
"patch_icpp(1)%alpha(1)": eps,
88+
"patch_icpp(1)%alpha(2)": 1 - eps,
89+
# Patch 2: Shocked state
90+
"patch_icpp(2)%geometry": 3,
91+
"patch_icpp(2)%alter_patch(1)": "T",
92+
"patch_icpp(2)%x_centroid": -2.5 * D,
93+
"patch_icpp(2)%y_centroid": 6 * D,
94+
"patch_icpp(2)%length_x": 3 * D,
95+
"patch_icpp(2)%length_y": 14 * D,
96+
"patch_icpp(2)%vel(1)": vel,
97+
"patch_icpp(2)%vel(2)": 0.0e00,
98+
"patch_icpp(2)%pres": ps,
99+
"patch_icpp(2)%alpha_rho(1)": eps * 1000,
100+
"patch_icpp(2)%alpha_rho(2)": (1 - eps) * rho_post_a,
101+
"patch_icpp(2)%alpha(1)": eps,
102+
"patch_icpp(2)%alpha(2)": 1 - eps,
103+
# Patch 3: Bubble
104+
"patch_icpp(3)%geometry": 2,
105+
"patch_icpp(3)%x_centroid": 0,
106+
"patch_icpp(3)%y_centroid": 0,
107+
"patch_icpp(3)%radius": D / 2,
108+
"patch_icpp(3)%alter_patch(1)": "T",
109+
"patch_icpp(3)%vel(1)": 0.0,
110+
"patch_icpp(3)%vel(2)": 0.0e00,
111+
"patch_icpp(3)%pres": 101325.0,
112+
"patch_icpp(3)%alpha_rho(1)": (1 - eps) * rho_w,
113+
"patch_icpp(3)%alpha_rho(2)": eps * 1.17,
114+
"patch_icpp(3)%alpha(1)": 1 - eps, # 0.95
115+
"patch_icpp(3)%alpha(2)": eps, # 0.05,
116+
# Fluids Physical Parameters
117+
"fluid_pp(1)%gamma": 1.0e00 / (gam_w - 1.0e00),
118+
"fluid_pp(1)%pi_inf": pi_w * gam_w / (gam_w - 1.0e00),
119+
"fluid_pp(2)%gamma": 1.0e00 / (gam_a - 1.0e00),
120+
"fluid_pp(2)%pi_inf": 0.0e00,
121+
}
122+
)
123+
)

0 commit comments

Comments
 (0)