Skip to content

Commit 653904d

Browse files
committed
add docs etc
1 parent e3ebd0a commit 653904d

File tree

9 files changed

+104
-9
lines changed

9 files changed

+104
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ They are organized below. Just click the drop-downs!
132132

133133
* Shock and interface capturing schemes
134134
* First-order upwinding
135-
* WENO reconstructions of order 3 and 5
135+
* WENO reconstructions of order 3, 5, and 7
136136
* WENO variants: WENO-JS, WENO-M, WENO-Z, TENO
137137
* Monotonicity-preserving reconstructions
138138
* Reliable handling of high density ratios

docs/documentation/case.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ For example, $m=n=p=499$ discretizes the domain into $500^3$ cells.
123123
When the simulation is 2D/axi-symmetric or 1D, it requires that $p=0$ or $p=n=0$, respectively.
124124

125125
- `stretch_[x,y,z]` activates grid stretching in the $[x,y,z]$ directions.
126-
The grid is gradually stretched such that the domain boundaries are pushed away from the origin along a specified axis.
126+
The grid is gradually stretched such that the domain boundaries are pushed away from the origin along a specified axis. WENO7 does not support grid stretching.
127127

128128
- `a_[x,y,z]`, `[x,y,z]_a`, and `[x,y,z]_b` are parameters that define the grid stretching function. When grid stretching along the $x$ axis is considered, the stretching function is given as:
129129

@@ -347,6 +347,7 @@ Details of implementation of viscosity in MFC can be found in [Coralic (2015)](r
347347
| `weno_eps` | Real | WENO perturbation (avoid division by zero) |
348348
| `mapped_weno` | Logical | WENO-M (WENO with mapping of nonlinear weights) |
349349
| `wenoz` | Logical | WENO-Z |
350+
| `wenoz_q` | Real | WENO-Z power parameter q (only for WENO7) |
350351
| `teno` | Logical | TENO (Targeted ENO) |
351352
| `teno_CT` | Real | TENO threshold for smoothness detection |
352353
| `null_weights` | Logical | Null WENO weights at boundaries |
@@ -406,18 +407,20 @@ Note that `time_stepper = 3` specifies the total variation diminishing (TVD), th
406407

407408
- `adap_dt` activates the Strang operator splitting scheme which splits flux and source terms in time marching, and an adaptive time stepping strategy is implemented for the source term. It requires ``bubbles = 'T'``, ``polytropic = 'T'``, ``adv_n = 'T'`` and `time_stepper = 3`.
408409

409-
- `weno_order` specifies the order of WENO scheme that is used for spatial reconstruction of variables by an integer of 1, 3, and 5, that correspond to the 1st, 3rd, and 5th order, respectively.
410+
- `weno_order` specifies the order of WENO scheme that is used for spatial reconstruction of variables by an integer of 1, 3, 5, and 7, that correspond to the 1st, 3rd, 5th, and 7th order, respectively. WENO7 does not support grid stretching.
410411

411412
- `weno_eps` specifies the lower bound of the WENO nonlinear weights.
412-
Practically, `weno_eps` $<10^{-6}$ is used.
413+
It is recommended to set `weno_eps` to $10^{-6}$ for WENO-JS, and to $10^{-40}$ for other WENO variants.
413414

414415
- `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.
415416

416417
- `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.
417418

418-
- `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.
419+
- `wenoz_q` specifies the power parameter `q` used in the WENO-Z scheme. It controls how aggressively the smoothness coefficients scale the weights. A higher value of `wenoz_q` increases the sensitivity to smoothness, improving stability but worsening numerical dissipation. For WENO3 and WENO5, `q=1` is fixed, so `wenoz_q` must not be set. For WENO7, `wenoz_q` can be set to 2, 3, or 4.
419420

420-
- `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`.
421+
- `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` and `7`. Requires `teno_CT` to be set.
422+
423+
- `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` for TENO5. A smaller value can be used for TENO7.
421424

422425
- `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`).
423426

File renamed without changes.

examples/1D_shuosher_teno7/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+
'mpp_lim' : 'F',
37+
'mixture_err' : 'F',
38+
'time_stepper' : 3,
39+
'weno_order' : 7,
40+
'weno_eps' : 1.E-40,
41+
'teno' : 'T',
42+
'teno_CT' : 1.E-9,
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_wenojs/case.py renamed to examples/1D_shuosher_wenojs5/case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
'mixture_err' : 'F',
3838
'time_stepper' : 3,
3939
'weno_order' : 5,
40-
'weno_eps' : 1.E-40,
40+
'weno_eps' : 1.E-6,
4141
'mapped_weno' : 'F',
4242
'null_weights' : 'F',
4343
'mp_weno' : 'F',
File renamed without changes.
File renamed without changes.

src/simulation/m_weno.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ contains
747747

748748
elseif (teno) then
749749
! Fu, et al. (2016)
750-
! Fu's code: https://dx.doi.org/10.13140/RG.2.2.36250.34247
750+
! Fu''s code: https://dx.doi.org/10.13140/RG.2.2.36250.34247
751751
tau = abs(beta(2) - beta(0))
752752
alpha = (1d0 + tau/beta)**6d0 ! Equation 22 (reuse alpha as gamma; pick C=1 & q=6)
753753
omega = alpha/sum(alpha) ! Equation 25 (reuse omega as xi)

toolchain/mfc/test/cases.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def alter_capillary():
8080
stack.pop()
8181

8282
def alter_weno():
83-
for weno_order in [3, 5]:
83+
for weno_order in [3, 5, 7]:
8484
stack.push(f"weno_order={weno_order}", {'weno_order': weno_order})
8585
for mapped_weno, wenoz, teno, mp_weno in itertools.product('FT', repeat=4):
8686

@@ -96,6 +96,8 @@ def alter_weno():
9696

9797
if "teno" in data:
9898
data["teno_CT"] = 1e-6
99+
if "wenoz" in data and weno_order == 7:
100+
data["wenoz_q"] = 3.0
99101

100102
cases.append(define_case_d(stack, trace, data))
101103

0 commit comments

Comments
 (0)