Skip to content

Commit 18febdf

Browse files
authored
Minor refactor and add tests to test suite
1 parent 2d65013 commit 18febdf

File tree

12 files changed

+41532
-36
lines changed

12 files changed

+41532
-36
lines changed

docs/documentation/case.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ These physical parameters must be consistent with fluid material's parameters de
279279
| `m` | Real | NACA airfoil parameters (see below) |
280280
| `p` | Real | NACA airfoil parameters (see below) |
281281
| `slip` | Logical | Apply a slip boundary |
282+
| `model%%filepath` | String | Path to an STL or OBJ file (not all OBJs are supported). |
283+
| `model%%scale(i)` | Real | Model's (applied) scaling factor for component $i$. |
284+
| `model%%rotate(i)` | Real | Model's (applied) angle of rotation about axis $i$. |
285+
| `model%%translate(i)` | Real | Model's $i$-th component of (applied) translation. |
286+
| `model%%spc` | Integer | Number of samples per cell when discretizing the model into the grid. |
287+
| `model%%threshold` | Real | Ray fraction inside the model patch above which the fraction is set to one.|
282288

283289
These parameters should be prepended with `patch_ib(j)%` where $j$ is the patch index.
284290

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
solid 20deg_wedge
2+
facet normal 0.000000e+00 -0.000000e+00 1.000000e+00
3+
outer loop
4+
vertex 1.511113e-02 0.000000e+00 0.000000e+00
5+
vertex 1.511113e-02 1.100000e-02 0.000000e+00
6+
vertex 0.000000e+00 5.500000e-03 0.000000e+00
7+
endloop
8+
endfacet
9+
endsolid 20deg_wedge

examples/2D_IBM_STL/case.py

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#!/usr/bin/env python3
2+
3+
import json
4+
import math
5+
6+
# Dynamic Viscosity
7+
Mu1 = 0.0000184
8+
#Mu2 = 0.01
9+
rho1 = 0.2199
10+
gam_a = 1.4
11+
# Patch Design
12+
D = 0.01
13+
14+
# Configuring case dictionary
15+
print(json.dumps({
16+
# Logistics ================================================================
17+
'run_time_info' : 'T',
18+
# ==========================================================================
19+
20+
# Computational Domain Parameters ==========================================
21+
'x_domain%beg' : -6*D,
22+
'x_domain%end' : 6*D,
23+
'y_domain%beg' : -3*D,
24+
'y_domain%end' : 3*D,
25+
'm' : 399,
26+
'n' : 199,
27+
'p' : 0,
28+
'dt' : 2.0E-07,
29+
't_step_start' : 0,
30+
't_step_stop' : 3000,
31+
't_step_save' : 30,
32+
# ==========================================================================
33+
34+
# Simulation Algorithm Parameters ==========================================
35+
'num_patches' : 1,
36+
'model_eqns' : 2,
37+
'alt_soundspeed' : 'F',
38+
'num_fluids' : 1,
39+
'time_stepper' : 3,
40+
'weno_order' : 5,
41+
'weno_eps' : 1.E-16,
42+
'weno_Re_flux' : 'F',
43+
'weno_avg' : 'F',
44+
'avg_state' : 2,
45+
'mapped_weno' : 'F',
46+
'null_weights' : 'F',
47+
'mp_weno' : 'F',
48+
'riemann_solver' : 2,
49+
'wave_speeds' : 1,
50+
'viscous' : 'T',
51+
'bc_x%beg' : -3,
52+
'bc_x%end' : -3,
53+
'bc_y%beg' : -3,
54+
'bc_y%end' : -3,
55+
'ib' : 'T',
56+
'num_ibs' : 1,
57+
'perturb_flow' : 'T',
58+
'perturb_flow_fluid' : 1,
59+
'perturb_flow_mag' : 0.0001,
60+
# ==========================================================================
61+
62+
# Formatted Database Files Structure Parameters ============================
63+
# Export primitive variables in double precision with parallel
64+
# I/O to minimize I/O computational time during large simulations
65+
'format' : 1,
66+
'precision' : 2,
67+
'prim_vars_wrt' :'T',
68+
'parallel_io' :'T',
69+
'omega_wrt(3)' :'T',
70+
'fd_order' : 2,
71+
# ==========================================================================
72+
73+
# Patch: Middle ============================================================
74+
'patch_icpp(1)%geometry' : 3,
75+
'patch_icpp(1)%x_centroid' : 0,
76+
'patch_icpp(1)%y_centroid' : 0,
77+
'patch_icpp(1)%length_x' : 1000*D,
78+
'patch_icpp(1)%length_y' : 1000*D,
79+
'patch_icpp(1)%vel(1)' : 527.2E+00,
80+
'patch_icpp(1)%vel(2)' : 0.0E+00,
81+
'patch_icpp(1)%pres' : 10918.2549,
82+
'patch_icpp(1)%alpha_rho(1)' : (1.0)*rho1,
83+
'patch_icpp(1)%alpha(1)' : 1.0,
84+
# ==========================================================================
85+
'patch_ib(1)%geometry' : 5,
86+
'patch_ib(1)%model%filepath' : '20deg_wedge.stl',
87+
'patch_ib(1)%model%translate(1)' : -0.05 + 0.0424444350,
88+
'patch_ib(1)%model%translate(2)' : -0.05 + 0.0445000000,
89+
'patch_ib(1)%model%spc' : 200,
90+
'patch_ib(1)%model%threshold' : 0.9,
91+
'patch_ib(1)%slip' : 'F',
92+
# # ========================================================================
93+
94+
# Fluids Physical Parameters ===============================================
95+
'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00),
96+
'fluid_pp(1)%pi_inf' : 0,
97+
'fluid_pp(1)%Re(1)' : 7535533.2,
98+
# ==========================================================================
99+
}))
100+

0 commit comments

Comments
 (0)