Skip to content

Boundary Condition Paches #819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2951c12
attemtped merge
okBrian Mar 15, 2025
2ecd168
test
okBrian Mar 18, 2025
9c8d196
revert changes
okBrian Mar 18, 2025
5162888
finish merge?
okBrian Mar 24, 2025
ce31cdd
Updates
wilfonba Mar 24, 2025
c1ffeac
test suite, format, lint
wilfonba Mar 24, 2025
db4efb2
fix ling
wilfonba Mar 24, 2025
a40ac60
fix no mpi build
wilfonba Mar 24, 2025
63bd748
fix documentation build
wilfonba Mar 24, 2025
37d626a
add checking to BC Patches
okBrian Mar 26, 2025
34bedcd
fixed checker, bc directory won't be created w/o bc patches defined
okBrian Mar 26, 2025
6ab721e
merge
okBrian Mar 26, 2025
6ca58d2
fix test suite
wilfonba Mar 26, 2025
5142a08
fixed m_checker for -17 & fixed boundary condition files to be create…
okBrian Mar 31, 2025
f1383af
fixed bc check for -17
okBrian Mar 31, 2025
3542ef2
asdf
wilfonba Apr 2, 2025
7665c5c
fix seg fault
okBrian Apr 9, 2025
abeeb3e
added regressino test and fixed spelling
okBrian Apr 9, 2025
0f5af3f
merge w/ master
okBrian Apr 14, 2025
420d716
fix merge
okBrian Apr 14, 2025
e08c93a
prettyify, lint, and fix test suite
okBrian Apr 14, 2025
fa9e724
merge
okBrian Apr 14, 2025
e214f26
fix lint and format
okBrian Apr 14, 2025
aaaabc7
address comments
wilfonba Apr 17, 2025
4ca0c25
format
wilfonba Apr 17, 2025
7167f40
fix symmetry
wilfonba Apr 17, 2025
0e3e05b
fix num_bc_patches checker
wilfonba Apr 17, 2025
a69e49f
wip remove macros
okBrian Apr 20, 2025
c93f211
removed fypp macros
okBrian Apr 21, 2025
7ccbe7a
added color function, added qbmm, fixed k, l ordering
okBrian Apr 24, 2025
abcdf2f
fixed 2D cases
okBrian Apr 28, 2025
f2dcbaf
some requested changes and test suite (on CPUs)
wilfonba Apr 30, 2025
727e9d9
fix GPU bug
wilfonba Apr 30, 2025
e462db4
white space cleanup
wilfonba Apr 30, 2025
997f2c4
(CPU) works?
okBrian May 1, 2025
6ebfbec
fix gpu
wilfonba May 1, 2025
c0bb0a8
format
wilfonba May 1, 2025
8b96995
documentation and additional input checks
wilfonba May 2, 2025
a89512e
format and remove extra file
wilfonba May 2, 2025
cf4f611
spell check
wilfonba May 2, 2025
03c9c66
bug fix
wilfonba May 2, 2025
dcde7a1
update BC enumeration
wilfonba May 2, 2025
9e68edd
fix debug and format
okBrian May 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion docs/documentation/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,10 @@ The parameters are used to specify options in algorithms that are used to integr
Models and assumptions that are used to formulate and discritize the governing equations are described in [Bryngelson et al. (2019)](references.md).
Details of the simulation algorithms and implementation of the WENO scheme can be found in [Coralic (2015)](references.md).

