Reusable scalar face reconstruction helpers.
The routines here intentionally avoid equation-specific state. Species,
enthalpy, and future transported scalars can share the same menu of face
interpolation choices:
- upwind
- central
- bounded_central / bounded_linear
- muscl / limited_linear / linear_upwind / higher_order_bounded
The high-order branch uses a compact cell-gradient reconstruction from the
upwind cell and clamps the reconstructed face value to local cell-neighbor
bounds. This is not a full FCT implementation, but it gives a robust,
conservative, bounded upgrade path over first-order upwind without widening
the MPI stencil.
Functions
Reconstruct a scalar value at a face using the requested scheme.
flux_out is oriented outward from cell c. neighbor is the effective
neighbor seen from c (0 for non-periodic boundary). For Dirichlet
boundaries, boundary_value is used as the exterior state.
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(mesh_t),
|
intent(in) |
|
|
:: |
mesh |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
phi(:) |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
grad_phi(:,:) |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
scheme_name |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
limiter_name |
|
|
integer,
|
intent(in) |
|
|
:: |
c |
|
|
integer,
|
intent(in) |
|
|
:: |
neighbor |
|
|
integer,
|
intent(in) |
|
|
:: |
fid |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
flux_out |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
boundary_value |
|
|
logical,
|
intent(in) |
|
|
:: |
is_dirichlet |
|
Return Value
real(kind=rk)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(mesh_t),
|
intent(in) |
|
|
:: |
mesh |
|
|
integer,
|
intent(in) |
|
|
:: |
fid |
|
|
integer,
|
intent(in) |
|
|
:: |
c |
|
Return Value
integer
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(mesh_t),
|
intent(in) |
|
|
:: |
mesh |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
phi(:) |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
candidate |
|
|
integer,
|
intent(in) |
|
|
:: |
cell |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
boundary_value |
|
|
logical,
|
intent(in) |
|
|
:: |
include_boundary |
|
Return Value
real(kind=rk)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
x |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
lo |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
hi |
|
Return Value
real(kind=rk)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(mesh_t),
|
intent(in) |
|
|
:: |
mesh |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
phi(:) |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
grad_phi(:,:) |
|
|
integer,
|
intent(in) |
|
|
:: |
c |
|
Return Value
real(kind=rk)
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
limiter |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
phi_cell |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
phi_nb |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
grad_corr |
|
Return Value
real(kind=rk)
Subroutines
Compute compact cell-centered gradients from immediately adjacent cells.
Boundary faces without an effective/periodic neighbor are skipped; boundary
values are still enforced by scalar_face_value at the boundary face.
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(mesh_t),
|
intent(in) |
|
|
:: |
mesh |
|
|
real(kind=rk),
|
intent(in) |
|
|
:: |
phi(:) |
|
|
real(kind=rk),
|
intent(out) |
|
|
:: |
grad_phi(:,:) |
|
Validate scalar/momentum advection names at input time.
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
scheme_name |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
scope |
|
|
logical,
|
intent(in) |
|
|
:: |
allow_scalar_high_order |
|
Validate limiter names. The current bounded implementation maps these
limiters to the same local-bounds clamp; the menu is preserved in input so
future limiter-specific formulas can be added without changing cases.
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
limiter_name |
|