Summary
In SKIP_PHOTOCHEMFLUX builds, src/radiation/photochemistry.hpp derives the chem-band flux attenuation factor from n_gamma_final / n_gamma_initial. The final photon density is floored to small_x, but the stored initial photon density is not. This can produce an attenuation factor greater than 1 for initially positive sub-floor values, or after a solver overshoot.
Required changes
- Store the initial chem-band photon number density using the same
small_x floor used for the final value, or apply that floor when using it as the denominator.
- Bound the derived
flux_factor to a maximum of 1.
- Preserve the existing zero/nonpositive-initial-density behavior (attenuation factor of
0).
Rationale
A flux factor above one amplifies the radiation flux and can make the computed absorbed momentum (dMom*) negative. The attenuation factor should not increase flux during the chemistry update.
Affected area
src/radiation/photochemistry.hpp
SKIP_PHOTOCHEMFLUX initialization of n_gamma_initial
- Later algebraic
flux_factor calculation during chem-band state updates
Acceptance criteria
- For an initial photon density below
small_x, an unchanged burn does not increase any chem-band flux.
- Solver output above the initial photon density cannot produce
flux_factor > 1.
- Nonpositive initial photon density continues to yield a zero flux factor.
- The non-
SKIP_PHOTOCHEMFLUX path remains unchanged.
Requested by: @chongchonghe
Backlinks:
Summary
In
SKIP_PHOTOCHEMFLUXbuilds,src/radiation/photochemistry.hppderives the chem-band flux attenuation factor fromn_gamma_final / n_gamma_initial. The final photon density is floored tosmall_x, but the stored initial photon density is not. This can produce an attenuation factor greater than1for initially positive sub-floor values, or after a solver overshoot.Required changes
small_xfloor used for the final value, or apply that floor when using it as the denominator.flux_factorto a maximum of1.0).Rationale
A flux factor above one amplifies the radiation flux and can make the computed absorbed momentum (
dMom*) negative. The attenuation factor should not increase flux during the chemistry update.Affected area
src/radiation/photochemistry.hppSKIP_PHOTOCHEMFLUXinitialization ofn_gamma_initialflux_factorcalculation during chem-band state updatesAcceptance criteria
small_x, an unchanged burn does not increase any chem-band flux.flux_factor > 1.SKIP_PHOTOCHEMFLUXpath remains unchanged.Requested by: @chongchonghe
Backlinks: