Skip to content

Commit d308c97

Browse files
committed
fix examples
1 parent d171425 commit d308c97

File tree

5 files changed

+50
-47
lines changed

5 files changed

+50
-47
lines changed

examples/2D_lungwave/case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
'patch_icpp(2)%y_centroid' : -dlengy/4.,
172172
'patch_icpp(2)%length_x' : dlengx,
173173
'patch_icpp(2)%length_y' : dlengy/2.+2,
174-
'patch_icpp(2)%a2' : interface_amp,
174+
'patch_icpp(2)%a(2)' : interface_amp,
175175
'patch_icpp(2)%vel(1)' : 0.E+00,
176176
'patch_icpp(2)%vel(2)' : 0.0,
177177
'patch_icpp(2)%pres' : patmos_n,

examples/2D_lungwave_horizontal/case.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#define pulse
3232
P_amp = 10.E+6
3333
P_len = 45 #length of the impulse
34-
theta = -math.pi/2 #direction of propagation
34+
theta = -math.pi/2 #direction of propagation
3535

3636
#non-dim
3737

@@ -43,8 +43,8 @@
4343
stress_char = rho_char*c_char*c_char/gammag
4444

4545
#non-dim the properties
46-
rhog_n = rhog/rho_char
47-
c_g_n = c_g/c_char
46+
rhog_n = rhog/rho_char
47+
c_g_n = c_g/c_char
4848
rhol_n = rhol/rho_char
4949
c_l_n = c_l/c_char
5050
Bg_n = Bg/stress_char
@@ -72,7 +72,7 @@
7272
time_end = 5
7373
cfl = 8.0
7474

75-
dt = cfl * dx/c_l
75+
dt = cfl * dx/c_l
7676
Nt = int(time_end/dt)
7777
Nframes = 500
7878
tstart = 0
@@ -110,7 +110,7 @@
110110
'time_stepper' : 3,
111111
'weno_order' : 5,
112112
'weno_eps' : 1.E-16,
113-
'weno_Re_flux' : 'F',
113+
'weno_Re_flux' : 'F',
114114
'weno_avg' : 'F',
115115
'mapped_weno' : 'T',
116116
'null_weights' : 'F',
@@ -130,7 +130,7 @@
130130
'prim_vars_wrt' :'T',
131131
'parallel_io' :'T',
132132
# ==========================================================================
133-
133+
134134
# Monopole setting =========================================================
135135
'Monopole' : 'T', # creating an acoustic wave
136136
'num_mono' : 1, # place in the middle and expand
@@ -139,11 +139,11 @@
139139
'Mono(1)%mag' : 100.0*patmos_n,# magnitude
140140
'Mono(1)%length' : 45.0*dlengy, # pulse length
141141
'Mono(1)%support' : 2, # 2D semi infinite plane (x: -inf,inf; y:-len/2, len/2)
142-
'Mono(1)%support_width' : 30,
142+
'Mono(1)%support_width' : 30,
143143
'Mono(1)%loc(1)' : 0.7*dlengy, # x_center of the domain
144144
'Mono(1)%loc(2)' : dlengy/2, # upper boundary of the domain
145145
'Mono(1)%dir' : -math.pi, # direction: -pi/2
146-
146+
147147
# Patch 1: Background ======================================================
148148
'patch_icpp(1)%geometry' : 3,
149149
'patch_icpp(1)%x_centroid' : 0.,
@@ -164,10 +164,10 @@
164164
'patch_icpp(2)%hcid' : 206,
165165
'patch_icpp(2)%alter_patch(1)' : 'T',
166166
'patch_icpp(2)%x_centroid' : -dlengx/4.,
167-
'patch_icpp(2)%y_centroid' : dlengy/2.,
167+
'patch_icpp(2)%y_centroid' : dlengy/2.,
168168
'patch_icpp(2)%length_x' : dlengx/2.+2,
169-
'patch_icpp(2)%length_y' : dlengy,
170-
'patch_icpp(2)%a2' : interface_amp,
169+
'patch_icpp(2)%length_y' : dlengy,
170+
'patch_icpp(2)%a(2)' : interface_amp,
171171
'patch_icpp(2)%vel(1)' : 0.E+00,
172172
'patch_icpp(2)%vel(2)' : 0.0,
173173
'patch_icpp(2)%pres' : patmos_n,
@@ -181,8 +181,8 @@
181181
'fluid_pp(1)%gamma' : 1.E+00/(gammal-1.E+00),
182182
'fluid_pp(1)%pi_inf' : gammal*Bl_n/(gammal-1.E+00),
183183
'fluid_pp(2)%gamma' : 1.E+00/(gammag-1.E+00),
184-
'fluid_pp(2)%pi_inf' : gammag*Bg_n/(gammag-1.E+00),
185-
184+
'fluid_pp(2)%pi_inf' : gammag*Bg_n/(gammag-1.E+00),
185+
186186
#==============================================================================
187187
}))
188188

examples/3D_lungwave/arc_case.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define pulse
3333
P_amp = 10.E+6
3434
P_len = 45 #length of the impulse
35-
theta = -math.pi/2 #direction of propagation
35+
theta = -math.pi/2 #direction of propagation
3636

