Skip to content

Commit f461885

Browse files
author
Anand
committed
Zero Circulation Vortex with subsonic Inflow/Outflow
1 parent dce7d11 commit f461885

File tree

1 file changed

+122
-0
lines changed
  • examples/2D_zero_circ_vortex

1 file changed

+122
-0
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
import math
2+
import json
3+
4+
# Numerical setup
5+
Nx = 250
6+
Ny = 125
7+
dx = 40./(1.*(Nx+1))
8+
9+
M_inf = 0.3
10+
Mv = 0.1
11+
12+
p_inf = 101325
13+
rho_inf = 1
14+
gam = 1.4
15+
16+
c = math.sqrt(gam*(p_inf) / rho_inf)
17+
u_inf = M_inf * c
18+
cfl = 0.3
19+
mydt = cfl * dx / c
20+
Tfinal = 150*1 / u_inf
21+
Nt = int(Tfinal/mydt)
22+
23+
# Configuring case dictionary
24+
print(json.dumps({
25+
# Logistics ================================================================
26+
'run_time_info' : 'T',
27+
# ==========================================================================
28+
29+
# Computational Domain Parameters ==========================================
30+
'x_domain%beg' : -20,
31+
'x_domain%end' : 20,
32+
'y_domain%beg' : -10,
33+
'y_domain%end' : 10,
34+
'm' : Nx,
35+
'n' : Ny,
36+
'p' : 0,
37+
'dt' : mydt,
38+
't_step_start' : 0,
39+
't_step_stop' : Nt,
40+
't_step_save' : int(Nt/100),
41+
# ==========================================================================
42+
43+
# Simulation Algorithm Parameters ==========================================
44+
'num_patches' : 2,
45+
'model_eqns' : 2,
46+
'alt_soundspeed' : 'F',
47+
'num_fluids' : 1,
48+
'mpp_lim' : 'F',
49+
'mixture_err' : 'F',
50+
'time_stepper' : 3,
51+
'weno_order' : 5,
52+
'weno_eps' : 1.E-16,
53+
'mapped_weno' : 'T',
54+
'null_weights' : 'F',
55+
'mp_weno' : 'F',
56+
'riemann_solver' : 2,
57+
'wave_speeds' : 1,
58+
'avg_state' : 2,
59+
'bc_x%beg' : -7,
60+
'bc_x%end' : -8,
61+
'bc_y%beg' : -6,
62+
'bc_y%end' : -6,
63+
# ==========================================================================
64+
65+
# Formatted Database Files Structure Parameters ============================
66+
'format' : 1,
67+
'precision' : 2,
68+
'prim_vars_wrt' :'T',
69+
'parallel_io' :'T',
70+
'omega_wrt(3)' :'T',
71+
'fd_order' : 2,
72+
# ==========================================================================
73+
74+
# Patch 1 ==================================================================
75+
'patch_icpp(1)%geometry' : 3,
76+
'patch_icpp(1)%x_centroid' : 0,
77+
'patch_icpp(1)%y_centroid' : 0,
78+
'patch_icpp(1)%length_x' : 40.,
79+
'patch_icpp(1)%length_y' : 20.,
80+
'patch_icpp(1)%vel(1)' : u_inf,
81+
'patch_icpp(1)%vel(2)' : 0,
82+
'patch_icpp(1)%pres' : 101325,
83+
'patch_icpp(1)%alpha_rho(1)' : 1,
84+
'patch_icpp(1)%alpha(1)' : 1.,
85+
# ==========================================================================
86+
87+
# Patch 2 ==================================================================
88+
'patch_icpp(2)%geometry' : 2,
89+
'patch_icpp(2)%x_centroid' : 0,
90+
'patch_icpp(2)%y_centroid' : 0,
91+
'patch_icpp(2)%radius' : 1.,
92+
'patch_icpp(2)%vel(1)' : f"{u_inf}*(1 - ({Mv} / {M_inf}))*y*exp(0.5*(1 - sqrt(x**2 + y**2))) ",
93+
'patch_icpp(2)%vel(2)' : f"{u_inf}*(({Mv} / {M_inf}))*x*exp(0.5*(1 - sqrt(x**2 + y**2)))",
94+
'patch_icpp(2)%pres' : f"{p_inf}*(1 - 0.5*({gam} - 1)*({Mv} / {M_inf})**2*exp(0.5*(1 - sqrt(x**2 + y**2))))**({gam} / ({gam} - 1))",
95+
'patch_icpp(2)%alpha_rho(1)' : f"{rho_inf}*(1 - 0.5*({gam} - 1)*({Mv} / {M_inf})**2*exp(0.5*(1 - sqrt(x**2 + y**2))))**(1 / ({gam} - 1))",
96+
'patch_icpp(2)%alpha(1)' : 1.,
97+
'patch_icpp(2)%alter_patch(1)' : 'T',
98+
# ==========================================================================
99+
100+
# CBC Inflow / Outflow ========================================
101+
'bc_x%grcbc_in' : 'T',
102+
'bc_x%grcbc_out' : 'T',
103+
'bc_x%grcbc_vel_out' : 'T',
104+
'bc_x%u_in' : u_inf,
105+
'bc_x%v_in' : 0,
106+
'bc_x%w_in' : 0,
107+
'bc_x%pres_in' : p_inf,
108+
'bc_x%alpha_rho_in(1)' : rho_inf,
109+
'bc_x%alpha_in(1)' : 1,
110+
'bc_x%u_out' : u_inf,
111+
'bc_x%v_out' : 0,
112+
'bc_x%w_out' : 0,
113+
'bc_x%pres_out' : p_inf,
114+
# # ========================================================================
115+
116+
# Fluids Physical Parameters ===============================================
117+
'fluid_pp(1)%gamma' : 1.E+00/(gam-1.E+00),
118+
'fluid_pp(1)%pi_inf' : 0.0,
119+
# ==========================================================================
120+
}))
121+
122+
# ==============================================================================

0 commit comments

Comments
 (0)