Skip to content

Commit 31925f5

Browse files
committed
update examples
1 parent 0d2d33f commit 31925f5

3 files changed

Lines changed: 118 additions & 84 deletions

File tree

examples/2D_axisym_hypo_hlld/case.py

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
import json
33

44
# 2D axisymmetric hypoelastic case with HLLD solver.
5-
# Solid sphere in liquid hit by focused acoustic pulse.
5+
# Epoxy sphere in water hit by focused acoustic pulse.
6+
# Water: gamma=4.4, pi_inf=6.0e8, G=0
7+
# Epoxy: gamma=4.4, pi_inf=2.4e9, rho=1180, G=1.5e9
8+
9+
gamma_w, pi_inf_w, rho_w = 4.4, 6.0e8, 1000.0
10+
gamma_e, pi_inf_e, rho_e = 4.4, 2.4e9, 1180.0
611

712
config = {
813
"run_time_info": "T",
@@ -12,32 +17,33 @@
1217
"y_domain%beg": 0.0,
1318
"y_domain%end": 1.0,
1419
"cyl_coord": "T",
15-
"m": 49,
16-
"n": 49,
20+
"m": 99,
21+
"n": 99,
1722
"p": 0,
18-
"dt": 2.0e-6,
23+
"dt": 1.5e-6,
1924
"t_step_start": 0,
20-
"t_step_stop": 250,
21-
"t_step_save": 50,
25+
"t_step_stop": 400,
26+
"t_step_save": 100,
2227
# Simulation Algorithm
2328
"num_patches": 2,
2429
"model_eqns": 2,
2530
"alt_soundspeed": "F",
2631
"num_fluids": 2,
2732
"mpp_lim": "F",
2833
"mixture_err": "F",
29-
"time_stepper": 1,
30-
"weno_order": 1,
31-
"weno_eps": 1.0e-20,
34+
"time_stepper": 3,
35+
"weno_order": 5,
36+
"weno_eps": 1.0e-16,
37+
"mapped_weno": "T",
3238
"null_weights": "F",
3339
"mp_weno": "F",
3440
"riemann_solver": 4,
3541
"wave_speeds": 1,
3642
"avg_state": 2,
37-
"bc_x%beg": -2,
38-
"bc_x%end": -2,
43+
"bc_x%beg": -6,
44+
"bc_x%end": -6,
3945
"bc_y%beg": -2,
40-
"bc_y%end": -2,
46+
"bc_y%end": -6,
4147
# Output
4248
"format": 1,
4349
"precision": 2,
@@ -47,7 +53,7 @@
4753
# Hypoelasticity
4854
"hypoelasticity": "T",
4955
"fd_order": 4,
50-
# Patch 1: Liquid background
56+
# Patch 1: Water background
5157
"patch_icpp(1)%geometry": 3,
5258
"patch_icpp(1)%x_centroid": 0.5,
5359
"patch_icpp(1)%y_centroid": 0.5,
@@ -57,23 +63,27 @@
5763
"patch_icpp(1)%vel(2)": 0.0,
5864
"patch_icpp(1)%pres": 1e05,
5965
"patch_icpp(1)%tau_e(1)": 0.0,
60-
"patch_icpp(1)%alpha_rho(1)": 1000 * (1.0 - 1e-8),
66+
"patch_icpp(1)%alpha_rho(1)": rho_w * (1.0 - 1e-8),
6167
"patch_icpp(1)%alpha(1)": 1.0 - 1e-8,
62-
"patch_icpp(1)%alpha_rho(2)": 1000 * 1e-8,
68+
"patch_icpp(1)%alpha_rho(2)": rho_e * 1e-8,
6369
"patch_icpp(1)%alpha(2)": 1e-8,
64-
# Patch 2: Solid sphere (circle, offset from axis)
70+
# Patch 2: Epoxy square (cylinder in axisym)
6571
"patch_icpp(2)%alter_patch(1)": "T",
66-
"patch_icpp(2)%geometry": 2,
72+
"patch_icpp(2)%geometry": 3,
6773
"patch_icpp(2)%x_centroid": 0.6,
6874
"patch_icpp(2)%y_centroid": 0.2,
69-
"patch_icpp(2)%radius": 0.1,
75+
"patch_icpp(2)%length_x": 0.2,
76+
"patch_icpp(2)%length_y": 0.2,
77+
"patch_icpp(2)%smoothen": "T",
78+
"patch_icpp(2)%smooth_patch_id": 1,
79+
"patch_icpp(2)%smooth_coeff": 2.0,
7080
"patch_icpp(2)%vel(1)": 0.0,
7181
"patch_icpp(2)%vel(2)": 0.0,
7282
"patch_icpp(2)%pres": 1e05,
7383
"patch_icpp(2)%tau_e(1)": 0.0,
74-
"patch_icpp(2)%alpha_rho(1)": 1000 * 1e-8,
84+
"patch_icpp(2)%alpha_rho(1)": rho_w * 1e-8,
7585
"patch_icpp(2)%alpha(1)": 1e-8,
76-
"patch_icpp(2)%alpha_rho(2)": 1000 * (1.0 - 1e-8),
86+
"patch_icpp(2)%alpha_rho(2)": rho_e * (1.0 - 1e-8),
7787
"patch_icpp(2)%alpha(2)": 1.0 - 1e-8,
7888
# Acoustic source (axisymmetric focused)
7989
"acoustic_source": "T",
@@ -89,12 +99,12 @@
8999
"acoustic(1)%gauss_sigma_time": 4e-5,
90100
"acoustic(1)%delay": 2e-4,
91101
# Fluids Physical Parameters
92-
"fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00),
93-
"fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00),
102+
"fluid_pp(1)%gamma": 1.0 / (gamma_w - 1.0),
103+
"fluid_pp(1)%pi_inf": gamma_w * pi_inf_w / (gamma_w - 1.0),
94104
"fluid_pp(1)%G": 0.0,
95-
"fluid_pp(2)%gamma": 1.0e00 / (4.4e00 - 1.0e00),
96-
"fluid_pp(2)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00),
97-
"fluid_pp(2)%G": 1e9,
105+
"fluid_pp(2)%gamma": 1.0 / (gamma_e - 1.0),
106+
"fluid_pp(2)%pi_inf": gamma_e * pi_inf_e / (gamma_e - 1.0),
107+
"fluid_pp(2)%G": 1.5e9,
98108
}
99109

100110
print(json.dumps(config, indent=4))

examples/2D_hypo_hlld/case.py

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,48 @@
11
#!/usr/bin/env python3
22
import json
33

4+
# 2D hypoelastic case with HLLD solver.
5+
# Epoxy circle in water hit by focused acoustic pulse.
6+
# Water: gamma=4.4, pi_inf=6.0e8, G=0
7+
# Epoxy: gamma=4.4, pi_inf=2.4e9, rho=1180, G=1.5e9
8+
9+
gamma_w, pi_inf_w, rho_w = 4.4, 6.0e8, 1000.0
10+
gamma_e, pi_inf_e, rho_e = 4.4, 2.4e9, 1180.0
11+
412
config = {
513
"run_time_info": "T",
614
# Computational Domain
715
"x_domain%beg": 0.0,
816
"x_domain%end": 1.0,
917
"y_domain%beg": 0.0,
1018
"y_domain%end": 1.0,
11-
"m": 49,
12-
"n": 49,
19+
"m": 99,
20+
"n": 99,
1321
"p": 0,
14-
"dt": 3.0e-6,
22+
"dt": 1.5e-6,
1523
"t_step_start": 0,
16-
"t_step_stop": 250,
17-
"t_step_save": 50,
24+
"t_step_stop": 400,
25+
"t_step_save": 100,
1826
# Simulation Algorithm
1927
"num_patches": 2,
2028
"model_eqns": 2,
2129
"alt_soundspeed": "F",
2230
"num_fluids": 2,
23-
"mpp_lim": "T",
31+
"mpp_lim": "F",
2432
"mixture_err": "F",
25-
"time_stepper": 1,
26-
"weno_order": 1,
27-
"weno_eps": 1.0e-20,
33+
"time_stepper": 3,
34+
"weno_order": 5,
35+
"weno_eps": 1.0e-16,
36+
"mapped_weno": "T",
2837
"null_weights": "F",
2938
"mp_weno": "F",
3039
"riemann_solver": 4,
3140
"wave_speeds": 1,
3241
"avg_state": 2,
33-
"bc_x%beg": -3,
34-
"bc_x%end": -3,
35-
"bc_y%beg": -3,
36-
"bc_y%end": -3,
42+
"bc_x%beg": -6,
43+
"bc_x%end": -6,
44+
"bc_y%beg": -6,
45+
"bc_y%end": -6,
3746
# Output
3847
"format": 1,
3948
"precision": 2,
@@ -43,7 +52,7 @@
4352
# Hypoelasticity
4453
"hypoelasticity": "T",
4554
"fd_order": 4,
46-
# Patch 1: Liquid background
55+
# Patch 1: Water background
4756
"patch_icpp(1)%geometry": 3,
4857
"patch_icpp(1)%x_centroid": 0.5,
4958
"patch_icpp(1)%y_centroid": 0.5,
@@ -53,25 +62,29 @@
5362
"patch_icpp(1)%vel(2)": 0.0,
5463
"patch_icpp(1)%pres": 1e05,
5564
"patch_icpp(1)%tau_e(1)": 0.0,
56-
"patch_icpp(1)%alpha_rho(1)": 1000 * (1.0 - 1e-8),
65+
"patch_icpp(1)%alpha_rho(1)": rho_w * (1.0 - 1e-8),
5766
"patch_icpp(1)%alpha(1)": 1.0 - 1e-8,
58-
"patch_icpp(1)%alpha_rho(2)": 1000 * 1e-8,
67+
"patch_icpp(1)%alpha_rho(2)": rho_e * 1e-8,
5968
"patch_icpp(1)%alpha(2)": 1e-8,
60-
# Patch 2: Solid circle
69+
# Patch 2: Epoxy square
6170
"patch_icpp(2)%alter_patch(1)": "T",
62-
"patch_icpp(2)%geometry": 2,
71+
"patch_icpp(2)%geometry": 3,
6372
"patch_icpp(2)%x_centroid": 0.6,
6473
"patch_icpp(2)%y_centroid": 0.5,
65-
"patch_icpp(2)%radius": 0.1,
74+
"patch_icpp(2)%length_x": 0.2,
75+
"patch_icpp(2)%length_y": 0.2,
76+
"patch_icpp(2)%smoothen": "T",
77+
"patch_icpp(2)%smooth_patch_id": 1,
78+
"patch_icpp(2)%smooth_coeff": 2.0,
6679
"patch_icpp(2)%vel(1)": 0.0,
6780
"patch_icpp(2)%vel(2)": 0.0,
6881
"patch_icpp(2)%pres": 1e05,
6982
"patch_icpp(2)%tau_e(1)": 0.0,
70-
"patch_icpp(2)%alpha_rho(1)": 1000 * 1e-8,
83+
"patch_icpp(2)%alpha_rho(1)": rho_w * 1e-8,
7184
"patch_icpp(2)%alpha(1)": 1e-8,
72-
"patch_icpp(2)%alpha_rho(2)": 1000 * (1.0 - 1e-8),
85+
"patch_icpp(2)%alpha_rho(2)": rho_e * (1.0 - 1e-8),
7386
"patch_icpp(2)%alpha(2)": 1.0 - 1e-8,
74-
# Acoustic source
87+
# Acoustic source (2D focused arc)
7588
"acoustic_source": "T",
7689
"num_source": 1,
7790
"acoustic(1)%support": 5,
@@ -86,12 +99,12 @@
8699
"acoustic(1)%gauss_sigma_time": 4e-5,
87100
"acoustic(1)%delay": 2e-4,
88101
# Fluids Physical Parameters
89-
"fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00),
90-
"fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00),
102+
"fluid_pp(1)%gamma": 1.0 / (gamma_w - 1.0),
103+
"fluid_pp(1)%pi_inf": gamma_w * pi_inf_w / (gamma_w - 1.0),
91104
"fluid_pp(1)%G": 0.0,
92-
"fluid_pp(2)%gamma": 1.0e00 / (4.4e00 - 1.0e00),
93-
"fluid_pp(2)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00),
94-
"fluid_pp(2)%G": 1e9,
105+
"fluid_pp(2)%gamma": 1.0 / (gamma_e - 1.0),
106+
"fluid_pp(2)%pi_inf": gamma_e * pi_inf_e / (gamma_e - 1.0),
107+
"fluid_pp(2)%G": 1.5e9,
95108
}
96109