3737
#non-dim
3838

@@ -44,8 +44,8 @@
4444
stress_char = rho_char*c_char*c_char/gammal
4545

4646
#non-dim the properties
47-
rhog_n = rhog/rho_char
48-
c_g_n = c_g/c_char
47+
rhog_n = rhog/rho_char
48+
c_g_n = c_g/c_char
4949
rhol_n = rhol/rho_char
5050
c_l_n = c_l/c_char
5151
Bg_n = Bg/stress_char
@@ -76,7 +76,7 @@
7676
time_end = 50
7777
cfl = 0.01
7878

79-
dt = cfl * dx/c_l_n
79+
dt = cfl * dx/c_l_n
8080
Nt = int(time_end/dt)
8181
Nframes = 500
8282
tstart = 0
@@ -122,7 +122,7 @@
122122
'time_stepper' : 3,
123123
'weno_order' : 5,
124124
'weno_eps' : 1.E-16,
125-
'weno_Re_flux' : 'F',
125+
'weno_Re_flux' : 'F',
126126
'weno_avg' : 'F',
127127
'mapped_weno' : 'T',
128128
'null_weights' : 'F',
@@ -139,7 +139,7 @@
139139
# ==========================================================================
140140

141141
# Turning on Hypoelasticity ================================================
142-
#'hypoelasticity' : 'T',
142+
#'hypoelasticity' : 'T',
143143
'hyperelasticity' : 'F',
144144
# ==========================================================================
145145

@@ -149,9 +149,9 @@
149149
'prim_vars_wrt' :'T',
150150
'parallel_io' :'T',
151151
# ==========================================================================
152-
152+
153153
# acoustics setting =========================================================
154-
'acoustic_source' : 'T',
154+
'acoustic_source' : 'T',
155155
'num_source' : 1,
156156
'acoustic(1)%support' : 3,
157157
'acoustic(1)%loc(1)' : 4,
@@ -165,7 +165,7 @@
165165
'acoustic(1)%height' : dlengz,
166166
'acoustic(1)%dir' : -math.pi,
167167
#===========================================================================
168-
168+
169169
# Patch 1: Background ======================================================
170170
'patch_icpp(1)%geometry' : 9,
171171
'patch_icpp(1)%x_centroid' : 0.,
@@ -183,7 +183,7 @@
183183
'patch_icpp(1)%alpha(1)' : alphal_back,
184184
'patch_icpp(1)%alpha(2)' : alphag_back,
185185
#'patch_icpp(1)%tau_e(1)' : 0.0,
186-
186+
187187
# ==========================================================================
188188

189189
# Patch 2: Lung ============================================================
@@ -195,9 +195,9 @@
195195
'patch_icpp(2)%y_centroid' : dlengy/2.,
196196
'patch_icpp(2)%z_centroid' : dlengz/2.,
197197
'patch_icpp(2)%length_x' : 2000,#dlengx,#dlengx/2.+2, #
198-
'patch_icpp(2)%length_y' : dlengy,
199-
'patch_icpp(2)%length_z' : dlengz,
200-
'patch_icpp(2)%a2' : interface_amp,
198+
'patch_icpp(2)%length_y' : dlengy,
199+
'patch_icpp(2)%length_z' : dlengz,
200+
'patch_icpp(2)%a(2)' : interface_amp,
201201
'patch_icpp(2)%vel(1)' : 0.E+00,
202202
'patch_icpp(2)%vel(2)' : 0.0,
203203
'patch_icpp(2)%vel(3)' : 0.0,
@@ -213,7 +213,7 @@
213213
'fluid_pp(1)%pi_inf' : gammal*Bl_n/(gammal-1.E+00),
214214
'fluid_pp(1)%G' : G_l_n,
215215
'fluid_pp(2)%gamma' : 1.E+00/(gammag-1.E+00),
216-
'fluid_pp(2)%pi_inf' : gammag*Bg_n/(gammag-1.E+00),
216+
'fluid_pp(2)%pi_inf' : gammag*Bg_n/(gammag-1.E+00),
217217
'fluid_pp(2)%G' : G_g_n,
218218
#==============================================================================
219219
}))

examples/3D_lungwave/case.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define pulse
3333
P_amp = 10.E+6
3434
P_len = 45 #length of the impulse
35-
theta = -math.pi/2 #direction of propagation
35+
theta = -math.pi/2 #direction of propagation
3636

3737
#non-dim
3838

@@ -44,8 +44,8 @@
4444
stress_char = rho_char*c_char*c_char/gammal
4545

4646
#non-dim the properties
47-
rhog_n = rhog/rho_char
48-
c_g_n = c_g/c_char
47+
rhog_n = rhog/rho_char
48+
c_g_n = c_g/c_char
4949
rhol_n = rhol/rho_char
5050
c_l_n = c_l/c_char
5151
Bg_n = Bg/stress_char
@@ -76,7 +76,7 @@
7676
time_end = 50
7777
cfl = 0.01
7878

