Skip to content

Commit 4c4fb74

Browse files
authored
Add examples (#573)
1 parent 4ebd9b0 commit 4c4fb74

File tree

9 files changed

+124
-1
lines changed

9 files changed

+124
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Taylor-Green Vortex (3D)
2+
3+
Reference: Hillewaert, K. (2013). TestCase C3.5 - DNS of the transition of the Taylor-Green vortex, Re=1600 - Introduction and result summary. 2nd International Workshop on high-order methods for CFD.
4+
5+
## Final Condition
6+
This figure shows the isosurface with zero q-criterion.
7+
![Density](result.png)
8+
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#!/usr/bin/env python3
2+
3+
import math
4+
import json
5+
6+
N = 256
7+
8+
Re = 1600
9+
L = 1
10+
P0 = 101325
11+
rho0 = 1
12+
C0 = math.sqrt(1.4*P0)
13+
V0 = 0.1*C0
14+
mu = V0*L/Re
15+
16+
cfl = 0.5
17+
dx = 2*math.pi*L/(N+1)
18+
19+
dt = cfl * dx / (C0)
20+
21+
tC = L/V0
22+
tEnd = 20*tC
23+
24+
Nt = int(tEnd/dt)
25+
26+
27+
# Configuring case dictionary
28+
print(json.dumps({
29+
# Logistics ================================================
30+
'run_time_info' : 'T',
31+
# ==========================================================
32+
33+
# Computational Domain Parameters ==========================
34+
'x_domain%beg' : -math.pi*L,
35+
'x_domain%end' : math.pi*L,
36+
'y_domain%beg' : -math.pi*L,
37+
'y_domain%end' : math.pi*L,
38+
'z_domain%beg' : -math.pi*L,
39+
'z_domain%end' : math.pi*L,
40+
'm' : N,
41+
'n' : N,
42+
'p' : N,
43+
'cyl_coord' : 'F',
44+
'dt' : dt,
45+
't_step_start' : 13529,
46+
't_step_stop' : Nt,
47+
't_step_save' : int(Nt/100),
48+
# ==========================================================
49+
50+
# Simulation Algorithm Parameters ==========================
51+
'num_patches' : 1,
52+
'model_eqns' : 2,
53+
'alt_soundspeed' : 'F',
54+
'num_fluids' : 1,
55+
'mixture_err' : 'T',
56+
'time_stepper' : 3,
57+
'weno_order' : 5,
58+
'weno_eps' : 1.0E-16,
59+
'weno_Re_flux' : 'F',
60+
'weno_avg' : 'F',
61+
'mapped_weno' : 'T',
62+
'riemann_solver' : 2,
63+
'wave_speeds' : 1,
64+
'avg_state' : 2,
65+
'bc_x%beg' : -1,
66+
'bc_x%end' : -1,
67+
'bc_y%beg' : -1,
68+
'bc_y%end' : -1,
69+
'bc_z%beg' : -1,
70+
'bc_z%end' : -1,
71+
# ==========================================================
72+
73+
# Formatted Database Files Structure Parameters ============
74+
'format' : 1,
75+
'precision' : 2,
76+
# 'prim_vars_wrt' :'T',
77+
'omega_wrt(1)' :'T',
78+
'omega_wrt(2)' :'T',
79+
'omega_wrt(3)' :'T',
80+
'qm_wrt' :'T',
81+
'fd_order' : 4,
82+
'parallel_io' :'T',
83+
# ==========================================================
84+
85+
# I will use 1 for WATER properties, and 2 for AIR properties
86+
# Patch 1: Background (AIR - 2) =============================
87+
'patch_icpp(1)%geometry' : 9,
88+
'patch_icpp(1)%x_centroid' : 0,
89+
'patch_icpp(1)%y_centroid' : 0,
90+
'patch_icpp(1)%z_centroid' : 0,
91+
'patch_icpp(1)%length_x' : 2*math.pi*L,
92+
'patch_icpp(1)%length_y' : 2*math.pi*L,
93+
'patch_icpp(1)%length_z' : 2*math.pi*L,
94+
'patch_icpp(1)%vel(1)' : f"{V0}*sin(x/{L})*cos(y/{L})*sin(z/{L})",
95+
'patch_icpp(1)%vel(2)' : f"-{V0}*cos(x/{L})*sin(y/{L})*sin(z/{L})",
96+
'patch_icpp(1)%vel(3)' : 0,
97+
'patch_icpp(1)%pres' : f"{P0} + ({rho0}*{V0}**2/16)*(cos(2*x/{L}) + cos(2*y/{L}))*(cos(2*z/{L}) + 2)",
98+
'patch_icpp(1)%alpha_rho(1)' : 1,
99+
'patch_icpp(1)%alpha(1)' : 1,
100+
# ==========================================================
101+
102+
# Fluids Physical Parameters ===============================
103+
'fluid_pp(1)%gamma' : 1.0E+00/(1.4-1),
104+
'fluid_pp(1)%pi_inf' : 0,
105+
'fluid_pp(1)%Re(1)' : 1/mu,
106+
# ==========================================================
107+
}))
108+
109+
# ==============================================================================
1.1 MB
Loading

examples/3D_ibm_bowshock/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# IBM Bow Shock (3D)
2+
3+
## Final Condition
4+
5+
![Density](result.png)
6+
File renamed without changes.
130 KB
Loading

examples/3D_rayleigh_taylor/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
## Centerline Velocities
88

9-
![Linear Theory Comparison](linear_theory.jpg)
9+
![Linear Theory Comparison](linear_theory.png)
-24.1 KB
Binary file not shown.
44.6 KB
Loading

0 commit comments

Comments
 (0)