Skip to main content

doppler_broaden

Function doppler_broaden 

Source
pub fn doppler_broaden(
    energies: &[f64],
    cross_sections: &[f64],
    params: &DopplerParams,
) -> Result<Vec<f64>, DopplerError>
Expand description

Apply FGM Doppler broadening to cross-section data.

The cross-sections are broadened in velocity space using the exact Free Gas Model integral from SAMMY manual Eq. III B1.7 (w²-weighted integrand; see the module docs).

§Edge behavior

Within ~6u (in velocity, u = √(k_B·T/AWR)) of either end of the grid, the convolution depends on σ beyond the supplied grid, which is extrapolated by the 1/v law — exact for physical 1/v-like tails; a constant σ deviates by the extrapolation mismatch (≲ u/v relative) at the outermost points. Edge points whose window is both truncated by the grid AND under-resolved (fewer than 3 nodes inside the 6u window) are returned unbroadened, matching SAMMY (fgm/mfgm1.f90: “IF too few points, do not broaden”); interior under-resolved points broaden normally (the kernel degenerates smoothly toward a delta).

§Arguments

  • energies — Energy grid in eV. Every entry must satisfy is_finite() && > 0.0, and the grid must be strictly ascending (duplicates are rejected). The contract is enforced at the public boundary by validate_doppler_grid.
  • cross_sections — Unbroadened cross-sections in barns at each energy point.
  • params — Doppler broadening parameters (temperature and AWR).

§Returns

Doppler-broadened cross-sections in barns on the same energy grid.

§Errors

  • DopplerError::LengthMismatch if energies.len() != cross_sections.len().
  • DopplerError::InvalidEnergy if any energy is non-finite or ≤ 0.
  • DopplerError::UnsortedEnergies if the grid is not strictly ascending.

§Algorithm

  1. Convert energy grid to velocity space (v = √E).
  2. Build extended grid including negative velocities for the FGM integral.
  3. Compute the integrand Y(w) = w² · s(w) on the extended grid.
  4. For each output velocity, evaluate the Gaussian convolution integral.
  5. Transform back: σ_D(E) = result / E.