Skip to content

Commit 8230af1

Browse files
okBrianwilfonba
andauthored
Boundary Condition Paches (#819)
Co-authored-by: Ben Wilfong <48168887+wilfonba@users.noreply.github.com> Co-authored-by: Ben Wilfong <bwilfong3@gatech.edu>
1 parent 16e51c9 commit 8230af1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+5400
-2447
lines changed

docs/documentation/case.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,10 @@ The parameters are used to specify options in algorithms that are used to integr
408408
Models and assumptions that are used to formulate and discritize the governing equations are described in [Bryngelson et al. (2019)](references.md).
409409
Details of the simulation algorithms and implementation of the WENO scheme can be found in [Coralic (2015)](references.md).
410410

411-
- `bc_[x,y,z]%[beg,end]` specifies the boundary conditions at the beginning and the end of domain boundaries in each coordinate direction by a negative integer from -1 through -12.
411+
- `bc_[x,y,z]%[beg,end]` specifies the boundary conditions at the beginning and the end of domain boundaries in each coordinate direction by a negative integer from -1 through -16.
412412
See table [Boundary Conditions](#boundary-conditions) for details.
413+
Boundary condition patches can be used with non-characteristic boundary conditions.
414+
Their use is detailed in [Boundary Condition Patches](#boundary-condition-patches).
413415

414416
- `bc_[x,y,z]%%vb[1,2,3]` specifies the velocity in the (x,1), (y,2), (z,3) direction applied to `bc_[x,y,z]%%beg` when using `bc_[x,y,z]%%beg = -16`.
415417
Tangential velocities require viscosity, `weno_avg = T`, and `bc_[x,y,z]%%beg = -16` to work properly. Normal velocities require `bc_[x,y,z]%%end = -15` or `\bc_[x,y,z]%%end = -16` to work properly.
@@ -479,6 +481,29 @@ This option requires `weno_Re_flux` to be true because cell boundary values are
479481

480482
- `hypoelasticity` activates elastic stress calculations for fluid-solid interactions. Requires `G` to be set in the fluid material's parameters.
481483

484+
#### Boundary Condition Patches
485+
486+
| Parameter | Type | Description |
487+
| ---: | :----: | :--- |
488+
| `num_bc_patches` | Integer | Number of boundary condition patches |
489+
| `dir`* | Integer | Direction of the boundary patch. [1]: x; [2]: y; [3]: z |
490+
| `loc`* | Integer | Location of the patch in the domain |
491+
| `type`* | Integer | The geometry of the patch. [1]: Line [2]: Circle [3]: Rectangle |
492+
| `x[y,z]_centroid`* | Real | Centroid of the boundary patch in the x[y,z]-direction |
493+
| `length_x[y,z]`* | Real | Length of the boundary patch in the x[y,z]-direction |
494+
| `radius`* | Real | Radius of the boundary patch |
495+
*: These parameters should be prepended with `patch_bc(j)%` where $j$ is the patch index.
496+
497+
Boundary condition patches can be used with the following boundary condition types:
498+
- `-2` reflective
499+
- `-3` ghost cell extrapolation
500+
- `-15` slip wall
501+
- `-16` no-slip wall
502+
- `-17` Dirichlet
503+
504+
Line segments along each domain edge are supported for 2D simulations.
505+
Squares and circles on each face are supported for 3D simulations.
506+
482507
#### Constant Time-Stepping
483508

484509
- `dt` specifies the constant time step size used in the simulation.

examples/2D_jet/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Gas Jet (2D)
2+
3+
## Final Condition
4+
<img src='final_condition.png' height='MAX_HEIGHT'/>

examples/2D_jet/case.py

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#!/usr/bin/env python3
2+
import math
3+
import json
4+
5+
pA = 101325
6+
rhoA = 1.29
7+
gam = 1.4
8+
c_l = math.sqrt(1.4 * pA / rhoA)
9+
10+
pS = 2.458 * pA
11+
velS = 0.701 * c_l
12+
rhoS = 1.862 * rhoA
13+
14+
leng = 1e-2
15+
Ny = 250
16+
Nx = Ny
17+
dx = leng / Nx
18+
19+
time_end = 2 * leng / velS
20+
cfl = 0.8
21+
22+
dt = cfl * dx / c_l
23+
Nt = int(time_end / dt)
24+
25+
eps = 1e-5
26+
27+
# Configuring case dictionary
28+
print(
29+
json.dumps(
30+
{
31+
# Logistics
32+
"run_time_info": "T",
33+
# Computational Domain Parameters
34+
"x_domain%beg": -leng / 2.0,
35+
"x_domain%end": 3 * leng / 2,
36+
"y_domain%beg": -leng,
37+
"y_domain%end": leng,
38+
"m": int(Nx),
39+
"n": int(Ny),
40+
"p": 0,
41+
"dt": dt,
42+
"cfl_adap_dt": "T",
43+
"t_stop": time_end,
44+
"t_save": time_end / 50,
45+
"n_start": 0,
46+
"cfl_target": 0.8,
47+
# Simulation Algorithm Parameters
48+
"num_patches": 2,
49+
"model_eqns": 2,
50+
"alt_soundspeed": "F",
51+
"num_fluids": 2,
52+
"mpp_lim": "F",
53+
"mixture_err": "T",
54+
"time_stepper": 3,
55+
"weno_order": 5,
56+
"weno_eps": 1.0e-16,
57+
"weno_Re_flux": "F",
58+
"weno_avg": "F",
59+
"mapped_weno": "T",
60+
"null_weights": "F",
61+
"mp_weno": "F",
62+
"riemann_solver": 2,
63+
"wave_speeds": 1,
64+
"avg_state": 2,
65+
"elliptic_smoothing": "T",
66+
"elliptic_smoothing_iters": 50,
67+
"bc_x%beg": -2,
68+
"bc_x%end": -3,
69+
"bc_y%beg": -3,
70+
"bc_y%end": -3,
71+
"num_bc_patches": 1,
72+
"patch_bc(1)%dir": 1,
73+
"patch_bc(1)%loc": -1,
74+
"patch_bc(1)%geometry": 1,
75+
"patch_bc(1)%type": -17,
76+
"patch_bc(1)%centroid(2)": 0.0,
77+
"patch_bc(1)%length(2)": leng / 4,
78+
# Formatted Database Files Structure Parameters
79+
"format": 1,
80+
"precision": 2,
81+
"prim_vars_wrt": "T",
82+
"parallel_io": "T",
83+
# Patch 1: Background
84+
"patch_icpp(1)%geometry": 3,
85+
"patch_icpp(1)%x_centroid": 0.0,
86+
"patch_icpp(1)%y_centroid": 0.0,
87+
"patch_icpp(1)%length_x": 10 * leng,
88+
"patch_icpp(1)%length_y": 10 * leng,
89+
"patch_icpp(1)%vel(1)": 0.0e00,
90+
"patch_icpp(1)%vel(2)": 0.0e00,
91+
"patch_icpp(1)%pres": pA,
92+
"patch_icpp(1)%alpha_rho(1)": rhoA,
93+
"patch_icpp(1)%alpha(1)": 1.0 - eps,
94+
"patch_icpp(1)%alpha_rho(2)": eps,
95+
"patch_icpp(1)%alpha(2)": eps,
96+
"patch_icpp(2)%geometry": 3,
97+
"patch_icpp(2)%alter_patch(1)": "T",
98+
"patch_icpp(2)%x_centroid": -leng / 2,
99+
"patch_icpp(2)%y_centroid": 0.0,
100+
"patch_icpp(2)%length_x": leng / 4,
101+
"patch_icpp(2)%length_y": leng / 3,
102+
"patch_icpp(2)%vel(1)": velS,
103+
"patch_icpp(2)%vel(2)": 0,
104+
"patch_icpp(2)%pres": pS,
105+
"patch_icpp(2)%alpha_rho(1)": eps,
106+
"patch_icpp(2)%alpha(1)": eps,
107+
"patch_icpp(2)%alpha_rho(2)": (1 - eps) * rhoS,
108+
"patch_icpp(2)%alpha(2)": 1 - eps,
109+
# Fluids Physical Parameters
110+
"fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00),
111+
"fluid_pp(1)%pi_inf": 0.0,
112+
"fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00),
113+
"fluid_pp(2)%pi_inf": 0.0,
114+
}
115+
)
116+
)

examples/2D_jet/final_condition.png

254 KB
Loading

examples/2D_shockbubble/case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"p": 0,
3636
"dt": dt,
3737
"t_step_start": 0,
38-
"t_step_stop": Nt,
39-
"t_step_save": int(Nt / 20.0),
38+
"t_step_stop": 1000,
39+
"t_step_save": 10,
4040
# Simulation Algorithm Parameters
4141
"num_patches": 3,
4242
"model_eqns": 2,

0 commit comments

Comments
 (0)