Boundary condition (BC) management, parsing, and physical evaluation.
This module provides the infrastructure to map user-defined case
configuration (case.nml) to the geometric patches of the mesh.
It handles the storage of boundary data (velocity, projection pressure,
species, and temperature/enthalpy) and provides low-level evaluation
routines used by the spatial operators (e.g., flux calculation, gradient
evaluation).
Supported BC Types:
1. bc_wall: No-slip/No-penetration condition.
- Velocity is set to the specified wall velocity (default zero).
- Pressure gradient is zero (Neumann).
2. bc_symmetry: Zero-gradient for parallel components, zero for normal.
- Enforces no-flow across the boundary while allowing slip.
3. bc_periodic: Topology-linked faces for repeating domains.
- Requires a valid periodic.dat file created by the mesh converter.
4. bc_dirichlet: Fixed field value.
- Explicitly sets the field value at the face.
5. bc_neumann: Fixed gradient (Zero-Gradient Outlet).
- Sets the face value equal to the adjacent interior cell value.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | bc_dirichlet | = | 4 | |
| integer, | public, | parameter | :: | bc_inlet_mass_flux | = | 7 | |
| integer, | public, | parameter | :: | bc_mass_flux | = | 6 | |
| integer, | public, | parameter | :: | bc_neumann | = | 5 | |
| integer, | public, | parameter | :: | bc_outlet_mass_flux | = | 8 | |
| integer, | public, | parameter | :: | bc_periodic | = | 3 | |
| integer, | public, | parameter | :: | bc_symmetry | = | 2 | |
| integer, | public, | parameter | :: | bc_unknown | = | 0 | |
| integer, | public, | parameter | :: | bc_wall | = | 1 |
Container for boundary data assigned to a specific mesh patch.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=rk), | public | :: | dpdn | = | zero | ||
| real(kind=rk), | public | :: | mass_flux | = | zero | ||
| character(len=name_len), | public | :: | name | = | "" | ||
| integer, | public | :: | patch_id | = | 0 | ||
| real(kind=rk), | public | :: | pressure | = | zero | ||
| integer, | public | :: | pressure_type_id | = | bc_unknown | ||
| real(kind=rk), | public | :: | species_Y(max_species) | = | zero | ||
| integer, | public | :: | species_type_id | = | bc_unknown |
Species boundary settings. |
|
| real(kind=rk), | public | :: | temperature | = | 300.0_rk | ||
| integer, | public | :: | temperature_type_id | = | bc_unknown |
Temperature/enthalpy boundary settings. |
|
| integer, | public | :: | type_id | = | bc_unknown | ||
| character(len=name_len), | public | :: | type_name | = | "" | ||
| real(kind=rk), | public | :: | velocity(3) | = | zero |
positive magnitude for inlet/outlet_mass_flux. |
|
| integer, | public | :: | velocity_type_id | = | bc_unknown |
Field-specific overrides. |
Global set of boundary conditions covering all mesh patches.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | npatches | = | 0 | ||
| type(bc_patch_t), | public, | allocatable | :: | patches(:) |
Returns the neighbor cell index, accounting for periodic connectivity.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh |
The computational mesh. |
||
| type(bc_set_t), | intent(in) | :: | bc |
The active BC set. |
||
| integer, | intent(in) | :: | face_id |
Global index of the face. |
||
| integer, | intent(in) | :: | cell_id |
Index of the cell requesting the neighbor. |
Converts a case-insensitive string to its corresponding internal BC type ID.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text |
String representation (e.g., "Wall", "Periodic", "Dirichlet"). |
Evaluates projection pressure at a boundary face.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh | |||
| type(bc_set_t), | intent(in) | :: | bc | |||
| integer, | intent(in) | :: | face_id | |||
| real(kind=rk), | intent(in) | :: | interior_p | |||
| real(kind=rk), | intent(out) | :: | ext_p | |||
| logical, | intent(out) | :: | is_dirichlet |
Evaluates species mass fractions at a boundary face.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh | |||
| type(bc_set_t), | intent(in) | :: | bc | |||
| integer, | intent(in) | :: | face_id | |||
| integer, | intent(in) | :: | k | |||
| real(kind=rk), | intent(in) | :: | interior_Y | |||
| real(kind=rk), | intent(out) | :: | ext_Y | |||
| logical, | intent(out) | :: | is_dirichlet |
Evaluates temperature at a boundary face.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh | |||
| type(bc_set_t), | intent(in) | :: | bc | |||
| integer, | intent(in) | :: | face_id | |||
| real(kind=rk), | intent(in) | :: | interior_T | |||
| real(kind=rk), | intent(out) | :: | ext_T | |||
| logical, | intent(out) | :: | is_dirichlet |
Evaluates the velocity vector at a boundary face.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh |
Mesh data structure. |
||
| type(bc_set_t), | intent(in) | :: | bc |
Boundary condition set. |
||
| integer, | intent(in) | :: | face_id |
ID of the boundary face. |
||
| real(kind=rk), | intent(in) | :: | interior_velocity(3) | |||
| real(kind=rk), | intent(out) | :: | value(3) | |||
| real(kind=rk), | intent(in), | optional | :: | boundary_density |
Optional density used by mass_flux boundaries [kg/m^3]. |
Synchronizes namelist parameters with mesh patches to create a complete BC set.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh |
The computational mesh containing patch definitions. |
||
| type(case_params_t), | intent(in) | :: | params |
Parsed case configuration from |
||
| type(bc_set_t), | intent(inout) | :: | bc |
The boundary condition set to be populated. |
Safely deallocates the boundary condition patch array.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(bc_set_t), | intent(inout) | :: | bc |
Validates that periodic patches have correctly established links.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh | |||
| integer, | intent(in) | :: | patch_id |