-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathcase.py
More file actions
103 lines (95 loc) · 2.19 KB
/
case.py
File metadata and controls
103 lines (95 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/usr/bin/env python3
import json
import math
lam = 0.2
h = 1.2
k = 2 * math.pi / lam
amp = 0.05 / k
# Numerical setup
x0 = -lam / 2
x1 = lam / 2
y0 = 0.0
y1 = h
Nx = 199
Ny = 1199
eps = 1e-6
dx = lam / (Nx + 1)
c = math.sqrt(1.4 * 1e5 / 1)
cfl = 0.5
dt = cfl * dx / c
Nt = math.ceil(2 / dt)
Ns = math.ceil(Nt / 100)
# Configuration case dictionary
data = {
# Logistics
"run_time_info": "T",
# Computational Domain
"x_domain%beg": x0,
"x_domain%end": x1,
"y_domain%beg": y0,
"y_domain%end": y1,
"m": Nx,
"n": Ny,
"p": 0,
"cyl_coord": "F",
"dt": dt,
"t_step_start": 0,
"t_step_stop": Nt,
"t_step_save": Ns,
# Simulation Algorithm
"model_eqns": 3,
"alt_soundspeed": "F",
"mixture_err": "T",
"mpp_lim": "T",
"time_stepper": 3,
"avg_state": 2,
"weno_order": 5,
"weno_eps": 1e-16,
"mapped_weno": "T",
"null_weights": "F",
"mp_weno": "T",
"weno_Re_flux": "T",
"riemann_solver": 2,
"wave_speeds": 1,
"bc_x%beg": -2,
"bc_x%end": -2,
"bc_y%beg": -16,
"bc_y%end": -16,
"num_patches": 1,
"num_fluids": 2,
"viscous": "T",
# Database Structure Parameters
"format": 1,
"precision": 2,
"prim_vars_wrt": "T",
"parallel_io": "T",
# Fluid Parameters (Heavy Gas)
"fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00),
"fluid_pp(1)%pi_inf": 0.0e00,
"fluid_pp(1)%Re(1)": 1 / 0.0219,
# Fluid Parameters (Light Gas)
"fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00),
"fluid_pp(2)%pi_inf": 0.0e00,
"fluid_pp(2)%Re(1)": 1 / 0.0073,
# Body Forces
"bf_y%enabled": "T",
"bf_y%k": 0.0,
"bf_y%w": 0.0,
"bf_y%p": 0.0,
"bf_y%g": -9.81,
# Water Patch
"patch_icpp(1)%geometry": 3,
"patch_icpp(1)%hcid": 204,
"patch_icpp(1)%x_centroid": 0,
"patch_icpp(1)%y_centroid": h / 2,
"patch_icpp(1)%length_x": lam,
"patch_icpp(1)%length_y": h,
"patch_icpp(1)%vel(1)": 0.0,
"patch_icpp(1)%vel(2)": 0.0,
"patch_icpp(1)%pres": 1e5,
"patch_icpp(1)%alpha_rho(1)": (1 - eps),
"patch_icpp(1)%alpha_rho(2)": eps * 1,
"patch_icpp(1)%alpha(1)": 1 - eps,
"patch_icpp(1)%alpha(2)": eps,
}
print(json.dumps(data))