Skip to content

Add ib_surface_wrt: wall temperature and gasified mass flux at each IB surface point #2057

Open

Description

@sbryngelson

Summary

Adds ib_surface_wrt (logical, default off): at every save, each rank writes D/ib_surface_<rank>_<save>.dat (no header), one line per surface point of each chemistry IB (thermal_bc /= 0 or surface_reaction = 1):

x y z ib nx ny nz area T_wall mdot

T_wall and mdot (gasified mass flux, kg/m²/s) are what the surface solve determined at that point; area is the surface the point stands for. Σ area·mdot is an IB's mass-loss rate and mdot/ρ_solid its local regression rate.

Why output rather than a moving surface. Carbon regresses slowly next to the flow: the surface mechanism's kinetic limit in air is 27 µm/s at 1500 K and 250 µm/s at 1800 K, so in a 70 µs run a 2 mm rod recedes < 20 nm (10⁻⁵ D). What the CM3C carbon-rod experiments measure, regression against surface temperature, is this rate, which a run can now report directly.

Area weights. The points are the ghost points within two cell sizes h = dV^(1/d) of the surface, each weighted dV/(2h). The band lies inside the solid, where a layer at depth s has area A(1 − s/R)^(d−1), so for circles, spheres and cylinder sides the weight is scaled by (R/(R − s))^(d−1). Sampled over random lattice offsets this is unbiased (sphere at R = 12h: < 0.1% mean, 0.3% spread; circle at R = 20h: ~1% spread). A one-cell band without the correction was 8–9% low. Other shapes keep the uncorrected band.

No heat flux column. An earlier version also wrote k(T_s − T_IP)/d. Within half a cell of the wall that estimate divides T_IP's interpolation error by a tiny d: against a fit of the gas temperature it was ~3× too large there, and summed over a sphere it overstated the heat the gas actually received by 19% at R = 6h and 33% at R = 12h. It is left out rather than written known-wrong; the follow-up thermal_bc = 3 PR measures heat exchange from the face fluxes instead.

Testing

  • 2D reacting-surface example (D = 2 mm, 40 cells/D, T_wall = 1200 K), serial CPU: the written points are exactly the geometric band cells; Σ area = 0.988 πD; mean gasified flux 1.634e-3 kg/m²/s against the mechanism's kinetic limit of 1.658e-3 at 1200 K (diffusion barely limits there), i.e. 0.91 µm/s regression for ρ = 1800 kg/m³.
  • 3D, 200 µm graphite sphere in Mach 1.5 air at T_wall = 1800 K, 24 cells/d, 4 MI300A: 3048 points sum to 0.998 × 4πR²; mean gasified flux 0.35 kg/m²/s (~190 µm/s), 0.50 on the upstream half (post-shock, ~3 bar at stagnation) and 0.20 on the downstream half (oxygen-depleted wake).
  • Validator: ib_surface_wrt requires ib and chemistry.
  • No field changes, so no golden of its own: the writer runs in the thermal_bc = 3 test of the follow-up PR.

./mfc.sh lint passes except the two [dp-acc] thermochem codegen tests, which also fail here without this change (LLNL gfortran 13.3.1's nvptx offload lacks log10).

Tested on LLNL Tuolumne (CCE 19 CPU; OpenMP offload on MI300A).


A fix for this is already written. The pull request was closed only to reduce the number of simultaneously open PRs from this author, not because the work was rejected or found incorrect.

Tracked with the pr-to-do label so the whole set is discoverable together.

Filed with Claude Code.

Activity

  1. added
    pr-to-doFix already written in a closed PR; reopen when review capacity allows
    on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pr-to-doFix already written in a closed PR; reopen when review capacity allows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions