Skip to content

Commit a8a3103

Browse files
anshgupta1234Ansh Gupta
andauthored
IBM (#296)
Co-authored-by: Ansh Gupta <[email protected]>
1 parent 0ffd93e commit a8a3103

Some content is hidden

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

49 files changed

+6259
-81
lines changed

examples/2D_ibm/case.py

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import json
2+
import math
3+
4+
Mu = 1.84E-05
5+
gam_a = 1.4
6+
7+
# Configuring case dictionary
8+
print(json.dumps({
9+
# Logistics ================================================================
10+
'run_time_info' : 'T',
11+
# ==========================================================================
12+
13+
# Computational Domain Parameters ==========================================
14+
# For these computations, the cylinder is placed at the (0,0,0)
15+
# domain origin.
16+
# axial direction
17+
'x_domain%beg' : 0.0E+00,
18+
'x_domain%end' : 6.0E-03,
19+
# r direction
20+
'y_domain%beg' : 0.0E+00,
21+
'y_domain%end' : 6.0E-03,
22+
'cyl_coord' : 'F',
23+
'm' : 400,
24+
'n' : 400,
25+
'p' : 0,
26+
'dt' : 0.2E-6,
27+
't_step_start' : 0,
28+
't_step_stop' : 40000, #3000
29+
't_step_save' : 4000, #10
30+
# ==========================================================================
31+
32+
# Simulation Algorithm Parameters ==========================================
33+
# Only one patches are necessary, the air tube
34+
'num_patches' : 1,
35+
# Use the 5 equation model
36+
'model_eqns' : 2,
37+
'alt_soundspeed' : 'F',
38+
# One fluids: air
39+
'num_fluids' : 1,
40+
# Advect both volume fractions
41+
'adv_alphan' : 'T',
42+
# No need to ensure the volume fractions sum to unity at the end of each
43+
# time step
44+
'mpp_lim' : 'F',
45+
# Correct errors when computing speed of sound
46+
'mixture_err' : 'T',
47+
# Use TVD RK3 for time marching
48+
'time_stepper' : 3,
49+
# Use WENO5
50+
'weno_order' : 5,
51+
'weno_eps' : 1.E-16,
52+
'weno_Re_flux' : 'T',
53+
'weno_avg' : 'T',
54+
'avg_state' : 2,
55+
'mapped_weno' : 'T',
56+
'null_weights' : 'F',
57+
'mp_weno' : 'T',
58+
'riemann_solver' : 2,
59+
'wave_speeds' : 1,
60+
# We use ghost-cell
61+
'bc_x%beg' : -3,
62+
'bc_x%end' : -3,
63+
'bc_y%beg' : -3,
64+
'bc_y%end' : -3,
65+
# Set IB to True and add 1 patch
66+
'ib' : 'T',
67+
'num_ibs' : 1,
68+
# ==========================================================================
69+
70+
# Formatted Database Files Structure Parameters ============================
71+
'format' : 1,
72+
'precision' : 2,
73+
'prim_vars_wrt' :'T',
74+
'E_wrt' :'T',
75+
'parallel_io' :'T',
76+
# ==========================================================================
77+
78+
# Patch: Constant Tube filled with air =====================================
79+
# Specify the cylindrical air tube grid geometry
80+
'patch_icpp(1)%geometry' : 3,
81+
'patch_icpp(1)%x_centroid' : 3.0E-03,
82+
# Uniform medium density, centroid is at the center of the domain
83+
'patch_icpp(1)%y_centroid' : 3.0E-03,
84+
'patch_icpp(1)%length_x' : 6.0E-03,
85+
'patch_icpp(1)%length_y' : 6.0E-03,
86+
# Specify the patch primitive variables
87+
'patch_icpp(1)%vel(1)' : 0.05E+00,
88+
'patch_icpp(1)%vel(2)' : 0.0E+00,
89+
'patch_icpp(1)%pres' : 1.E+00,
90+
'patch_icpp(1)%alpha_rho(1)' : 1.E+00,
91+
'patch_icpp(1)%alpha(1)' : 1.E+00,
92+
# # ========================================================================
93+
94+
# Patch: Cylinder Immersed Boundary ========================================
95+
'patch_ib(1)%geometry' : 2,
96+
'patch_ib(1)%x_centroid' : 1.5E-03,
97+
'patch_ib(1)%y_centroid' : 3.0E-03,
98+
'patch_ib(1)%radius' : 0.2E-03,
99+
'patch_ib(1)%slip' : 'F',
100+
# # ========================================================================
101+
102+
# Fluids Physical Parameters ===============================================
103+
'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), # 2.50(Not 1.40)
104+
'fluid_pp(1)%pi_inf' : 0,
105+
'fluid_pp(1)%Re(1)' : 2500000,
106+
# ==========================================================================
107+
}))

examples/2D_ibm_airfoil/case.py

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
import json
2+
import math
3+
4+
Mu = 1.84E-05
5+
gam_a = 1.4
6+
gam_b = 1.1
7+
8+
# Configuring case dictionary
9+
print(json.dumps({
10+
# Logistics ================================================================
11+
'run_time_info' : 'T',
12+
# ==========================================================================
13+
14+
# Computational Domain Parameters ==========================================
15+
# axial direction
16+
'x_domain%beg' : 0.0E+00,
17+
'x_domain%end' : 6.0E-03,
18+
# r direction
19+
'y_domain%beg' : 0.0E+00,
20+
'y_domain%end' : 6.0E-03,
21+
'cyl_coord' : 'F',
22+
'm' : 200,
23+
'n' : 200,
24+
'p' : 0,
25+
'dt' : 0.57E-5/2,
26+
't_step_start' : 0,
27+
't_step_stop' : 7200, #3000
28+
't_step_save' : 30, #10
29+
# ==========================================================================
30+
31+
# Simulation Algorithm Parameters ==========================================
32+
# Only one patches are necessary, the air tube
33+
'num_patches' : 1,
34+
# Use the 5 equation model
35+
'model_eqns' : 2,
36+
# 6 equations model does not need the K \div(u) term
37+
'alt_soundspeed' : 'F',
38+
# One fluids: air
39+
'num_fluids' : 2,
40+
# Advect both volume fractions
41+
'adv_alphan' : 'T',
42+
# No need to ensure the volume fractions sum to unity at the end of each
43+
# time step
44+
'mpp_lim' : 'F',
45+
# Correct errors when computing speed of sound
46+
'mixture_err' : 'T',
47+
# Use TVD RK3 for time marching
48+
'time_stepper' : 1,
49+
# Reconstruct the primitive variables to minimize spurious
50+
# Use WENO5
51+
'weno_order' : 5,
52+
'weno_eps' : 1.E-16,
53+
'weno_Re_flux' : 'F',
54+
'weno_avg' : 'T',
55+
'avg_state' : 2,
56+
# Use the mapped WENO weights to maintain monotinicity
57+
'mapped_weno' : 'T',
58+
'null_weights' : 'F',
59+
'mp_weno' : 'T',
60+
# Use the HLLC Riemann solver
61+
'riemann_solver' : 2,
62+
'wave_speeds' : 1,
63+
# We use reflective boundary conditions at octant edges and
64+
# non-reflective boundary conditions at the domain edges
65+
'bc_x%beg' : -3,
66+
'bc_x%end' : -3,
67+
'bc_y%beg' : -3,
68+
'bc_y%end' : -3,
69+
# Set IB to True and add 1 patch
70+
'ib' : 'T',
71+
'num_ibs' : 1,
72+
# ==========================================================================
73+
74+
# Formatted Database Files Structure Parameters ============================
75+
'format' : 1,
76+
'precision' : 2,
77+
'prim_vars_wrt' :'T',
78+
'E_wrt' :'T',
79+
'parallel_io' :'T',
80+
# ==========================================================================
81+
82+
# Patch: Constant Tube filled with air =====================================
83+
# Specify the cylindrical air tube grid geometry
84+
'patch_icpp(1)%geometry' : 3,
85+
'patch_icpp(1)%x_centroid' : 3.0E-03,
86+
# Uniform medium density, centroid is at the center of the domain
87+
'patch_icpp(1)%y_centroid' : 3.0E-03,
88+
'patch_icpp(1)%length_x' : 6.0E-03,
89+
'patch_icpp(1)%length_y' : 6.0E-03,
90+
# Specify the patch primitive variables
91+
'patch_icpp(1)%vel(1)' : 0.1E+00,
92+
'patch_icpp(1)%vel(2)' : 0.0E+00,
93+
'patch_icpp(1)%pres' : 1.E+00,
94+
'patch_icpp(1)%alpha_rho(1)' : 0.8E+00,
95+
'patch_icpp(1)%alpha(1)' : 0.8E+00,
96+
'patch_icpp(1)%alpha_rho(2)' : 0.2E+00,
97+
'patch_icpp(1)%alpha(2)' : 0.2E+00,
98+
# # ========================================================================
99+
100+
# Patch: Airfoil Immersed Boundary ========================================
101+
'patch_ib(1)%geometry' : 4,
102+
'patch_ib(1)%x_centroid' : 1.0E-03,
103+
'patch_ib(1)%y_centroid' : 3.0E-03,
104+
'patch_ib(1)%c' : 1.0E-03,
105+
'patch_ib(1)%t' : 0.15,
106+
'patch_ib(1)%p' : 0.4,
107+
'patch_ib(1)%m' : 0.02,
108+
'patch_ib(1)%theta' : 30,
109+
# # ========================================================================
110+
111+
# Fluids Physical Parameters ===============================================
112+
# Use the same stiffness as the air bubble
113+
'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), # 2.50(Not 1.40)
114+
'fluid_pp(1)%pi_inf' : 0,
115+
'fluid_pp(2)%gamma' : 1.E+00/(gam_b-1.E+00), # 2.50(Not 1.40)
116+
'fluid_pp(2)%pi_inf' : 0,
117+
# ==========================================================================
118+
}))

examples/2D_ibm_multiphase/case.py

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
import json
2+
import math
3+
4+
Mu = 1.84E-05
5+
gam_a = 1.4
6+
gam_b = 1.1
7+
8+
# Configuring case dictionary
9+
print(json.dumps({
10+
# Logistics ================================================================
11+
'run_time_info' : 'T',
12+
# ==========================================================================
13+
14+
# Computational Domain Parameters ==========================================
15+
# axial direction
16+
'x_domain%beg' : 0.0E+00,
17+
'x_domain%end' : 6.0E-03,
18+
# r direction
19+
'y_domain%beg' : 0.0E+00,
20+
'y_domain%end' : 6.0E-03,
21+
'cyl_coord' : 'F',
22+
'm' : 400,
23+
'n' : 400,
24+
'p' : 0,
25+
'dt' : 0.5E-6,
26+
't_step_start' : 0,
27+
't_step_stop' : 10000, #3000
28+
't_step_save' : 1000, #10
29+
# ==========================================================================
30+
31+
# Simulation Algorithm Parameters ==========================================
32+
# Only one patches are necessary, the air tube
33+
'num_patches' : 1,
34+
# Use the 6 equation model
35+
'model_eqns' : 3,
36+
'alt_soundspeed' : 'F',
37+
'num_fluids' : 2,
38+
# Advect both volume fractions
39+
'adv_alphan' : 'T',
40+
'mpp_lim' : 'T',
41+
# Correct errors when computing speed of sound
42+
'mixture_err' : 'T',
43+
# Use TVD RK3 for time marching
44+
'time_stepper' : 1,
45+
# Use WENO5
46+
'weno_order' : 5,
47+
'weno_eps' : 1.E-16,
48+
'weno_Re_flux' : 'F',
49+
'weno_avg' : 'T',
50+
'avg_state' : 2,
51+
# Use the mapped WENO weights to maintain monotinicity
52+
'mapped_weno' : 'T',
53+
'null_weights' : 'F',
54+
'mp_weno' : 'T',
55+
# Use the HLLC Riemann solver
56+
'riemann_solver' : 2,
57+
'wave_speeds' : 1,
58+
# We use ghost-cell extrapolation at every side
59+
'bc_x%beg' : -3,
60+
'bc_x%end' : -3,
61+
'bc_y%beg' : -3,
62+
'bc_y%end' : -3,
63+
# Set IB to True and add 1 patch
64+
'ib' : 'T',
65+
'num_ibs' : 1,
66+
# ==========================================================================
67+
68+
# Formatted Database Files Structure Parameters ============================
69+
'format' : 1,
70+
'precision' : 2,
71+
'prim_vars_wrt' :'T',
72+
'E_wrt' :'T',
73+
'parallel_io' :'T',
74+
# ==========================================================================
75+
76+
# Patch: Constant Tube filled with air =====================================
77+
# Specify the cylindrical air tube grid geometry
78+
'patch_icpp(1)%geometry' : 3,
79+
'patch_icpp(1)%x_centroid' : 3.0E-03,
80+
# Uniform medium density, centroid is at the center of the domain
81+
'patch_icpp(1)%y_centroid' : 3.0E-03,
82+
'patch_icpp(1)%length_x' : 6.0E-03,
83+
'patch_icpp(1)%length_y' : 6.0E-03,
84+
# Specify the patch primitive variables
85+
'patch_icpp(1)%vel(1)' : 0.1E+00,
86+
'patch_icpp(1)%vel(2)' : 0.0E+00,
87+
'patch_icpp(1)%pres' : 1.E+00,
88+
'patch_icpp(1)%alpha_rho(1)' : 0.8E+00,
89+
'patch_icpp(1)%alpha(1)' : 0.8E+00,
90+
'patch_icpp(1)%alpha_rho(2)' : 0.2E+00,
91+
'patch_icpp(1)%alpha(2)' : 0.2E+00,
92+
# # ========================================================================
93+
94+
# Patch: Cylinder Immersed Boundary ========================================
95+
'patch_ib(1)%geometry' : 2,
96+
'patch_ib(1)%x_centroid' : 1.5E-03,
97+
'patch_ib(1)%y_centroid' : 3.0E-03,
98+
'patch_ib(1)%radius' : 0.2E-03,
99+
# ==========================================================================
100+
101+
# Fluids Physical Parameters ===============================================
102+
# Specify 2 fluids
103+
'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), # 2.50(Not 1.40)
104+
'fluid_pp(1)%pi_inf' : 0,
105+
# 'fluid_pp(1)%Re(1)' : 2500000,
106+
# 'fluid_pp(1)%Re(2)' : 1.0e+6,
107+
'fluid_pp(2)%gamma' : 1.E+00/(gam_b-1.E+00), # 2.50(Not 1.40)
108+
'fluid_pp(2)%pi_inf' : 0,
109+
# 'fluid_pp(2)%Re(1)' : 2500000,
110+
# ==========================================================================
111+
}))

0 commit comments

Comments
 (0)