Skip to content

Commit 1fb1fd3

Browse files
Add WENO5 Variants (#481)
Co-authored-by: Cameron <[email protected]>
1 parent 41d51b7 commit 1fb1fd3

Some content is hidden

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

66 files changed

+5149
-59
lines changed

docs/documentation/case.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,17 @@ Details of implementation of viscosity in MFC can be found in [Coralic (2015)](r
360360
| `time_stepper` | Integer | Runge--Kutta order [1-3] |
361361
| `adap_dt` | Logical | Strang splitting scheme with adaptive time stepping |
362362
| `weno_order` | Integer | WENO order [1,3,5] |
363-
| `weno_eps` | Real | WENO perturbation (avoid division by zero) |
364-
| `mapped_weno` | Logical | WENO with mapping of nonlinear weights |
363+
| `weno_eps` | Real | WENO perturbation (avoid division by zero) |
364+
| `mapped_weno` | Logical | WENO-M (WENO with mapping of nonlinear weights) |
365+
| `wenoz` | Logical | WENO-Z |
366+
| `teno` | Logical | TENO (Targeted ENO) |
367+
| `teno_CT` | Real | TENO threshold for smoothness detection |
365368
| `null_weights` | Logical | Null WENO weights at boundaries |
366369
| `mp_weno` | Logical | Monotonicity preserving WENO |
367370
| `riemann_solver` | Integer | Riemann solver algorithm: [1] HLL*; [2] HLLC; [3] Exact* |
368-
| `avg_state` | Integer | Averaged state evaluation method: [1] Roe averagen*; [2] Arithmetic mean |
371+
| `avg_state` | Integer | Averaged state evaluation method: [1] Roe averagen*; [2] Arithmetic mean |
369372
| `wave_speeds` | Integer | Wave-speed estimation: [1] Direct (Batten et al. 1997); [2] Pressure-velocity* (Toro 1999) |
370-
| `weno_Re_flux` | Logical | Compute velocity gradient using scaler divergence theorem |
373+
| `weno_Re_flux` | Logical | Compute velocity gradient using scaler divergence theorem |
371374
| `weno_avg` | Logical | Arithmetic mean of left and right, WENO-reconstructed, cell-boundary values |
372375

373376
- \* Options that work only with `model_eqns =2`.
@@ -420,7 +423,13 @@ Note that `time_stepper = 3` specifies the total variation diminishing (TVD), th
420423
- `weno_eps` specifies the lower bound of the WENO nonlinear weights.
421424
Practically, `weno_eps` $<10^{-6}$ is used.
422425

423-
- `mapped_weno` activates mapping of the nonlinear WENO weights to the more accurate nonlinear weights in order to reinstate the optimal order of accuracy of the reconstruction in the proximity of critical points ([Henrick et al., 2005](references.md#Henrick05)).
426+
- `mapped_weno` activates the WENO-M scheme in place of the default WENO-JS scheme ([Henrick et al., 2005](references.md#Henrick05)). WENO-M a variant of the WENO scheme that remaps the nonlinear WENO-JS weights by assigning larger weights to non-smooth stencils, reducing dissipation compared to the default WENO-JS scheme, at the expense of higher computational cost. Only one of `mapped_weno`, `wenoz`, and `teno` can be activated.
427+
428+
- `wenoz` activates the WENO-Z scheme in place of the default WENO-JS scheme ([Borges et al., 2008](references.md#Borges08)). WENO-Z is a variant of the WENO scheme that further reduces the dissipation compared to the WENO-M scheme. It has similar computational cost to the WENO-JS scheme.
429+
430+
- `teno` activates the TENO scheme in place of the default WENO-JS scheme ([Fu et al., 2016](references.md#Fu16)). TENO is a variant of the ENO scheme that is the least dissipative, but could be less robust for extreme cases. It uses a threshold to identify smooth and non-smooth stencils, and applies optimal weights to the smooth stencils. Only available for `weno_order = 5`. Requires `teno_CT` to be set.
431+
432+
- `teno_CT` specifies the threshold for the TENO scheme. This dimensionless constant, also known as $C_T$, sets a threshold to identify smooth and non-smooth stencils. Larger values make the scheme more robust but also more dissipative. A recommended value for teno_CT is `1e-6`. When adjusting this parameter, it is recommended to try values like `1e-5` or `1e-7`.
424433

425434
- `null_weights` activates nullification of the nonlinear WENO weights at the buffer regions outside the domain boundaries when the Riemann extrapolation boundary condition is specified (`bc_[x,y,z]\%beg[end]} = -4`).
426435

docs/documentation/references.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
- <a id="Henrick05">Henrick, A. K., Aslam, T. D., and Powers, J. M. (2005). Mapped weighted essentially nonoscillatory schemes: achieving optimal order near critical points. Journal of Computational Physics, 207(2):542–567.</a>
2222

23+
- <a id="Borges08">Borges, R., Carmona, M., Costa, B., and Don, W. S. (2008). An improved weighted essentially non-oscillatory scheme for hyperbolic conservation laws. Journal of computational physics, 227(6):3191–3211.</a>
24+
25+
- <a id="Fu16">Fu, L., Hu, X. Y., and Adams, N. A. (2016). A family of high-order targeted ENO schemes for compressible-fluid simulations. Journal of Computational Physics, 305:333–359.</a>
26+
2327
- <a id="Johnsen08">Johnsen, E. (2008). Numerical simulations of non-spherical bubble collapse: With applications to shockwave lithotripsy. PhD thesis, California Institute of Technology.</a>
2428

2529
- <a id="Maeda17">Maeda, K. and Colonius, T. (2017). A source term approach for generation of one-way acoustic waves in the euler and navier–stokes equations. Wave Motion, 75:36–49.</a>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/1D_shuosher_teno/case.py

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#!/usr/bin/env python3
2+
3+
import math
4+
import json
5+
6+
# Numerical setup
7+
Nx = 1000
8+
dx = 1./(1.*(Nx+1))
9+
10+
Tend, Nt = 1.8, 2000
11+
mydt = Tend/(1.*Nt)
12+
13+
# Configuring case dictionary
14+
print(json.dumps({
15+
# Logistics ================================================================
16+
'run_time_info' : 'T',
17+
# ==========================================================================
18+
19+
# Computational Domain Parameters ==========================================
20+
'x_domain%beg' : 0.,
21+
'x_domain%end' : 10.,
22+
'm' : Nx,
23+
'n' : 0,
24+
'p' : 0,
25+
'dt' : mydt,
26+
't_step_start' : 0,
27+
't_step_stop' : int(Nt),
28+
't_step_save' : int(math.ceil(Nt/10.0)),
29+
# ==========================================================================
30+
31+
# Simulation Algorithm Parameters ==========================================
32+
'num_patches' : 2,
33+
'model_eqns' : 2,
34+
'alt_soundspeed' : 'F',
35+
'num_fluids' : 1,
36+
'adv_alphan' : 'T',
37+
'mpp_lim' : 'F',
38+
'mixture_err' : 'F',
39+
'time_stepper' : 3,
40+
'weno_order' : 5,
41+
'weno_eps' : 1.E-40,
42+
'teno' : 'T',
43+
'teno_CT' : 1.E-6,
44+
'null_weights' : 'F',
45+
'mp_weno' : 'F',
46+
'riemann_solver' : 2,
47+
'wave_speeds' : 1,
48+
'avg_state' : 2,
49+
'bc_x%beg' : -3,
50+
'bc_x%end' : -3,
51+
# ==========================================================================
52+
53+
# Formatted Database Files Structure Parameters ============================
54+
'format' : 2,
55+
'precision' : 2,
56+
'prim_vars_wrt' :'T',
57+
'rho_wrt' :'T',
58+
'parallel_io' :'T',
59+
# ==========================================================================
60+
61+
62+
# Background to cover whole domain with basic line patch
63+
# Patch 1 Left (0 < x < 1) ===============================================
64+
'patch_icpp(1)%geometry' : 1,
65+
'patch_icpp(1)%x_centroid' : 0.5,
66+
'patch_icpp(1)%length_x' : 1.,
67+
'patch_icpp(1)%vel(1)' : 2.629,
68+
'patch_icpp(1)%pres' : 10.333,
69+
'patch_icpp(1)%alpha_rho(1)' : 3.857,
70+
'patch_icpp(1)%alpha(1)' : 1.,
71+
# ==========================================================================
72+
73+
74+
# One anlytic patch to take care of 1 < x < 10
75+
# Patch 2 Analytic =========================================================
76+
'patch_icpp(2)%geometry' : 1,
77+
'patch_icpp(2)%x_centroid' : 5.5,
78+
'patch_icpp(2)%length_x' : 9.,
79+
'patch_icpp(2)%vel(1)' : 0.,
80+
'patch_icpp(2)%pres' : 1.,
81+
'patch_icpp(2)%alpha_rho(1)' : '1 + 0.2*sin(5*x)',
82+
'patch_icpp(2)%alpha(1)' : 1.,
83+
# ==========================================================================
84+
85+
# Fluids Physical Parameters ===============================================
86+
'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00),
87+
'fluid_pp(1)%pi_inf' : 0.0,
88+
# ==========================================================================
89+
}))
90+
91+
# ==============================================================================
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env python3
2+
3+
import math
4+
import json
5+
6+
# Numerical setup
7+
Nx = 1000
8+
dx = 1./(1.*(Nx+1))
9+
10+
Tend, Nt = 1.8, 2000
11+
mydt = Tend/(1.*Nt)
12+
13+
# Configuring case dictionary
14+
print(json.dumps({
15+
# Logistics ================================================================
16+
'run_time_info' : 'T',
17+
# ==========================================================================
18+
19+
# Computational Domain Parameters ==========================================
20+
'x_domain%beg' : 0.,
21+
'x_domain%end' : 10.,
22+
'm' : Nx,
23+
'n' : 0,
24+
'p' : 0,
25+
'dt' : mydt,
26+
't_step_start' : 0,
27+
't_step_stop' : int(Nt),
28+
't_step_save' : int(math.ceil(Nt/10.0)),
29+
# ==========================================================================
30+
31+
# Simulation Algorithm Parameters ==========================================
32+
'num_patches' : 2,
33+
'model_eqns' : 2,
34+
'alt_soundspeed' : 'F',
35+
'num_fluids' : 1,
36+
'adv_alphan' : 'T',
37+
'mpp_lim' : 'F',
38+
'mixture_err' : 'F',
39+
'time_stepper' : 3,
40+
'weno_order' : 5,
41+
'weno_eps' : 1.E-40,
42+
'mapped_weno' : 'F',
43+
'null_weights' : 'F',
44+
'mp_weno' : 'F',
45+
'riemann_solver' : 2,
46+
'wave_speeds' : 1,
47+
'avg_state' : 2,
48+
'bc_x%beg' : -3,
49+
'bc_x%end' : -3,
50+
# ==========================================================================
51+
52+
# Formatted Database Files Structure Parameters ============================
53+
'format' : 2,
54+
'precision' : 2,
55+
'prim_vars_wrt' :'T',
56+
'rho_wrt' :'T',
57+
'parallel_io' :'T',
58+
# ==========================================================================
59+
60+
61+
# Background to cover whole domain with basic line patch
62+
# Patch 1 Left (0 < x < 1) ===============================================
63+
'patch_icpp(1)%geometry' : 1,
64+
'patch_icpp(1)%x_centroid' : 0.5,
65+
'patch_icpp(1)%length_x' : 1.,
66+
'patch_icpp(1)%vel(1)' : 2.629,
67+
'patch_icpp(1)%pres' : 10.333,
68+
'patch_icpp(1)%alpha_rho(1)' : 3.857,
69+
'patch_icpp(1)%alpha(1)' : 1.,
70+
# ==========================================================================
71+
72+
73+
# One anlytic patch to take care of 1 < x < 10
74+
# Patch 2 Analytic =========================================================
75+
'patch_icpp(2)%geometry' : 1,
76+
'patch_icpp(2)%x_centroid' : 5.5,
77+
'patch_icpp(2)%length_x' : 9.,
78+
'patch_icpp(2)%vel(1)' : 0.,
79+
'patch_icpp(2)%pres' : 1.,
80+
'patch_icpp(2)%alpha_rho(1)' : '1 + 0.2*sin(5*x)',
81+
'patch_icpp(2)%alpha(1)' : 1.,
82+
# ==========================================================================
83+
84+
# Fluids Physical Parameters ===============================================
85+
'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00),
86+
'fluid_pp(1)%pi_inf' : 0.0,
87+
# ==========================================================================
88+
}))
89+
90+
# ==============================================================================

examples/1D_shuosher_wenom/case.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env python3
2+
3+
import math
4+
import json
5+
6+
# Numerical setup
7+
Nx = 1000
8+
dx = 1./(1.*(Nx+1))
9+
10+
Tend, Nt = 1.8, 2000
11+
mydt = Tend/(1.*Nt)
12+
13+
# Configuring case dictionary
14+
print(json.dumps({
15+
# Logistics ================================================================
16+
'run_time_info' : 'T',
17+
# ==========================================================================
18+
19+
# Computational Domain Parameters ==========================================
20+
'x_domain%beg' : 0.,
21+
'x_domain%end' : 10.,
22+
'm' : Nx,
23+
'n' : 0,
24+
'p' : 0,
25+
'dt' : mydt,
26+
't_step_start' : 0,
27+
't_step_stop' : int(Nt),
28+
't_step_save' : int(math.ceil(Nt/10.0)),
29+
# ==========================================================================
30+
31+
# Simulation Algorithm Parameters ==========================================
32+
'num_patches' : 2,
33+
'model_eqns' : 2,
34+
'alt_soundspeed' : 'F',
35+
'num_fluids' : 1,
36+
'adv_alphan' : 'T',
37+
'mpp_lim' : 'F',
38+
'mixture_err' : 'F',
39+
'time_stepper' : 3,
40+
'weno_order' : 5,
41+
'weno_eps' : 1.E-40,
42+
'mapped_weno' : 'T',
43+
'null_weights' : 'F',
44+
'mp_weno' : 'F',
45+
'riemann_solver' : 2,
46+
'wave_speeds' : 1,
47+
'avg_state' : 2,
48+
'bc_x%beg' : -3,
49+
'bc_x%end' : -3,
50+
# ==========================================================================
51+
52+
# Formatted Database Files Structure Parameters ============================
53+
'format' : 2,
54+
'precision' : 2,
55+
'prim_vars_wrt' :'T',
56+
'rho_wrt' :'T',
57+
'parallel_io' :'T',
58+
# ==========================================================================
59+
60+
61+
# Background to cover whole domain with basic line patch
62+
# Patch 1 Left (0 < x < 1) ===============================================
63+
'patch_icpp(1)%geometry' : 1,
64+
'patch_icpp(1)%x_centroid' : 0.5,
65+
'patch_icpp(1)%length_x' : 1.,
66+
'patch_icpp(1)%vel(1)' : 2.629,
67+
'patch_icpp(1)%pres' : 10.333,
68+
'patch_icpp(1)%alpha_rho(1)' : 3.857,
69+
'patch_icpp(1)%alpha(1)' : 1.,
70+
# ==========================================================================
71+
72+
73+
# One anlytic patch to take care of 1 < x < 10
74+
# Patch 2 Analytic =========================================================
75+
'patch_icpp(2)%geometry' : 1,
76+
'patch_icpp(2)%x_centroid' : 5.5,
77+
'patch_icpp(2)%length_x' : 9.,
78+
'patch_icpp(2)%vel(1)' : 0.,
79+
'patch_icpp(2)%pres' : 1.,
80+
'patch_icpp(2)%alpha_rho(1)' : '1 + 0.2*sin(5*x)',
81+
'patch_icpp(2)%alpha(1)' : 1.,
82+
# ==========================================================================
83+
84+
# Fluids Physical Parameters ===============================================
85+
'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00),
86+
'fluid_pp(1)%pi_inf' : 0.0,
87+
# ==========================================================================
88+
}))
89+
90+
# ==============================================================================

0 commit comments

Comments
 (0)