- `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.
- `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.
See table [Boundary Conditions](#boundary-conditions) for details.
Boundary condition patches can be used with non-characteristic boundary conditions.
Their use is detailed in [Boundary Condition Patches](#boundary-condition-patches).

- `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`.
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.
Expand Down Expand Up @@ -479,6 +481,29 @@ This option requires `weno_Re_flux` to be true because cell boundary values are

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

#### Boundary Condition Patches

| Parameter | Type | Description |
| ---: | :----: | :--- |
| `num_bc_patches` | Integer | Number of boundary condition patches |
| `dir`* | Integer | Direction of the boundary patch. [1]: x; [2]: y; [3]: z |
| `loc`* | Integer | Location of the patch in the domain |
| `type`* | Integer | The geometry of the patch. [1]: Line [2]: Circle [3]: Rectangle |
| `x[y,z]_centroid`* | Real | Centroid of the boundary patch in the x[y,z]-direction |
| `length_x[y,z]`* | Real | Length of the boundary patch in the x[y,z]-direction |
| `radius`* | Real | Radius of the boundary patch |
*: These parameters should be prepended with `patch_bc(j)%` where $j$ is the patch index.

Boundary condition patches can be used with the following boundary condition types:
- `-2` reflective
- `-3` ghost cell extrapolation
- `-15` slip wall
- `-16` no-slip wall
- `-17` Dirichlet

Line segments along each domain edge are supported for 2D simulations.
Squares and circles on each face are supported for 3D simulations.

#### Constant Time-Stepping

- `dt` specifies the constant time step size used in the simulation.
Expand Down
4 changes: 4 additions & 0 deletions examples/2D_jet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Gas Jet (2D)

## Final Condition
<img src='final_condition.png' height='MAX_HEIGHT'/>
116 changes: 116 additions & 0 deletions examples/2D_jet/case.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#!/usr/bin/env python3
import math
import json

pA = 101325
rhoA = 1.29
gam = 1.4
c_l = math.sqrt(1.4 * pA / rhoA)

pS = 2.458 * pA
velS = 0.701 * c_l
rhoS = 1.862 * rhoA

leng = 1e-2
Ny = 250
Nx = Ny
dx = leng / Nx

time_end = 2 * leng / velS
cfl = 0.8

dt = cfl * dx / c_l
Nt = int(time_end / dt)

eps = 1e-5

# Configuring case dictionary
print(
json.dumps(
{
# Logistics
"run_time_info": "T",
# Computational Domain Parameters
"x_domain%beg": -leng / 2.0,
"x_domain%end": 3 * leng / 2,
"y_domain%beg": -leng,
"y_domain%end": leng,
"m": int(Nx),
"n": int(Ny),
"p": 0,
"dt": dt,
"cfl_adap_dt": "T",
"t_stop": time_end,
"t_save": time_end / 50,
"n_start": 0,
"cfl_target": 0.8,
# Simulation Algorithm Parameters
"num_patches": 2,
"model_eqns": 2,
"alt_soundspeed": "F",
"num_fluids": 2,
"mpp_lim": "F",
"mixture_err": "T",
"time_stepper": 3,
"weno_order": 5,
"weno_eps": 1.0e-16,
"weno_Re_flux": "F",
"weno_avg": "F",
"mapped_weno": "T",
"null_weights": "F",
"mp_weno": "F",
"riemann_solver": 2,
"wave_speeds": 1,
"avg_state": 2,
"elliptic_smoothing": "T",
"elliptic_smoothing_iters": 50,
"bc_x%beg": -2,
"bc_x%end": -3,
"bc_y%beg": -3,
"bc_y%end": -3,
"num_bc_patches": 1,
"patch_bc(1)%dir": 1,
"patch_bc(1)%loc": -1,
"patch_bc(1)%geometry": 1,
"patch_bc(1)%type": -17,
"patch_bc(1)%centroid(2)": 0.0,
"patch_bc(1)%length(2)": leng / 4,
# Formatted Database Files Structure Parameters
"format": 1,
"precision": 2,
"prim_vars_wrt": "T",
"parallel_io": "T",
# Patch 1: Background
"patch_icpp(1)%geometry": 3,
"patch_icpp(1)%x_centroid": 0.0,
"patch_icpp(1)%y_centroid": 0.0,
"patch_icpp(1)%length_x": 10 * leng,
"patch_icpp(1)%length_y": 10 * leng,
"patch_icpp(1)%vel(1)": 0.0e00,
"patch_icpp(1)%vel(2)": 0.0e00,
"patch_icpp(1)%pres": pA,
"patch_icpp(1)%alpha_rho(1)": rhoA,
"patch_icpp(1)%alpha(1)": 1.0 - eps,
"patch_icpp(1)%alpha_rho(2)": eps,
"patch_icpp(1)%alpha(2)": eps,
"patch_icpp(2)%geometry": 3,
"patch_icpp(2)%alter_patch(1)": "T",
"patch_icpp(2)%x_centroid": -leng / 2,
"patch_icpp(2)%y_centroid": 0.0,
"patch_icpp(2)%length_x": leng / 4,
"patch_icpp(2)%length_y": leng / 3,
"patch_icpp(2)%vel(1)": velS,
"patch_icpp(2)%vel(2)": 0,
"patch_icpp(2)%pres": pS,
"patch_icpp(2)%alpha_rho(1)": eps,
"patch_icpp(2)%alpha(1)": eps,
"patch_icpp(2)%alpha_rho(2)": (1 - eps) * rhoS,
"patch_icpp(2)%alpha(2)": 1 - eps,
# Fluids Physical Parameters
"fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00),
"fluid_pp(1)%pi_inf": 0.0,
"fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00),
"fluid_pp(2)%pi_inf": 0.0,
}
)
)
Binary file added examples/2D_jet/final_condition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions examples/2D_shockbubble/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"p": 0,
"dt": dt,
"t_step_start": 0,
"t_step_stop": Nt,
"t_step_save": int(Nt / 20.0),
"t_step_stop": 1000,
"t_step_save": 10,
# Simulation Algorithm Parameters
"num_patches": 3,
"model_eqns": 2,
Expand Down
Loading
Loading