Function opensn::CMFDCountSignChangingRatios

Function Documentation

std::size_t opensn::CMFDCountSignChangingRatios(const std::vector<double> &coarse_phi_old, const std::vector<double> &coarse_phi_new)

Count the coarse values whose prolongation ratio would not preserve the sign of the fine flux.

CMFDProlongateScalarFluxRatio scales the fine flux of each coarse cell and coarse group by coarse_phi_new / coarse_phi_old, or by one where the old value is negligible. A ratio that is not finite and positive would change the sign of, or destroy, the fine flux it scales.

Parameters:
  • coarse_phi_old – Coarse scalar flux before the correction.

  • coarse_phi_new – Corrected coarse scalar flux.

Throws:

std::invalid_argument – If the two vectors differ in size.

Returns:

The number of local coarse values with a ratio that is not finite and positive.