Skip to content

Commit af1f6bf

Browse files
committed
some changes to input files
1 parent c6a58fc commit af1f6bf

File tree

3 files changed

+294
-9
lines changed

3 files changed

+294
-9
lines changed

example_cases/1D_exp_bubscreen/input_shock4.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
#Characteristic velocity
4646
uu = math.sqrt( p0/rho0 )
4747
#Cavitation number
48-
#Ca = (p0 - pv)/(rho0*(uu**2.))
49-
Ca = 1
48+
Ca = (p0 - pv)/(rho0*(uu**2.))
49+
# Ca = 1
5050
#Weber number
5151
We = rho0*(uu**2.)*R0ref/ss
5252
#Inv. bubble Reynolds number

example_cases/1D_poly_bubscreen/input.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
import math
44

55
x0 = 10.E-06
6-
p0 = 101325.
6+
p0 = 112.9E+03
77
rho0 = 1.E+03
88
c0 = math.sqrt( p0/rho0 )
99
patm = 1.
1010

1111
#water props
12-
n_tait = 7.1
12+
n_tait = 7.15
1313
B_tait = 306.E+06 / p0
1414
mul0 = 1.002E-03 #viscosity
15+
# ss = 1.E-12 #surface tension
1516
ss = 0.07275 #surface tension
1617
pv = 2.3388E+03 #vapor pressure
1718

19+
# Preston parameters
1820
gamma_v = 1.33
1921
M_v = 18.02
2022
mu_v = 0.8816E-05
@@ -47,7 +49,7 @@
4749
Re_inv = mul0/(rho0*uu*R0ref)
4850

4951
#IC setup
50-
vf0 = 0.0001
52+
vf0 = 1.E-4
5153
n0 = vf0/(math.pi*4.E+00/3.E+00)
5254

5355
cact = 1475.
@@ -77,6 +79,7 @@
7779
Nout = int(math.ceil(Nt/Nfiles))
7880
Nt = int(Nout*Nfiles)
7981

82+
8083
print('Web', We)
8184
print('Re_inv', Re_inv)
8285

@@ -134,7 +137,7 @@
134137
'p' : 0, \
135138
'dt' : dt, \
136139
't_step_start' : 0, \
137-
't_step_stop' : 20, \
140+
't_step_stop' : 1, \
138141
't_step_save' : 1, \
139142
# ==========================================================
140143
\
@@ -213,11 +216,22 @@
213216
# Surrounding liquid
214217
'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), \
215218
'fluid_pp(1)%pi_inf' : n_tait*B_tait/(n_tait-1.), \
219+
'fluid_pp(1)%mul0' : mul0, \
220+
'fluid_pp(1)%ss' : ss, \
221+
'fluid_pp(1)%pv' : pv, \
222+
'fluid_pp(1)%gamma_v' : gamma_v, \
223+
'fluid_pp(1)%M_v' : M_v, \
224+
'fluid_pp(1)%mu_v' : mu_v, \
225+
'fluid_pp(1)%k_v' : k_v, \
216226

217227
# Last fluid_pp is always reserved for bubble gas state ===
218228
# if applicable ==========================================
219229
'fluid_pp(2)%gamma' : 1./(gamma_gas-1.), \
220230
'fluid_pp(2)%pi_inf' : 0.0E+00, \
231+
'fluid_pp(2)%gamma_v' : gamma_n, \
232+
'fluid_pp(2)%M_v' : M_n, \
233+
'fluid_pp(2)%mu_v' : mu_n, \
234+
'fluid_pp(2)%k_v' : k_n, \
221235
# ==========================================================
222236

223237
# Non-polytropic gas compression model AND/OR Tait EOS =====
@@ -227,7 +241,7 @@
227241

