Compute the cell-centered finite-volume residual R_i = -1/dx_i * (F_{i+1/2} - F_{i-1/2}) on a block of cell averages.
Structurally this is the FDS path of compute_resid_fdm applied to
cell averages: reconstruct Q_L and Q_R at each face from the halo'd ub
array, optionally hybrid-select between the smooth and shock-capturing
reconstructions, positivity-limit each face, guard against non-physical
reconstructed states, and call the active FDS / Riemann solver. Two
deliberate differences from the FDM kernel:
mesh % dx_cell(i)
rather than the nodal Jacobian mesh % jac(i). On a uniform grid the
two coincide, so this reduces to the same operator there.flux_scheme for method='fvm').The face loop is a faithful copy of the FDM FDS branch (lines in
compute_resid_fdm guarded by state % use_fds), reusing the same private
helpers (fill_stencil, eval_face_sensor) and the same module imports;
compute_resid_fdm is intentionally left untouched to preserve its
byte-for-byte FDM behavior, so the loop body is duplicated rather than
factored into a shared helper. See task-3.1 report for the refactor note.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_t), | intent(inout) | :: | state |
Solver instance state. |