Skip to content

Commit c93195f

Browse files
New example cases (#945)
Co-authored-by: Spencer Bryngelson <[email protected]> Co-authored-by: Spencer Bryngelson <[email protected]>
1 parent 4a00c56 commit c93195f

File tree

10 files changed

+896
-11
lines changed

10 files changed

+896
-11
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Backward Facing Step (2D)
2+
3+
## Final Condition (Density)
4+
<img src="final.png"/>
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import json
2+
import math
3+
4+
h = 0.0093
5+
Re = 5000
6+
7+
gam_a = 1.4
8+
p0 = 101325
9+
rho0 = 1
10+
c0 = math.sqrt(gam_a * p0 / rho0)
11+
v0 = 3 * c0
12+
mu = v0 * h / Re
13+
14+
# Configuring case dictionary
15+
print(
16+
json.dumps(
17+
{
18+
# Logistics
19+
"run_time_info": "T",
20+
"x_domain%beg": 0,
21+
"x_domain%end": 30 * h,
22+
"y_domain%beg": 0,
23+
"y_domain%end": 6 * h,
24+
"cyl_coord": "F",
25+
"m": 1999,
26+
"n": 399,
27+
"p": 0,
28+
"cfl_adap_dt": "T",
29+
"cfl_target": 0.5,
30+
"n_start": 0,
31+
"t_save": 100 * h / (100 * v0),
32+
"t_stop": 100 * h / v0,
33+
# Simulation Algorithm Parameters
34+
"num_patches": 1,
35+
"model_eqns": 2,
36+
"alt_soundspeed": "F",
37+
"num_fluids": 1,
38+
"mpp_lim": "F",
39+
"mixture_err": "F",
40+
"time_stepper": 3,
41+
"weno_order": 5,
42+
"weno_eps": 1.0e-16,
43+
"weno_avg": "T",
44+
"weno_Re_flux": "T",
45+
"avg_state": 2,
46+
"mapped_weno": "T",
47+
"null_weights": "F",
48+
"mp_weno": "T",
49+
"riemann_solver": 2,
50+
"wave_speeds": 1,
51+
"bc_x%beg": -11,
52+
"bc_x%end": -3,
53+
"bc_y%beg": -16,
54+
"bc_y%end": -3,
55+
"ib": "T",
56+
"num_ibs": 1,
57+
"viscous": "T",
58+
# Formatted Database Files Structure Parameters
59+
"format": 1,
60+
"precision": 2,
61+
"prim_vars_wrt": "T",
62+
"parallel_io": "T",
63+
# Fluid Patch: Background
64+
"patch_icpp(1)%geometry": 3,
65+
"patch_icpp(1)%x_centroid": 15 * h,
66+
"patch_icpp(1)%y_centroid": 3.5 * h,
67+
"patch_icpp(1)%length_x": 30 * h,
68+
"patch_icpp(1)%length_y": 7 * h,
69+
"patch_icpp(1)%vel(1)": v0,
70+
"patch_icpp(1)%vel(2)": 0.0,
71+
"patch_icpp(1)%pres": p0,
72+
"patch_icpp(1)%alpha_rho(1)": rho0,
73+
"patch_icpp(1)%alpha(1)": 1.0,
74+
# IB Patch: Step
75+
"patch_ib(1)%geometry": 3,
76+
"patch_ib(1)%x_centroid": 4 * h,
77+
"patch_ib(1)%y_centroid": 0 * h,
78+
"patch_ib(1)%length_x": 12 * h,
79+
"patch_ib(1)%length_y": 2 * h,
80+
"patch_ib(1)%slip": "T",
81+
# Fluids Physical Parameters
82+
"fluid_pp(1)%gamma": 1.0 / (gam_a - 1.0),
83+
"fluid_pp(1)%pi_inf": 0.0,
84+
"fluid_pp(1)%Re(1)": 1 / mu,
85+
},
86+
indent=4,
87+
)
88+
)
155 KB
Loading
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Forward Facing Step (2D)
2+
3+
Reference:
4+
> Woodward, P. *(1984). The numerical simulation of two-dimensional fluid flow with strong shocks. Journal of Computational Physics, 54(1), 115–173. https://doi.org/10.1016/0021-9991(84)90140-2*
5+
6+
## Final Condition (Density)
7+
<img src="final.png"/>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import json
2+
import math
3+
4+
h = 0.2
5+
6+
gam_a = 1.4
7+
p0 = 1
8+
rho0 = 1.4
9+
c0 = math.sqrt(gam_a * p0 / rho0)
10+
v0 = 3 * c0
11+
mu = rho0 * v0 * h / 2e5
12+
13+
# Configuring case dictionary
14+
print(
15+
json.dumps(
16+
{
17+
# Logistics
18+
"run_time_info": "T",
19+
"x_domain%beg": 0,
20+
"x_domain%end": 15 * h,
21+
"y_domain%beg": 0,
22+
"y_domain%end": 5 * h,
23+
"cyl_coord": "F",
24+
"m": 1499,
25+
"n": 499,
26+
"p": 0,
27+
"cfl_adap_dt": "T",
28+
"cfl_target": 0.8,
29+
"n_start": 0,
30+
"t_save": 0.04,
31+
"t_stop": 4,
32+
# Simulation Algorithm Parameters
33+
"num_patches": 1,
34+
"model_eqns": 2,
35+
"alt_soundspeed": "F",
36+
"num_fluids": 1,
37+
"mpp_lim": "F",
38+
"mixture_err": "F",
39+
"time_stepper": 3,
40+
"weno_avg": "T",
41+
"weno_order": 5,
42+
"weno_eps": 1.0e-16,
43+
"avg_state": 2,
44+
"mapped_weno": "T",
45+
"null_weights": "F",
46+
"mp_weno": "T",
47+
"riemann_solver": 2,
48+
"wave_speeds": 1,
49+
"bc_x%beg": -3,
50+
"bc_x%end": -3,
51+
"bc_y%beg": -2,
52+
"bc_y%end": -2,
53+
"ib": "T",
54+
"num_ibs": 1,
55+
# Formatted Database Files Structure Parameters
56+
"format": 1,
57+
"precision": 2,
58+
"prim_vars_wrt": "T",
59+
"parallel_io": "T",
60+
# Patch 1 Background
61+
"patch_icpp(1)%geometry": 3,
62+
"patch_icpp(1)%x_centroid": 7.5 * h,
63+
"patch_icpp(1)%y_centroid": 2.5 * h,
64+
"patch_icpp(1)%length_x": 15 * h,
65+
"patch_icpp(1)%length_y": 5 * h,
66+
"patch_icpp(1)%vel(1)": v0,
67+
"patch_icpp(1)%vel(2)": 0.0,
68+
"patch_icpp(1)%pres": p0,
69+
"patch_icpp(1)%alpha_rho(1)": rho0,
70+
"patch_icpp(1)%alpha(1)": 1.0,
71+
# Patch: No slip rectangle
72+
"patch_ib(1)%geometry": 3,
73+
"patch_ib(1)%x_centroid": 11.5 * h,
74+
"patch_ib(1)%y_centroid": 0 * h,
75+
"patch_ib(1)%length_x": 17 * h,
76+
"patch_ib(1)%length_y": 2 * h,
77+
"patch_ib(1)%slip": "T",
78+
# Fluids Physical Parameters
79+
"fluid_pp(1)%gamma": 1.0 / (gam_a - 1.0),
80+
"fluid_pp(1)%pi_inf": 0.0,
81+
"viscous": "T",
82+
"fluid_pp(1)%Re(1)": 1 / mu,
83+
},
84+
indent=4,
85+
)
86+
)
181 KB
Loading

src/simulation/m_cbc.fpp

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,27 +1635,36 @@ contains
16351635
@:DEALLOCATE(vel_in, vel_out, pres_in, pres_out, Del_in, Del_out, alpha_rho_in, alpha_in)
16361636
16371637
! Deallocating CBC Coefficients in x-direction
1638-
if (any((/bc_x%beg, bc_x%end/) <= -5) .and. any((/bc_x%beg, bc_x%end/) >= -13)) then
1638+
if (all((/bc_x%beg, bc_x%end/) <= -5) .and. all((/bc_x%beg, bc_x%end/) >= -13) .or. &
1639+
bc_x%beg <= -5 .and. bc_x%beg >= -13 .or. &
1640+
bc_x%end <= -5 .and. bc_x%end >= -13) then
16391641
@:DEALLOCATE(fd_coef_x)
16401642
if (weno_order > 1 .or. muscl_order > 1) then
16411643
@:DEALLOCATE(pi_coef_x)
16421644
end if
16431645
end if
16441646
16451647
! Deallocating CBC Coefficients in y-direction
1646-
if (n > 0 .and. any((/bc_y%beg, bc_y%end/) <= -5) .and. &
1647-
any((/bc_y%beg, bc_y%end/) >= -13 .and. bc_y%beg /= -14)) then
1648-
@:DEALLOCATE(fd_coef_y)
1649-
if (weno_order > 1 .or. muscl_order > 1) then
1650-
@:DEALLOCATE(pi_coef_y)
1648+
if (n > 0) then
1649+
if (all((/bc_y%beg, bc_y%end/) <= -5) .and. all((/bc_y%beg, bc_y%end/) >= -13) .or. &
1650+
bc_y%beg <= -5 .and. bc_y%beg >= -13 .or. &
1651+
bc_y%end <= -5 .and. bc_y%end >= -13) then
1652+
@:DEALLOCATE(fd_coef_y)
1653+
if (weno_order > 1) then
1654+
@:DEALLOCATE(pi_coef_y)
1655+
end if
16511656
end if
16521657
end if
16531658
16541659
! Deallocating CBC Coefficients in z-direction
1655-
if (p > 0 .and. any((/bc_z%beg, bc_z%end/) <= -5) .and. any((/bc_z%beg, bc_z%end/) >= -13)) then
1656-
@:DEALLOCATE(fd_coef_z)
1657-
if (weno_order > 1 .or. muscl_order > 1) then
1658-
@:DEALLOCATE(pi_coef_z)
1660+
if (p > 0) then
1661+
if (all((/bc_z%beg, bc_z%end/) <= -5) .and. all((/bc_z%beg, bc_z%end/) >= -13) .or. &
1662+
bc_z%beg <= -5 .and. bc_z%beg >= -13 .or. &
1663+
bc_z%end <= -5 .and. bc_z%end >= -13) then
1664+
@:DEALLOCATE(fd_coef_z)
1665+
if (weno_order > 1) then
1666+
@:DEALLOCATE(pi_coef_z)
1667+
end if
16591668
end if
16601669
end if
16611670

0 commit comments

Comments
 (0)