79-
dt = cfl * dx/c_l_n
79+
dt = cfl * dx/c_l_n
8080
Nt = int(time_end/dt)
8181
Nframes = 500
8282
tstart = 0
@@ -122,7 +122,7 @@
122122
'time_stepper' : 3,
123123
'weno_order' : 5,
124124
'weno_eps' : 1.E-16,
125-
'weno_Re_flux' : 'F',
125+
'weno_Re_flux' : 'F',
126126
'weno_avg' : 'F',
127127
'mapped_weno' : 'T',
128128
'null_weights' : 'F',
@@ -139,7 +139,7 @@
139139
# ==========================================================================
140140

141141
# Turning on Hypoelasticity ================================================
142-
#'hypoelasticity' : 'T',
142+
#'hypoelasticity' : 'T',
143143
'hyperelasticity' : 'F',
144144
# ==========================================================================
145145

@@ -149,9 +149,9 @@
149149
'prim_vars_wrt' :'T',
150150
'parallel_io' :'T',
151151
# ==========================================================================
152-
152+
153153
# acoustics setting =========================================================
154-
'acoustic_source' : 'T',
154+
'acoustic_source' : 'T',
155155
'num_source' : 1,
156156
'acoustic(1)%support' : 3,
157157
'acoustic(1)%loc(1)' : 4,
@@ -165,7 +165,7 @@
165165
'acoustic(1)%height' : dlengz,
166166
'acoustic(1)%dir' : -math.pi,
167167
#===========================================================================
168-
168+
169169
# Patch 1: Background ======================================================
170170
'patch_icpp(1)%geometry' : 9,
171171
'patch_icpp(1)%x_centroid' : 0.,
@@ -183,7 +183,7 @@
183183
'patch_icpp(1)%alpha(1)' : alphal_back,
184184
'patch_icpp(1)%alpha(2)' : alphag_back,
185185
#'patch_icpp(1)%tau_e(1)' : 0.0,
186-
186+
187187
# ==========================================================================
188188

189189
# Patch 2: Lung ============================================================
@@ -195,9 +195,9 @@
195195
'patch_icpp(2)%y_centroid' : dlengy/2.,
196196
'patch_icpp(2)%z_centroid' : dlengz/2.,
197197
'patch_icpp(2)%length_x' : 2000,#dlengx,#dlengx/2.+2, #
198-
'patch_icpp(2)%length_y' : dlengy,
199-
'patch_icpp(2)%length_z' : dlengz,
200-
'patch_icpp(2)%a2' : interface_amp,
198+
'patch_icpp(2)%length_y' : dlengy,
199+
'patch_icpp(2)%length_z' : dlengz,
200+
'patch_icpp(2)%a2)' : interface_amp,
201201
'patch_icpp(2)%vel(1)' : 0.E+00,
202202
'patch_icpp(2)%vel(2)' : 0.0,
203203
'patch_icpp(2)%vel(3)' : 0.0,
@@ -213,7 +213,7 @@
213213
'fluid_pp(1)%pi_inf' : gammal*Bl_n/(gammal-1.E+00),
214214
'fluid_pp(1)%G' : G_l_n,
215215
'fluid_pp(2)%gamma' : 1.E+00/(gammag-1.E+00),
216-
'fluid_pp(2)%pi_inf' : gammag*Bg_n/(gammag-1.E+00),
216+
'fluid_pp(2)%pi_inf' : gammag*Bg_n/(gammag-1.E+00),
217217
'fluid_pp(2)%G' : G_g_n,
218218
#==============================================================================
219219
}))

toolchain/mfc/run/case_dicts.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,15 @@ def analytic(self):
128128
("smooth_patch_id", ParamType.INT), ("hcid", ParamType.INT)]:
129129
PRE_PROCESS[f"patch_icpp({p_id})%{attribute}"] = ty
130130

131-
for real_attr in ["radius", "radii", "epsilon", "beta", "normal", "alpha_rho", "a2",
132-
"a3", "a4", "a5", "a6", "a7","a8", "a9", "a10", "a11", "a12", 'non_axis_sym',
133-
"normal", "smooth_coeff", "rho", "vel", "alpha", "gamma",
134-
"pi_inf", "r0", "v0", "p0", "m0", "cv", "qv", "qvp"]:
135-
131+
for real_attr in ["radius", "radii", "epsilon", "beta", "normal", "alpha_rho",
132+
'non_axis_sym', "normal", "smooth_coeff", "rho", "vel",
133+
"alpha", "gamma", "pi_inf", "r0", "v0", "p0", "m0", "cv",
134+
"qv", "qvp"]:
136135
PRE_PROCESS[f"patch_icpp({p_id})%{real_attr}"] = ParamType.REAL
136+
137+
for real_attr in range(2, 9+1):
138+
PRE_PROCESS['patch_icpp({p_id})%a({real_attr})'] = ParamType.REAL
139+
137140
PRE_PROCESS[f"patch_icpp({p_id})%pres"] = ParamType.REAL.analytic()
138141

139142
for i in range(100):

0 commit comments

Comments
 (0)