Skip to content

Commit 45be9fa

Browse files
authored
Merge pull request #61 from MFlowCode/CBC_fix
2 parents 8b0c57a + 8387c61 commit 45be9fa

File tree

29 files changed

+924
-797
lines changed

29 files changed

+924
-797
lines changed

examples/2D_shockdroplet/case.py

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
#!/usr/bin/env python3
2+
import math
3+
import json
4+
5+
Ma = 2.4
6+
ps = 664016.5
7+
rho_post_a=3.757918216
8+
rho_a=1.17
9+
rho_w=1000
10+
gam_a = 1.4
11+
gam_w=6.12
12+
pi_w=3.43E8
13+
vel = 575.4980523
14+
rho = 1
15+
c_l = math.sqrt( 1.4*ps/rho )
16+
17+
D = 0.022
18+
Ny = 740.
19+
Nx =5000.
20+
dx = 0.25/Nx #8.3e-6
21+
22+
time_end = 0.0002#50us
23+
cfl = 0.1
24+
25+
dt = cfl * dx/c_l #5.3E-9
26+
Nt = int(time_end/dt)#10000
27+
28+
print(json.dumps({
29+
# Logistics ================================================
30+
'case_dir' : '\'.\'', \
31+
'run_time_info' : 'F', \
32+
# ==========================================================
33+
\
34+
# Computational Domain Parameters ==========================
35+
'x_domain%beg' : 0, \
36+
'x_domain%end' : 0.25, \
37+
'y_domain%beg' : 0, \
38+
'y_domain%end' : 0.037,
39+
'm' : int(Nx), \
40+
'n' : int(Ny), \
41+
'p' : 0, \
42+
'dt' : dt, \
43+
't_step_start' : 0, \
44+
't_step_stop' : 50000, \
45+
't_step_save' : 1000,#(Nt/1000), \
46+
# ==========================================================
47+
\
48+
# Simulation Algorithm Parameters ==========================
49+
'num_patches' : 3, \
50+
'model_eqns' : 2, \
51+
'alt_soundspeed' : 'F', \
52+
'num_fluids' : 2, \
53+
'adv_alphan' : 'T', \
54+
'mpp_lim' : 'T', \
55+
'mixture_err' : 'T', \
56+
'time_stepper' : 3, \
57+
'weno_vars' : 2, \
58+
'weno_order' : 5, \
59+
'weno_eps' : 1.E-16, \
60+
'mapped_weno' : 'T', \
61+
'null_weights' : 'F', \
62+
'mp_weno' : 'F', \
63+
'weno_Re_flux' : 'F', \
64+
'riemann_solver' : 2, \
65+
'wave_speeds' : 1, \
66+
'avg_state' : 2, \
67+
'bc_x%beg' : -6,#11, \
68+
'bc_x%end' : -6,#12 \
69+
'bc_y%beg' : -2, \
70+
'bc_y%end' : -6, \
71+
# ==========================================================
72+
\
73+
# Formatted Database Files Structure Parameters ============
74+
'format' : 1, \
75+
'precision' : 2, \
76+
'prim_vars_wrt' :'T', \
77+
'schlieren_wrt' : 'T', \
78+
'schlieren_alpha(1)' : 40, \
79+
'schlieren_alpha(2)' : 400, \
80+
'fd_order' : 4, \
81+
82+
'parallel_io' :'T', \
83+
# ==========================================================
84+
85+
# Patch 1: Background ============================
86+
'patch_icpp(1)%geometry' : 3, \
87+
'patch_icpp(1)%x_centroid' : 0.25/2, \
88+
'patch_icpp(1)%y_centroid' : 0.037/2, \
89+
'patch_icpp(1)%length_x' : 0.25, \
90+
'patch_icpp(1)%length_y' : 0.037, \
91+
'patch_icpp(1)%vel(1)' : 0., \
92+
'patch_icpp(1)%vel(2)' : 0.E+00, \
93+
'patch_icpp(1)%pres' : 101325., \
94+
'patch_icpp(1)%alpha_rho(1)' : 0., \
95+
'patch_icpp(1)%alpha_rho(2)' : 1.17, \
96+
'patch_icpp(1)%alpha(1)' : 0.E+00, \
97+
'patch_icpp(1)%alpha(2)' : 1.E+00, \
98+
# ==========================================================
99+
100+
# Patch 2: Shocked state ============================
101+
'patch_icpp(2)%geometry' : 3, \
102+
'patch_icpp(2)%alter_patch(1)' : 'T', \
103+
'patch_icpp(2)%x_centroid' : 0., \
104+
'patch_icpp(2)%y_centroid' : 0.037/2, \
105+
'patch_icpp(2)%length_x' : 0.25-D, \
106+
'patch_icpp(2)%length_y' : 0.037, \
107+
'patch_icpp(2)%vel(1)' : vel, \
108+
'patch_icpp(2)%vel(2)' : 0.E+00, \
109+
'patch_icpp(2)%pres' : ps, \
110+
'patch_icpp(2)%alpha_rho(1)' : 0.E+00, \
111+
'patch_icpp(2)%alpha_rho(2)' : rho_post_a, \
112+
'patch_icpp(2)%alpha(1)' : 0.E+00, \
113+
'patch_icpp(2)%alpha(2)' : 1.E+00, \
114+
# ==========================================================
115+
116+
# Patch 3: Bubble ======================================
117+
'patch_icpp(3)%geometry' : 2, \
118+
'patch_icpp(3)%x_centroid' : 0.25/2, \
119+
'patch_icpp(3)%y_centroid' : 0, \
120+
'patch_icpp(3)%radius' : D/2, \
121+
'patch_icpp(3)%alter_patch(1)' : 'T', \
122+
'patch_icpp(3)%vel(1)' : 0., \
123+
'patch_icpp(3)%vel(2)' : 0.E+00, \
124+
'patch_icpp(3)%pres' : 101325., \
125+
'patch_icpp(3)%alpha_rho(1)' : rho_w, \
126+
'patch_icpp(3)%alpha_rho(2)' : 0,#0.061, \
127+
'patch_icpp(3)%alpha(1)' : 1.,# 0.95 \
128+
'patch_icpp(3)%alpha(2)' : 0.,#0.05, \
129+
130+
# ==========================================================
131+
132+
# Fluids Physical Parameters ===============================
133+
'fluid_pp(1)%gamma' : 1.E+00/(gam_w-1.E+00), \
134+
'fluid_pp(1)%pi_inf' : pi_w*gam_w/(gam_w-1.E+00), \
135+
'fluid_pp(2)%gamma' : 1.E+00/(gam_a-1.E+00), \
136+
'fluid_pp(2)%pi_inf' : 0.E+00, \
137+
# ==========================================================
138+
139+
}))
140+

0 commit comments

Comments
 (0)