228242
# Bubbles ==================================================
229243
'bubbles' : 'T', \
230-
'bubble_model' : 3, \
244+
'bubble_model' : 2, \
231245
'polytropic' : 'T', \
232246
# 'polydisperse' : 'T', \
233247
'R0_type' : 1, \
@@ -239,7 +253,7 @@
239253
'nb' : 1, \
240254
'Ca' : Ca, \
241255
'Web' : We, \
242-
# 'Re_inv' : Re_inv, \
256+
'Re_inv' : Re_inv, \
243257
#'qbmm' : 'T', \
244258
#'nnode' : 4, \
245259
#'dist_type' : 2, \
@@ -249,7 +263,7 @@
249263
# ==========================================================
250264

251265
# Acoustic source ==========================================
252-
'Monopole' : 'F', \
266+
# 'Monopole' : 'F', \
253267
#'num_mono' : 1, \
254268
#'Mono(1)%loc(1)' : -8.E-03/x0, \
255269
#'Mono(1)%npulse' : 1, \
Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
#!/usr/bin/env python2
2+
3+
import math
4+
5+
x0 = 10.E-06
6+
p0 = 101325.
7+
rho0 = 1.E+03
8+
c0 = math.sqrt( p0/rho0 )
9+
patm = 1.
10+
11+
#water props
12+
n_tait = 7.1
13+
B_tait = 306.E+06 / p0
14+
mul0 = 1.002E-03 #viscosity
15+
ss = 0.07275 #surface tension
16+
pv = 2.3388E+03 #vapor pressure
17+
18+
gamma_v = 1.33
19+
M_v = 18.02
20+
mu_v = 0.8816E-05
21+
k_v = 0.019426
22+
23+
#air props
24+
gamma_n = 1.4
25+
M_n = 28.97
26+
mu_n = 1.8E-05
27+
k_n = 0.02556
28+
29+
#air props
30+
# gamma_gas = gamma_n
31+
gamma_gas = 1.4
32+
33+
#reference bubble size
34+
R0ref = 10.E-06
35+
36+
pa = 0.1 * 1.E+06 / 101325.
37+
38+
#Characteristic velocity
39+
uu = math.sqrt( p0/rho0 )
40+
#Cavitation number
41+
Ca = (p0 - pv)/(rho0*(uu**2.))
42+
#Ca = 1.
43+
#Weber number
44+
# We = rho0*(uu**2.)*R0ref/ss
45+
We = p0*R0ref/ss
46+
#Inv. bubble Reynolds number
47+
Re_inv = mul0/(rho0*uu*R0ref)
48+
49+
#IC setup
50+
vf0 = 0.0001
51+
n0 = vf0/(math.pi*4.E+00/3.E+00)
52+
53+
cact = 1475.
54+
t0 = x0/c0
55+
56+
nbubbles = 1
57+
myr0 = R0ref
58+
59+
cfl = 0.1
60+
Nx = 400
61+
Ldomain = 20.E-03
62+
L = Ldomain/x0
63+
dx = L/float(Nx)
64+
dt = cfl*dx*c0/cact
65+
Lpulse = 0.3*Ldomain
66+
Tpulse = Lpulse/cact
67+
Tfinal = 6*0.25*10.*Tpulse*c0/x0
68+
Nt = int(Tfinal/dt)
69+
70+
dt = dt * 0.1
71+
# print('dt: ',dt)
72+
73+
74+
Nt = 60000
75+
76+
Nfiles = 74.
77+
Nout = int(math.ceil(Nt/Nfiles))
78+
Nt = int(Nout*Nfiles)
79+
80+
81+
print('Web', We)
82+
print('Re_inv', Re_inv)
83+
84+
# Command to navigate between directories
85+
from os import chdir
86+
87+
# Command to acquire directory path
88+
from os.path import dirname
89+
90+
# Command to acquire script name and module search path
91+
from sys import argv, path
92+
93+
# Navigating to script directory
94+
if len(dirname(argv[0])) != 0: chdir(dirname(argv[0]))
95+
96+
# Adding master_scripts directory to module search path
97+
mfc_dir = '../../src'; path[:0] = [mfc_dir + '/master_scripts']
98+
99+
# Command to execute the MFC components
100+
from m_python_proxy import f_execute_mfc_component
101+
#from m_python_proxy import f_execute_mfc_component_SHB
102+
#sub_name = 'XXNAME'
103+
104+
# ==============================================================================
105+
106+
# Case Analysis Configuration ==================================================
107+
108+
# Selecting MFC component
109+
comp_name = argv[1].strip()
110+
111+
# Serial or parallel computational engine
112+
engine = 'serial'
113+
if (comp_name=='pre_process'): engine = 'serial'
114+
115+
# Configuring case dictionary
116+
case_dict = \
117+
{ \
118+
# Logistics ================================================
119+
'case_dir' : '\'.\'', \
120+
'run_time_info' : 'F', \
121+
'nodes' : 1, \
122+
'ppn' : 2, \
123+
'queue' : 'normal', \
124+
'walltime' : '24:00:00', \
125+
'mail_list' : '', \
126+
# ==========================================================
127+
\
128+
# Computational Domain Parameters ==========================
129+
'x_domain%beg' : -10.E-03/x0, \
130+
'x_domain%end' : 10.E-03/x0, \
131+
'stretch_x' : 'F', \
132+
'cyl_coord' : 'F', \
133+
'm' : Nx, \
134+
'n' : 0, \
135+
'p' : 0, \
136+
'dt' : dt, \
137+
't_step_start' : 0, \
138+
't_step_stop' : Nt, \
139+
't_step_save' : Nout, \
140+
# ==========================================================
141+
\
142+
# Simulation Algorithm Parameters ==========================
143+
'num_patches' : 2, \
144+
'model_eqns' : 2, \
145+
'alt_soundspeed' : 'F', \
146+
'num_fluids' : 1, \
147+
'adv_alphan' : 'T', \
148+
'mpp_lim' : 'F', \
149+
'mixture_err' : 'F', \
150+
'time_stepper' : 3, \
151+
'weno_vars' : 2, \
152+
'weno_order' : 5, \
153+
'weno_eps' : 1.E-16, \
154+
'char_decomp' : 'F', \
155+
'mapped_weno' : 'T', \
156+
'null_weights' : 'F', \
157+
'mp_weno' : 'T', \
158+
'riemann_solver' : 2, \
159+
'wave_speeds' : 1, \
160+
'avg_state' : 2, \
161+
'commute_err' : 'F', \
162+
'split_err' : 'F', \
163+
'bc_x%beg' : -8, \
164+
'bc_x%end' : -8, \
165+
# ==========================================================
166+
\
167+
# Formatted Database Files Structure Parameters ============
168+
'format' : 1, \
169+
'precision' : 2, \
170+
'prim_vars_wrt' :'T', \
171+
'parallel_io' :'F', \
172+
'fd_order' : 1, \
173+
#'schlieren_wrt' :'T', \
174+
'probe_wrt' :'T', \
175+
'num_probes' : 1, \
176+
'probe(1)%x' : 0., \
177+
# ==========================================================
178+
179+
# Patch 1 _ Background =====================================
180+
'patch_icpp(1)%geometry' : 1, \
181+
'patch_icpp(1)%x_centroid' : 0., \
182+
'patch_icpp(1)%length_x' : 20.E-03/x0, \
183+
'patch_icpp(1)%vel(1)' : 0.0, \
184+
'patch_icpp(1)%pres' : 1, \
185+
'patch_icpp(1)%alpha_rho(1)' : (1.-1.E-12)*1.E+03/rho0, \
186+
'patch_icpp(1)%alpha(1)' : 1.E-12, \
187+
'patch_icpp(1)%r0' : 1., \
188+
'patch_icpp(1)%v0' : 0.0E+00, \
189+
# ==========================================================
190+
191+
# Patch 2 Screen ===========================================
192+
'patch_icpp(2)%geometry' : 1, \
193+
'patch_icpp(2)%x_centroid' : 0., \
194+
'patch_icpp(2)%length_x' : 5.E-03/x0, \
195+
# 'patch_icpp(1)%length_x' : 20.E-03/x0, \
196+
'patch_icpp(2)%alter_patch(1)' : 'T', \
197+
'patch_icpp(2)%vel(1)' : 0.0, \
198+
'patch_icpp(2)%pres' : 1, \
199+
'patch_icpp(2)%alpha_rho(1)' : (1.-vf0)*1.E+03/rho0, \
200+
'patch_icpp(2)%alpha(1)' : vf0, \
201+
'patch_icpp(2)%r0' : 1., \
202+
'patch_icpp(2)%v0' : 0., \
203+
# ==========================================================
204+
205+
# Fluids Physical Parameters ===============================
206+
# Surrounding liquid
207+
'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), \
208+
'fluid_pp(1)%pi_inf' : n_tait*B_tait/(n_tait-1.), \
209+
'fluid_pp(1)%mul0' : mul0, \
210+
'fluid_pp(1)%ss' : ss, \
211+
'fluid_pp(1)%pv' : pv, \
212+
'fluid_pp(1)%gamma_v' : gamma_v, \
213+
'fluid_pp(1)%M_v' : M_v, \
214+
'fluid_pp(1)%mu_v' : mu_v, \
215+
'fluid_pp(1)%k_v' : k_v, \
216+
217+
# Last fluid_pp is always reserved for bubble gas state ===
218+
# if applicable ==========================================
219+
'fluid_pp(2)%gamma' : 1./(gamma_gas-1.), \
220+
'fluid_pp(2)%pi_inf' : 0.0E+00, \
221+
'fluid_pp(2)%gamma_v' : gamma_n, \
222+
'fluid_pp(2)%M_v' : M_n, \
223+
'fluid_pp(2)%mu_v' : mu_n, \
224+
'fluid_pp(2)%k_v' : k_n, \
225+
# ==========================================================
226+
227+
# Non-polytropic gas compression model AND/OR Tait EOS =====
228+
'pref' : p0, \
229+
'rhoref' : rho0, \
230+
# ==========================================================
231+
232+
# Bubbles ==================================================
233+
'bubbles' : 'T', \
234+
'bubble_model' : 2, \
235+
'polytropic' : 'F', \
236+
'polydisperse' : 'T', \
237+
'R0_type' : 1, \
238+
#'polydisperse' : 'F', \
239+
'poly_sigma' : 0.5, \
240+
'thermal' : 3, \
241+
'R0ref' : myr0, \
242+
'nb' : 21, \
243+
#'nb' : 1, \
244+
'Ca' : Ca, \
245+
'Web' : We, \
246+
'Re_inv' : Re_inv, \
247+
#'qbmm' : 'T', \
248+
#'nnode' : 4, \
249+
#'dist_type' : 2, \
250+
#'sigR' : 0.1, \
251+
#'sigV' : 0.1, \
252+
#'rhoRV' : 0.0, \
253+
# ==========================================================
254+
255+
# Acoustic source ==========================================
256+
'Monopole' : 'T', \
257+
'num_mono' : 1, \
258+
'Mono(1)%loc(1)' : -8.E-03/x0, \
259+
'Mono(1)%npulse' : 1, \
260+
'Mono(1)%dir' : 1., \
261+
'Mono(1)%pulse' : 1, \
262+
'Mono(1)%mag' : 1*pa, \
263+
'Mono(1)%length' : (1./(300000.))*cact/x0, \
264+
# ==========================================================
265+
}
266+
267+
# Executing MFC component
268+
f_execute_mfc_component(comp_name, case_dict, mfc_dir, engine)
269+
#_execute_mfc_component_SHB(comp_name, case_dict, mfc_dir, engine, sub_name)
270+
271+
# ==========================================================================

0 commit comments

Comments
 (0)