Skip to content

Commit f448f33

Browse files
committed
refactor: rename bc_x/bc_y/bc_z to bc%x/bc%y/bc%z via bc_xyz_info struct
Group the three directional boundary condition variables (bc_x, bc_y, bc_z of type bc_dir_t) into a single bc_xyz_info struct accessed as bc%x, bc%y, bc%z. Updates all Fortran source, Fypp macros, Python toolchain, example cases, and documentation.
1 parent 3c387d1 commit f448f33

186 files changed

Lines changed: 1344 additions & 1340 deletions

File tree

Some content is hidden

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

docs/documentation/case.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@ See @ref equations "Equations" for the mathematical models these parameters cont
421421

422422
| Parameter | Type | Description |
423423
| ---: | :----: | :--- |
424-
| `bc_[x,y,z]%%beg[end]` | Integer | Beginning [ending] boundary condition in the $[x,y,z]$-direction (negative integer, see table [Boundary Conditions](#boundary-conditions)) |
425-
| `bc_[x,y,z]%%vb[1,2,3]`| Real | Velocity in the (x,1), (y, 2), (z,3) direction applied to `bc_[x,y,z]%%beg` |
426-
| `bc_[x,y,z]%%ve[1,2,3]`| Real | Velocity in the (x,1), (y, 2), (z,3) direction applied to `bc_[x,y,z]%%end` |
424+
| `bc%%[x,y,z]%%beg[end]` | Integer | Beginning [ending] boundary condition in the $[x,y,z]$-direction (negative integer, see table [Boundary Conditions](#boundary-conditions)) |
425+
| `bc%%[x,y,z]%%vb[1,2,3]`| Real | Velocity in the (x,1), (y, 2), (z,3) direction applied to `bc%%[x,y,z]%%beg` |
426+
| `bc%%[x,y,z]%%ve[1,2,3]`| Real | Velocity in the (x,1), (y, 2), (z,3) direction applied to `bc%%[x,y,z]%%end` |
427427
| `model_eqns` | Integer | Multicomponent model: [1] \f$\Gamma/\Pi_\infty\f$; [2] 5-equation; [3] 6-equation; [4] 4-equation |
428428
| `alt_soundspeed` * | Logical | Alternate sound speed and \f$K \nabla \cdot u\f$ for 5-equation model |
429429
| `adv_n` | Logical | Solving directly for the number density (in the method of classes) and compute void fraction from the number density |
@@ -482,23 +482,23 @@ See @ref equations "Equations" for the mathematical models these parameters cont
482482

483483
- \* Options that work only with `model_eqns = 2`.
484484
- † Options that work only with ``cyl_coord = 'F'``.
485-
- ‡ Options that work only with `bc_[x,y,z]%[beg,end] = -15` and/or `bc_[x,y,z]%[beg,end] = -16`.
485+
- ‡ Options that work only with `bc%[x,y,z]%[beg,end] = -15` and/or `bc%[x,y,z]%[beg,end] = -16`.
486486

487487
The table lists simulation algorithm parameters.
488488
The parameters are used to specify options in algorithms that are used to integrate the governing equations of the multi-component flow based on the initial condition.
489489
Models and assumptions that are used to formulate and discretize the governing equations are described in \cite Wilfong26 and \cite Bryngelson21.
490490
Details of the simulation algorithms and implementation of the WENO scheme can be found in \cite Coralic15.
491491

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

497-
- `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`.
498-
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.
497+
- `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`.
498+
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.
499499

500-
- `bc_[x,y,z]%%ve[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]%%end = -16`.
501-
Tangential velocities require viscosity, `weno_avg = T`, and `bc_[x,y,z]%%end = 16` to work properly. Normal velocities require `bc_[x,y,z]%%end = -15` or `bc_[x,y,z]%%end = -16` to work properly.
500+
- `bc%%[x,y,z]%%ve[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]%%end = -16`.
501+
Tangential velocities require viscosity, `weno_avg = T`, and `bc%%[x,y,z]%%end = 16` to work properly. Normal velocities require `bc%%[x,y,z]%%end = -15` or `bc%%[x,y,z]%%end = -16` to work properly.
502502

503503
- `model_eqns` specifies the choice of the multi-component model that is used to formulate the dynamics of the flow using integers from 1 through 3.
504504
`model_eqns = 1`, `2`, and `3` correspond to \f$\Gamma\f$-\f$\Pi_\infty\f$ model (\cite Johnsen08), 5-equation model (\cite Allaire02), and 6-equation model (\cite Saurel09), respectively.
@@ -534,7 +534,7 @@ It is recommended to set `weno_eps` to $10^{-6}$ for WENO-JS, and to $10^{-40}$
534534

535535
- `teno_CT` specifies the threshold for the TENO scheme. This dimensionless constant, also known as $C_T$, sets a threshold to identify smooth and non-smooth stencils. Larger values make the scheme more robust but also more dissipative. A recommended value for teno_CT is `1e-6`. When adjusting this parameter, it is recommended to try values like `1e-5` or `1e-7` for TENO5. A smaller value can be used for TENO7.
536536

537-
- `null_weights` activates nullification of the nonlinear WENO weights at the buffer regions outside the domain boundaries when the Riemann extrapolation boundary condition is specified (`bc_[x,y,z]%%beg[end]} = -4`).
537+
- `null_weights` activates nullification of the nonlinear WENO weights at the buffer regions outside the domain boundaries when the Riemann extrapolation boundary condition is specified (`bc%%[x,y,z]%%beg[end]} = -4`).
538538

539539
- `mp_weno` activates monotonicity preservation in the WENO reconstruction (MPWENO) such that the values of reconstructed variables do not reside outside the range spanned by WENO stencil (\cite Balsara00; \cite Suresh97).
540540

@@ -1046,17 +1046,17 @@ Note: For relativistic flow, the conservative and primitive densities are differ
10461046

10471047
When ``cyl_coord = 'T'`` is set in 3D the following constraints must be met:
10481048

1049-
- `bc_y%%beg = -14` enables the axis boundary condition
1049+
- `bc%%y%%beg = -14` enables the axis boundary condition
10501050

1051-
- `bc_z%%beg = bc_z%%end = -1` enables periodic boundary conditions in the azimuthal direction
1051+
- `bc%%z%%beg = bc%%z%%end = -1` enables periodic boundary conditions in the azimuthal direction
10521052

10531053
- `z_domain%%beg = 0` sets the azimuthal starting point to 0
10541054

10551055
- `z_domain%%end = 2*math.pi` to set the azimuthal ending point to \f$2\pi\f$ (note, requires `import math` in the case file)
10561056

10571057
When ``cyl_coord = 'T'`` is set in 2D the following constraints must be met:
10581058

1059-
- `bc_y%%beg = -2` to enable reflective boundary conditions
1059+
- `bc%%y%%beg = -2` to enable reflective boundary conditions
10601060

10611061
### 17. Chemistry
10621062

@@ -1077,12 +1077,12 @@ When ``cyl_coord = 'T'`` is set in 2D the following constraints must be met:
10771077

10781078
| Parameter | Type | Description |
10791079
| ---: | :----: | :--- |
1080-
| `bc_[x,y,z]%%isothermal_in` | Logical | Enable isothermal wall at the domain entrance (minimum coordinate). |
1081-
| `bc_[x,y,z]%%isothermal_out` | Logical | Enable isothermal wall at the domain exit (maximum coordinate). |
1082-
| `bc_[x,y,z]%%Twall_in` | Real | Temperature [K] of the entrance isothermal wall. |
1083-
| `bc_[x,y,z]%%Twall_out` | Real | Temperature [K] of the exit isothermal wall. |
1080+
| `bc%%[x,y,z]%%isothermal_in` | Logical | Enable isothermal wall at the domain entrance (minimum coordinate). |
1081+
| `bc%%[x,y,z]%%isothermal_out` | Logical | Enable isothermal wall at the domain exit (maximum coordinate). |
1082+
| `bc%%[x,y,z]%%Twall_in` | Real | Temperature [K] of the entrance isothermal wall. |
1083+
| `bc%%[x,y,z]%%Twall_out` | Real | Temperature [K] of the exit isothermal wall. |
10841084

1085-
This boundary condition can be used for fixed-temperature (isothermal) walls at the domain extremities. It is exclusively available for reacting flows and requires chemistry to be enabled. It properly evaluates heat and species fluxes at the interface when ``chemistry = 'T'``, ``chem_params%%diffusion = 'T'``, and the corresponding domain boundary is set to a slip wall (`bc_[x,y,z]%%[beg,end]` = -15) or a no-slip wall (`bc_[x,y,z]%%[beg,end]` = -16).
1085+
This boundary condition can be used for fixed-temperature (isothermal) walls at the domain extremities. It is exclusively available for reacting flows and requires chemistry to be enabled. It properly evaluates heat and species fluxes at the interface when ``chemistry = 'T'``, ``chem_params%%diffusion = 'T'``, and the corresponding domain boundary is set to a slip wall (`bc%%[x,y,z]%%[beg,end]` = -15) or a no-slip wall (`bc%%[x,y,z]%%[beg,end]` = -16).
10861086

10871087

10881088

@@ -1118,27 +1118,27 @@ This boundary condition can be used for fixed-temperature (isothermal) walls at
11181118
| -15 | Normal | Slip wall |
11191119
| -16 | Normal | No-slip wall |
11201120

1121-
*: This boundary condition is only used for `bc_y%%beg` when using cylindrical coordinates (``cyl_coord = 'T'`` and 3D). For axisymmetric problems, use `bc_y%%beg = -2` with ``cyl_coord = 'T'`` in 2D.
1121+
*: This boundary condition is only used for `bc%%y%%beg` when using cylindrical coordinates (``cyl_coord = 'T'`` and 3D). For axisymmetric problems, use `bc%%y%%beg = -2` with ``cyl_coord = 'T'`` in 2D.
11221122

11231123
The boundary condition supported by the MFC are listed in table [Boundary Conditions](#boundary-conditions).
1124-
Their number (`#`) corresponds to the input value in `input.py` labeled `bc_[x,y,z]%[beg,end]` (see table [Simulation Algorithm Parameters](#sec-simulation-algorithm)).
1124+
Their number (`#`) corresponds to the input value in `input.py` labeled `bc%[x,y,z]%[beg,end]` (see table [Simulation Algorithm Parameters](#sec-simulation-algorithm)).
11251125
The entries labeled "Characteristic." are characteristic boundary conditions based on \cite Thompson87 and \cite Thompson90.
11261126

11271127
### Generalized Characteristic Boundary conditions
11281128

11291129
| Parameter | Type | Description |
11301130
| ---: | :----: | :--- |
1131-
| `bc_[x,y,z]%%grcbc_in` | Logical | Enable grcbc for subsonic inflow |
1132-
| `bc_[x,y,z]%%grcbc_out` | Logical | Enable grcbc for subsonic outflow (pressure)|
1133-
| `bc_[x,y,z]%%grcbc_vel_out` | Logical | Enable grcbc for subsonic outflow (pressure + normal velocity) |
1134-
| `bc_[x,y,z]%%vel_in` | Real Array | Inflow velocities in x, y and z directions |
1135-
| `bc_[x,y,z]%%vel_out` | Real Array | Outflow velocities in x, y and z directions |
1136-
| `bc_[x,y,z]%%pres_in` | Real | Inflow pressure |
1137-
| `bc_[x,y,z]%%pres_out` | Real | Outflow pressure |
1138-
| `bc_[x,y,z]%%alpha_rho_in` | Real Array | Inflow density |
1139-
| `bc_[x,y,z]%%alpha_in` | Real Array | Inflow void fraction |
1140-
1141-
This boundary condition can be used for subsonic inflow (`bc_[x,y,z]%[beg,end]` = -7) and subsonic outflow (`bc_[x,y,z]%[beg,end]` = -8) characteristic boundary conditions. These are based on \cite Pirozzoli13. This enables to provide inflow and outflow conditions outside the computational domain.
1131+
| `bc%%[x,y,z]%%grcbc_in` | Logical | Enable grcbc for subsonic inflow |
1132+
| `bc%%[x,y,z]%%grcbc_out` | Logical | Enable grcbc for subsonic outflow (pressure)|
1133+
| `bc%%[x,y,z]%%grcbc_vel_out` | Logical | Enable grcbc for subsonic outflow (pressure + normal velocity) |
1134+
| `bc%%[x,y,z]%%vel_in` | Real Array | Inflow velocities in x, y and z directions |
1135+
| `bc%%[x,y,z]%%vel_out` | Real Array | Outflow velocities in x, y and z directions |
1136+
| `bc%%[x,y,z]%%pres_in` | Real | Inflow pressure |
1137+
| `bc%%[x,y,z]%%pres_out` | Real | Outflow pressure |
1138+
| `bc%%[x,y,z]%%alpha_rho_in` | Real Array | Inflow density |
1139+
| `bc%%[x,y,z]%%alpha_in` | Real Array | Inflow void fraction |
1140+
1141+
This boundary condition can be used for subsonic inflow (`bc%[x,y,z]%[beg,end]` = -7) and subsonic outflow (`bc%[x,y,z]%[beg,end]` = -8) characteristic boundary conditions. These are based on \cite Pirozzoli13. This enables to provide inflow and outflow conditions outside the computational domain.
11421142

11431143
### Patch types {#patch-types}
11441144

docs/documentation/equations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ Used for viscous fluxes and velocity gradients.
979979
| `-15` | Slip wall |
980980
| `-16` | No-slip wall |
981981

982-
### 16.2 Characteristic BCs (\cite Thompson87, \cite Thompson90; `bc_x%%beg = -5` to `-12`)
982+
### 16.2 Characteristic BCs (\cite Thompson87, \cite Thompson90; `bc%%x%%beg = -5` to `-12`)
983983

984984
**Characteristic decomposition:**
985985

examples/0D_bubblecollapse_adap/case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
"riemann_solver": 2,
8484
"wave_speeds": 1,
8585
"avg_state": 2,
86-
"bc_x%beg": -1,
87-
"bc_x%end": -1,
86+
"bc%x%beg": -1,
87+
"bc%x%end": -1,
8888
# Formatted Database Files Structure Parameters
8989
"format": 1,
9090
"precision": 2,

examples/1D_acoustic_dipole/case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"riemann_solver": 2,
3535
"wave_speeds": 1,
3636
"avg_state": 2,
37-
"bc_x%beg": -6,
38-
"bc_x%end": -6,
37+
"bc%x%beg": -6,
38+
"bc%x%end": -6,
3939
# Formatted Database Files Structure Parameters
4040
"format": 1,
4141
"precision": 2,

examples/1D_acoustic_gauss_sigmadist/case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"riemann_solver": 2,
3535
"wave_speeds": 1,
3636
"avg_state": 2,
37-
"bc_x%beg": -6,
38-
"bc_x%end": -6,
37+
"bc%x%beg": -6,
38+
"bc%x%end": -6,
3939
# Formatted Database Files Structure Parameters
4040
"format": 1,
4141
"precision": 2,

examples/1D_acoustic_gauss_sigmatime/case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"riemann_solver": 2,
3535
"wave_speeds": 1,
3636
"avg_state": 2,
37-
"bc_x%beg": -6,
38-
"bc_x%end": -6,
37+
"bc%x%beg": -6,
38+
"bc%x%end": -6,
3939
# Formatted Database Files Structure Parameters
4040
"format": 1,
4141
"precision": 2,

examples/1D_acoustic_sine_frequency/case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"riemann_solver": 2,
3535
"wave_speeds": 1,
3636
"avg_state": 2,
37-
"bc_x%beg": -6,
38-
"bc_x%end": -6,
37+
"bc%x%beg": -6,
38+
"bc%x%end": -6,
3939
# Formatted Database Files Structure Parameters
4040
"format": 1,
4141
"precision": 2,

examples/1D_acoustic_sine_wavelength/case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"riemann_solver": 2,
3535
"wave_speeds": 1,
3636
"avg_state": 2,
37-
"bc_x%beg": -6,
38-
"bc_x%end": -6,
37+
"bc%x%beg": -6,
38+
"bc%x%end": -6,
3939
# Formatted Database Files Structure Parameters
4040
"format": 1,
4141
"precision": 2,

examples/1D_advection_convergence/case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@
7878
"riemann_solver": 2,
7979
"wave_speeds": 1,
8080
"avg_state": 2,
81-
"bc_x%beg": -1,
82-
"bc_x%end": -1,
81+
"bc%x%beg": -1,
82+
"bc%x%end": -1,
8383
"format": 1,
8484
"precision": 2,
8585
"prim_vars_wrt": "T",

examples/1D_brio_wu/case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"riemann_solver": 1,
3737
"wave_speeds": 1,
3838
"avg_state": 2,
39-
"bc_x%beg": -3,
40-
"bc_x%end": -3,
39+
"bc%x%beg": -3,
40+
"bc%x%end": -3,
4141
# Formatted Database Files Structure Parameters
4242
"format": 1,
4343
"precision": 2,

0 commit comments

Comments
 (0)