BCs (reflecting wall / outflow / supersonic inlet), normal-aware on curvilinear grids, with an MPI dual-path for inter-rank edges.
Reflect the velocity of a conserved state about unit normal nrm, preserving density and total energy (|v| is unchanged). Inviscid no-penetration wall. The density is floored to eps (matching limit_pos_2d): the halo fill runs BEFORE any residual-side positivity guard can fire, so a transient non-positive boundary-adjacent state (near-vacuum off a strong expansion) must not divide-by-zero / SIGFPE here (audit 2026-07-06 N2); the residual guards still abort cleanly on the interior state itself.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q(:) | |||
| real(kind=wp), | intent(in) | :: | nrm(2) |
Conserved free-stream reference state from config.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_2d_t), | intent(in) | :: | state |
Characteristic (Riemann-invariant) far-field ghost state for an OUTWARD unit normal nrm. q_int is the boundary-adjacent interior conserved state, q_inf the free-stream. With interior/free-stream normal velocities Un_i, Un_inf and sound speeds c_i, c_inf: * supersonic in/out (|Un_i| >= c_i) short-circuit to pure free-stream / pure interior extrapolation; * otherwise combine the outgoing (interior) invariant R+ = Un_i + 2 c_i/(gam-1) with the incoming (free-stream) R- = Un_inf - 2 c_inf/(gam-1) to get Un_b = (R+ + R-)/2, c_b = (gam-1)/4 (R+ - R-). Entropy and tangential velocity are taken from the free-stream on inflow (Un_b <= 0) and from the interior on outflow; rho_b, p_b follow from entropy + c_b. gam is passed explicitly (no module-level thermodynamic state here).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q_int(:) | |||
| real(kind=wp), | intent(in) | :: | q_inf(:) | |||
| real(kind=wp), | intent(in) | :: | nrm(2) | |||
| real(kind=wp), | intent(in) | :: | gam |
Report which of the four block edges are PHYSICAL solid (reflecting) walls, for the curvilinear residual's weak pressure-wall flux. Mirrors apply_halos_2d's serial/MPI dual-path edge selection exactly (single source of truth): serial (np=1 or no Cart comm) => all four edges are physical; MPI => an edge is physical only if its Cartesian neighbour is MPI_PROC_NULL. An edge is a wall iff it is physical AND its cfg % bc_* is 'reflecting'.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_2d_t), | intent(in) | :: | state | |||
| logical, | intent(out) | :: | w_xlo | |||
| logical, | intent(out) | :: | w_xhi | |||
| logical, | intent(out) | :: | w_ylo | |||
| logical, | intent(out) | :: | w_yhi |
Fill all four halo bands by periodic wrap of the opposite interior edge.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_2d_t), | intent(inout) | :: | state |
Fill all four halo bands per cfg % bc_* edge type.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_2d_t), | intent(inout) | :: | state |
Fill the four halo bands for the NODAL finite-difference (FDM) path.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_2d_t), | intent(inout) | :: | state |
Fill a left (is_min=.true.) or right x-edge band over rows j=1..ny, NODAL.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_2d_t), | intent(inout) | :: | state | |||
| logical, | intent(in) | :: | is_min | |||
| character(len=*), | intent(in) | :: | bc |
Fill a bottom (is_min=.true.) or top y-edge band over columns i=1..nx, NODAL.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_2d_t), | intent(inout) | :: | state | |||
| logical, | intent(in) | :: | is_min | |||
| character(len=*), | intent(in) | :: | bc |
Fill a left (is_min=.true.) or right x-edge band over rows j=1..ny.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_2d_t), | intent(inout) | :: | state | |||
| logical, | intent(in) | :: | is_min | |||
| character(len=*), | intent(in) | :: | bc |
Fill a bottom (is_min=.true.) or top y-edge band over columns i=1..nx.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_2d_t), | intent(inout) | :: | state | |||
| logical, | intent(in) | :: | is_min | |||
| character(len=*), | intent(in) | :: | bc |