Skip to content

Commit 831cbdc

Browse files
author
Mark Zhang
committed
Add 3 new examples. (2D_kelvin_helmholtz, 2D_richtmyer_meshkov, 2D_viscous_shock_tube)
1 parent 22af239 commit 831cbdc

File tree

13 files changed

+421
-0
lines changed

13 files changed

+421
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Kelvin-Helmholtz Instability (2D)
2+
3+
Reference:
4+
> A.S. Chamarthi, S.H. Frankel, A. Chintagunta, Implicit gradients based novel finite volume scheme for compressible single and multi-component flows, arXiv preprint arXiv:2106.01738 (2021).
5+
6+
**Key Parameters**
7+
8+
* $\gamma = 5/3$
9+
10+
**Initial Conditions**
11+
12+
* **Spatial Domain:** $(x, y) \in [0, 1] \times [0, 1]$
13+
14+
$$
15+
p = 2.5, \rho(x, y) = \begin{cases}
16+
2, \text{if } 0.25 < y \leq 0.75\\
17+
1, \text{else, }\\
18+
\end{cases}
19+
$$
20+
21+
$$
22+
u(x, y) = \begin{cases}
23+
0.5, \text{if } 0.25 < y \leq 0.75\\
24+
-0.5, \text{else, }
25+
\end{cases}
26+
$$
27+
28+
$$
29+
v(x, y) = 0.1 \sin(4\pi x) \left[ \exp\left( -\frac{(y-0.75)^2}{2\sigma^2} \right) + \exp\left( -\frac{(y-0.25)^2}{2\sigma^2} \right) \right]
30+
$$
31+
32+
where $\sigma = \frac{0.05}{\sqrt{2}}$.
33+
34+
### Initial State
35+
<img src="figure0.png" height="MAX_HEIGHT"/>
36+
37+
### Evolved State
38+
<img src="figure1.png" height="MAX_HEIGHT"/>
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env python3
2+
import json
3+
import math
4+
5+
6+
eps = 1e-6
7+
time_end = 1.0
8+
time_save = time_end / 100.0
9+
10+
# Configuring case dictionary
11+
print(
12+
json.dumps(
13+
{
14+
# Logistics
15+
"run_time_info": "T",
16+
# Computational Domain Parameters
17+
"x_domain%beg": 0,
18+
"x_domain%end": 1.0,
19+
"y_domain%beg": 0,
20+
"y_domain%end": 1.0,
21+
"m": 512,
22+
"n": 512,
23+
"p": 0,
24+
"cfl_adap_dt": "T",
25+
"cfl_target": 0.2,
26+
"n_start": 0,
27+
"t_stop": time_end,
28+
"t_save": time_save,
29+
# Simulation Algorithm Parameters
30+
"num_patches": 2,
31+
"model_eqns": 2,
32+
"alt_soundspeed": "F",
33+
"num_fluids": 2,
34+
"mpp_lim": "T",
35+
"mixture_err": "T",
36+
"time_stepper": 3,
37+
"weno_order": 5,
38+
"weno_eps": 1.0e-10,
39+
"null_weights": "F",
40+
"mp_weno": "F",
41+
"riemann_solver": 1,
42+
"wave_speeds": 1,
43+
"avg_state": 2,
44+
"bc_x%beg": -1,
45+
"bc_x%end": -1,
46+
"bc_y%beg": -1,
47+
"bc_y%end": -1,
48+
# Formatted Database Files Structure Parameters
49+
"format": 1,
50+
"precision": 2,
51+
"prim_vars_wrt": "T",
52+
"parallel_io": "T",
53+
# Background
54+
"patch_icpp(1)%geometry": 3,
55+
"patch_icpp(1)%hcid": 207,
56+
"patch_icpp(1)%x_centroid": 0.5,
57+
"patch_icpp(1)%y_centroid": 0.5,
58+
"patch_icpp(1)%length_x": 1.0,
59+
"patch_icpp(1)%length_y": 1.0,
60+
"patch_icpp(1)%vel(1)": -0.5,
61+
"patch_icpp(1)%vel(2)": 0.0,
62+
"patch_icpp(1)%pres": 2.5,
63+
"patch_icpp(1)%alpha_rho(1)": 1.0 - eps,
64+
"patch_icpp(1)%alpha(1)": 1.0 - eps,
65+
"patch_icpp(1)%alpha_rho(2)": eps,
66+
"patch_icpp(1)%alpha(2)": eps,
67+
# Center Strip (0.25 < y <= 0.75)
68+
"patch_icpp(2)%geometry": 3,
69+
"patch_icpp(2)%alter_patch(1)": "T",
70+
"patch_icpp(2)%hcid": 207,
71+
"patch_icpp(2)%x_centroid": 0.5,
72+
"patch_icpp(2)%y_centroid": 0.5,
73+
"patch_icpp(2)%length_x": 1.0,
74+
"patch_icpp(2)%length_y": 0.5,
75+
"patch_icpp(2)%vel(1)": 0.5,
76+
"patch_icpp(2)%vel(2)": 0.0,
77+
"patch_icpp(2)%pres": 2.5,
78+
"patch_icpp(2)%alpha_rho(1)": 2.0 * eps,
79+
"patch_icpp(2)%alpha(1)": eps,
80+
"patch_icpp(2)%alpha_rho(2)": 2.0 * (1.0 - eps),
81+
"patch_icpp(2)%alpha(2)": 1.0 - eps,
82+
# Fluids Physical Parameters
83+
"fluid_pp(1)%gamma": 1.0e00 / (5.0 / 3.0 - 1.0e00),
84+
"fluid_pp(1)%pi_inf": 0.0e00,
85+
"fluid_pp(2)%gamma": 1.0e00 / (5.0 / 3.0 - 1.0e00),
86+
"fluid_pp(2)%pi_inf": 0.0e00,
87+
}
88+
)
89+
)
90+
55.3 KB
Loading
962 KB
Loading
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Richtmyer-Meshkov Instability (2D)
2+
3+
Reference:
4+
> A.S. Chamarthi, S.H. Frankel, A. Chintagunta, Implicit gradients based novel finite volume scheme for compressible single and multi-component flows, arXiv preprint arXiv:2106.01738 (2021)., see Example 4.18
5+
6+
**Key Parameters**
7+
8+
* $\lambda = 1.0$
9+
* $Re = 1e4$
10+
11+
**Initial Conditions**
12+
13+
* **Spatial Domain:** $(x, y) \in [0, 16\lambda] \times [0, \lambda]$
14+
15+
The domain is divided into three regions: Post-shock Air, Pre-shock Air, and SF6. The shock position is given by $x_{shock}=0.7\lambda$. The interface position $x_{int}(y)$ is defined by the sinusoidal perturbation:
16+
17+
$$
18+
x_{int}(y) = \lambda \left[ 0.4 - 0.1 \sin\left( 2\pi \left( \frac{y}{\lambda} + 0.25 \right) \right) \right]
19+
$$
20+
21+
The initial state is given by:
22+
23+
$$
24+
(\rho, u, v, p, \gamma) =
25+
\begin{cases}
26+
(1.4112, 0.8787, 0, 1.6272/1.4, 1.4) & \text{if } x > x_{shock} \quad \text{(Post-shock Air)} \\
27+
(1.0, 1.24, 0, 1/1.4, 1.4) & \text{if } x_{int}(y) < x \leq x_{shock} \quad \text{(Pre-shock Air)} \\
28+
(5.04, 1.24, 0, 1/1.4, 1.093) & \text{if } x \leq x_{int}(y) \quad \text{(SF6)} \\
29+
\end{cases}
30+
$$
31+
32+
The initial perturbation is then smoothed by
33+
$$f_{sm} = \frac{1}{2}\left(1 + \text{erf}\left(\frac{\Delta D}{E_i\sqrt{\Delta x \Delta y}}\right)\right)$$
34+
35+
$$u = u_L(1 - f_{sm}) + u_Rf_{sm}$$
36+
37+
where $u$ is each primitive variable. $E_i$ is a thickness constant, and $\Delta D$ is the signed horizontal distance from $x_{int}(y)$. $u_L$ and $u_R$ are left and right interface conditions.
38+
39+
40+
### Initial State
41+
<img src="figure0.png" height="MAX_HEIGHT"/>
42+
43+
### Evolved State
44+
<img src="figure1.png" height="MAX_HEIGHT"/>
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+
6+
mu = 1.0e-4
7+
lambd = 1.0
8+
time_end = 15.0
9+
time_save = time_end / 20.0
10+
eps = 1.0e-6
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,
20+
"x_domain%end": 16.0 * lambd,
21+
"y_domain%beg": 0,
22+
"y_domain%end": lambd,
23+
"m": 4096,
24+
"n": 256,
25+
"p": 0,
26+
"cfl_adap_dt": "T",
27+
"cfl_target": 0.1,
28+
"n_start": 0,
29+
"t_stop": time_end,
30+
"t_save": time_save,
31+
# Simulation Algorithm Parameters
32+
"num_patches": 2,
33+
"model_eqns": 2,
34+
"alt_soundspeed": "F",
35+
"num_fluids": 2,
36+
"mpp_lim": "T",
37+
"mixture_err": "T",
38+
"recon_type": 1,
39+
"time_stepper": 3,
40+
"weno_order": 5,
41+
"weno_eps": 1.0e-9,
42+
"null_weights": "F",
43+
"mapped_weno": "T",
44+
"mp_weno": "T",
45+
"riemann_solver": 2,
46+
"wave_speeds": 1,
47+
"avg_state": 2,
48+
"bc_x%beg": -17,
49+
"bc_x%end": -17,
50+
"bc_y%beg": -15,
51+
"bc_y%end": -15,
52+
# Formatted Database Files Structure Parameters
53+
"format": 1,
54+
"precision": 2,
55+
"prim_vars_wrt": "T",
56+
"parallel_io": "T",
57+
# Fluid #1 = Heavier Fluid
58+
# Fluid #2 = Lighter Fluid
59+
# Pre Shock
60+
"patch_icpp(1)%geometry": 3,
61+
"patch_icpp(1)%hcid": 208,
62+
"patch_icpp(1)%x_centroid": 0.5 * 0.7 * lambd,
63+
"patch_icpp(1)%y_centroid": 0.5 * lambd,
64+
"patch_icpp(1)%length_x": 0.7 * lambd,
65+
"patch_icpp(1)%length_y": lambd,
66+
"patch_icpp(1)%vel(1)": 1.24,
67+
"patch_icpp(1)%vel(2)": 0.0,
68+
"patch_icpp(1)%pres": 1.0 / 1.4,
69+
"patch_icpp(1)%alpha_rho(1)": 1.0 * eps,
70+
"patch_icpp(1)%alpha(1)": eps,
71+
"patch_icpp(1)%alpha_rho(2)": 1.0 * (1.0 - eps),
72+
"patch_icpp(1)%alpha(2)": (1.0 - eps),
73+
# Post Shock
74+
"patch_icpp(2)%geometry": 3,
75+
"patch_icpp(2)%hcid": 208,
76+
"patch_icpp(2)%x_centroid": 0.7 * lambd + 0.5 * 15.3 * lambd,
77+
"patch_icpp(2)%y_centroid": 0.5 * lambd,
78+
"patch_icpp(2)%length_x": 15.3 * lambd,
79+
"patch_icpp(2)%length_y": lambd,
80+
"patch_icpp(2)%vel(1)": 0.8787,
81+
"patch_icpp(2)%vel(2)": 0.0,
82+
"patch_icpp(2)%pres": 1.6272 / 1.4,
83+
"patch_icpp(2)%alpha_rho(1)": 1.4112 * eps,
84+
"patch_icpp(2)%alpha(1)": eps,
85+
"patch_icpp(2)%alpha_rho(2)": 1.4112 * (1.0 - eps),
86+
"patch_icpp(2)%alpha(2)": (1.0 - eps),
87+
# Fluids Physical Parameters
88+
"fluid_pp(1)%gamma": 1.0e00 / (1.093 - 1.0e00),
89+
"fluid_pp(1)%pi_inf": 0.0e00,
90+
"fluid_pp(2)%gamma": 1.0e00 / (1.4 - 1.0e00),
91+
"fluid_pp(2)%pi_inf": 0.0e00,
92+
"viscous": "T",
93+
"fluid_pp(1)%Re(1)": 1 / mu,
94+
"fluid_pp(2)%Re(1)": 1 / mu,
95+
96+
}
97+
)
98+
)
99+
183 KB
Loading
544 KB
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Viscous Shock Tube (2D)
2+
3+
Reference:
4+
> A.S. Chamarthi, S.H. Frankel, A. Chintagunta, Implicit gradients based novel finite volume scheme for compressible single and multi-component flows, arXiv preprint arXiv:2106.01738 (2021)., see Example 4.13
5+
6+
**Key Parameters**
7+
8+
* $\gamma = 7/5$
9+
* $Re = 1000$
10+
11+
**Initial Conditions**
12+
13+
* **Spatial Domain:** $(x, y) \in [0, 1] \times [0, 0.5]$
14+
15+
$$
16+
(\rho, u, v, p) =
17+
\begin{cases}
18+
(120, 0, 0, \frac{120}{\gamma}) & \text{if } 0 < x < 0.5 \\
19+
(1.2, 0, 0, \frac{1.2}{\gamma}) & \text{if } 0.5 \leq x < 1
20+
\end{cases}
21+
$$
22+
23+
### Initial State
24+
<img src="figure0.png" height="MAX_HEIGHT"/>
25+
26+
### Evolved State
27+
<img src="figure1.png" height="MAX_HEIGHT"/>
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/usr/bin/env python3
2+
import json
3+
import math
4+
5+
6+
mu = 1.0e-3
7+
time_end = 1.2
8+
time_save = time_end / 100.0
9+
eps = 1.0e-6
10+
11+
# Configuring case dictionary
12+
print(
13+
json.dumps(
14+
{
15+
# Logistics
16+
"run_time_info": "T",
17+
# Computational Domain Parameters
18+
"x_domain%beg": 0,
19+
"x_domain%end": 1.0,
20+
"y_domain%beg": 0,
21+
"y_domain%end": 0.5,
22+
"m": 1280,
23+
"n": 640,
24+
"p": 0,
25+
"cfl_adap_dt": "T",
26+
"cfl_target": 0.1,
27+
"n_start": 0,
28+
"t_stop": time_end,
29+
"t_save": time_save,
30+
# Simulation Algorithm Parameters
31+
"num_patches": 2,
32+
"model_eqns": 2,
33+
"alt_soundspeed": "F",
34+
"num_fluids": 2,
35+
"mpp_lim": "T",
36+
"mixture_err": "T",
37+
"time_stepper": 3,
38+
"weno_order": 5,
39+
"weno_eps": 1.0e-10,
40+
"null_weights": "F",
41+
"mapped_weno": "T",
42+
"mp_weno": "T",
43+
"riemann_solver": 1,
44+
"wave_speeds": 1,
45+
"avg_state": 2,
46+
"bc_x%beg": -8,
47+
"bc_x%end": -15,
48+
"bc_y%beg": -16,
49+
"bc_y%end": -15,
50+
# Formatted Database Files Structure Parameters
51+
"format": 1,
52+
"precision": 2,
53+
"prim_vars_wrt": "T",
54+
"parallel_io": "T",
55+
# Left
56+
"patch_icpp(1)%geometry": 3,
57+
"patch_icpp(1)%x_centroid": 0.5 * 0.5,
58+
"patch_icpp(1)%y_centroid": 0.5 * 0.5,
59+
"patch_icpp(1)%length_x": 0.5,
60+
"patch_icpp(1)%length_y": 0.5,
61+
"patch_icpp(1)%vel(1)": 0.0,
62+
"patch_icpp(1)%vel(2)": 0.0,
63+
"patch_icpp(1)%pres": 120.0 / (7.0 / 5.0),
64+
"patch_icpp(1)%alpha_rho(1)": 120.0 * (1 - eps),
65+
"patch_icpp(1)%alpha(1)": 1.0 * (1 - eps),
66+
"patch_icpp(1)%alpha_rho(2)": 120.0 * eps,
67+
"patch_icpp(1)%alpha(2)": 1.0 * eps,
68+
# Right
69+
"patch_icpp(2)%geometry": 3,
70+
"patch_icpp(2)%x_centroid": 0.5 + 0.5 * 0.5,
71+
"patch_icpp(2)%y_centroid": 0.5 * 0.5,
72+
"patch_icpp(2)%length_x": 0.5,
73+
"patch_icpp(2)%length_y": 0.5,
74+
"patch_icpp(2)%vel(1)": 0.0,
75+
"patch_icpp(2)%vel(2)": 0.0,
76+
"patch_icpp(2)%pres": 1.2 / (7.0 / 5.0),
77+
"patch_icpp(2)%alpha_rho(1)": 1.2 * eps,
78+
"patch_icpp(2)%alpha(1)": 1.0 * eps,
79+
"patch_icpp(2)%alpha_rho(2)": 1.2 * (1 - eps),
80+
"patch_icpp(2)%alpha(2)": 1.0 * (1 - eps),
81+
# Fluids Physical Parameters
82+
"viscous": "T",
83+
"fluid_pp(1)%gamma": 1.0e00 / ((7.0 / 5.0) - 1.0e00),
84+
"fluid_pp(1)%Re(1)": 1 / mu,
85+
"fluid_pp(1)%pi_inf": 0.0,
86+
"fluid_pp(2)%gamma": 1.0e00 / ((7.0 / 5.0) - 1.0e00),
87+
"fluid_pp(2)%Re(1)": 1 / mu,
88+
"fluid_pp(2)%pi_inf": 0.0,
89+
}
90+
)
91+
)
92+

0 commit comments

Comments
 (0)