Function opensn::CMFDCountSignChangingRatios
Defined in File cmfd_vector_tools.h
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.
CMFDApplyFineCellRatios 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 zero. A negative or non-finite ratio would change the sign of, or destroy, the fine flux it scales, and a negative old value is not rescaled at all (see CMFDRatioChangesSign). A zero ratio sets the fine flux to zero, which is the coarse solution of a source-free region that no face couples to the rest of the problem.- 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 an inadmissible ratio.