97110
print(json.dumps(config, indent=4))

examples/3D_hypo_hlld/case.py

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
import json
33

44
# 3D hypoelastic case with HLLD solver.
5-
# Solid sphere in liquid hit by focused acoustic pulse.
5+
# Epoxy sphere in water hit by focused acoustic pulse.
6+
# Water: gamma=4.4, pi_inf=6.0e8, G=0
7+
# Epoxy: gamma=4.4, pi_inf=2.4e9, rho=1180, G=1.5e9
8+
9+
gamma_w, pi_inf_w, rho_w = 4.4, 6.0e8, 1000.0
10+
gamma_e, pi_inf_e, rho_e = 4.4, 2.4e9, 1180.0
611

712
config = {
813
"run_time_info": "T",
@@ -13,36 +18,37 @@
1318
"y_domain%end": 1.0,
1419
"z_domain%beg": 0.0,
1520
"z_domain%end": 1.0,
16-
"m": 24,
17-
"n": 24,
18-
"p": 24,
21+
"m": 49,
22+
"n": 49,
23+
"p": 49,
1924
"cyl_coord": "F",
20-
"dt": 6.0e-6,
25+
"dt": 3.0e-6,
2126
"t_step_start": 0,
22-
"t_step_stop": 150,
27+
"t_step_stop": 200,
2328
"t_step_save": 50,
24-
# Simulation Algorithm Parameters
29+
# Simulation Algorithm
2530
"num_patches": 2,
2631
"model_eqns": 2,
2732
"alt_soundspeed": "F",
2833
"num_fluids": 2,
29-
"mpp_lim": "T",
34+
"mpp_lim": "F",
3035
"mixture_err": "F",
31-
"time_stepper": 1,
32-
"weno_order": 1,
33-
"weno_eps": 1.0e-20,
36+
"time_stepper": 3,
37+
"weno_order": 5,
38+
"weno_eps": 1.0e-16,
39+
"mapped_weno": "T",
3440
"null_weights": "F",
3541
"mp_weno": "F",
3642
"riemann_solver": 4,
3743
"wave_speeds": 1,
3844
"avg_state": 2,
39-
"bc_x%beg": -3,
40-
"bc_x%end": -3,
41-
"bc_y%beg": -3,
42-
"bc_y%end": -3,
43-
"bc_z%beg": -3,
44-
"bc_z%end": -3,
45-
# Formatted Database Files Structure Parameters
45+
"bc_x%beg": -6,
46+
"bc_x%end": -6,
47+
"bc_y%beg": -6,
48+
"bc_y%end": -6,
49+
"bc_z%beg": -6,
50+
"bc_z%end": -6,
51+
# Output
4652
"format": 1,
4753
"precision": 2,
4854
"prim_vars_wrt": "T",
@@ -51,7 +57,7 @@
5157
# Hypoelasticity
5258
"hypoelasticity": "T",
5359
"fd_order": 4,
54-
# Patch 1: Background liquid (3D box)
60+
# Patch 1: Water background (3D box)
5561
"patch_icpp(1)%geometry": 9,
5662
"patch_icpp(1)%x_centroid": 0.5,
5763
"patch_icpp(1)%y_centroid": 0.5,
@@ -64,27 +70,32 @@
6470
"patch_icpp(1)%vel(3)": 0.0,
6571
"patch_icpp(1)%pres": 1e05,
6672
"patch_icpp(1)%tau_e(1)": 0.0,
67-
"patch_icpp(1)%alpha_rho(1)": 1000 * (1.0 - 1e-8),
73+
"patch_icpp(1)%alpha_rho(1)": rho_w * (1.0 - 1e-8),
6874
"patch_icpp(1)%alpha(1)": 1.0 - 1e-8,
69-
"patch_icpp(1)%alpha_rho(2)": 1000 * 1e-8,
75+
"patch_icpp(1)%alpha_rho(2)": rho_e * 1e-8,
7076
"patch_icpp(1)%alpha(2)": 1e-8,
71-
# Patch 2: Solid sphere
77+
# Patch 2: Epoxy cube
7278
"patch_icpp(2)%alter_patch(1)": "T",
73-
"patch_icpp(2)%geometry": 8,
79+
"patch_icpp(2)%geometry": 9,
7480
"patch_icpp(2)%x_centroid": 0.6,
7581
"patch_icpp(2)%y_centroid": 0.5,
7682
"patch_icpp(2)%z_centroid": 0.5,
77-
"patch_icpp(2)%radius": 0.1,
83+
"patch_icpp(2)%length_x": 0.2,
84+
"patch_icpp(2)%length_y": 0.2,
85+
"patch_icpp(2)%length_z": 0.2,
86+
"patch_icpp(2)%smoothen": "T",
87+
"patch_icpp(2)%smooth_patch_id": 1,
88+
"patch_icpp(2)%smooth_coeff": 2.0,
7889
"patch_icpp(2)%vel(1)": 0.0,
7990
"patch_icpp(2)%vel(2)": 0.0,
8091
"patch_icpp(2)%vel(3)": 0.0,
8192
"patch_icpp(2)%pres": 1e05,
8293
"patch_icpp(2)%tau_e(1)": 0.0,
83-
"patch_icpp(2)%alpha_rho(1)": 1000 * 1e-8,
94+
"patch_icpp(2)%alpha_rho(1)": rho_w * 1e-8,
8495
"patch_icpp(2)%alpha(1)": 1e-8,
85-
"patch_icpp(2)%alpha_rho(2)": 1000 * (1.0 - 1e-8),
96+
"patch_icpp(2)%alpha_rho(2)": rho_e * (1.0 - 1e-8),
8697
"patch_icpp(2)%alpha(2)": 1.0 - 1e-8,
87-
# Acoustic source (support 7 = 3D focused)
98+
# Acoustic source (3D focused)
8899
"acoustic_source": "T",
89100
"num_source": 1,
90101
"acoustic(1)%support": 7,
@@ -99,12 +110,12 @@
99110
"acoustic(1)%gauss_sigma_time": 4e-5,
100111
"acoustic(1)%delay": 2e-4,
101112
# Fluids Physical Parameters
102-
"fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00),
103-
"fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00),
113+
"fluid_pp(1)%gamma": 1.0 / (gamma_w - 1.0),
114+
"fluid_pp(1)%pi_inf": gamma_w * pi_inf_w / (gamma_w - 1.0),
104115
"fluid_pp(1)%G": 0.0,
105-
"fluid_pp(2)%gamma": 1.0e00 / (4.4e00 - 1.0e00),
106-
"fluid_pp(2)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00),
107-
"fluid_pp(2)%G": 1e9,
116+
"fluid_pp(2)%gamma": 1.0 / (gamma_e - 1.0),
117+
"fluid_pp(2)%pi_inf": gamma_e * pi_inf_e / (gamma_e - 1.0),
118+
"fluid_pp(2)%G": 1.5e9,
108119
}
109120

110121
print(json.dumps(config, indent=4))

0 commit comments

Comments
 (0)