Function opensn::CMFDComputeFineCellRatios

Function Documentation

std::vector<double> opensn::CMFDComputeFineCellRatios(const DiscreteOrdinatesProblem &do_problem, unsigned int num_groups, unsigned int group_aggregation_size, const CMFDCoarseMesh &coarse_mesh, const std::vector<double> &coarse_phi_old, const std::vector<double> &coarse_phi_new)

Compute the CMFD correction ratio coarse_phi_new / coarse_phi_old of every local fine cell.

The groups are split into num_coarse_groups = ceil(num_groups / group_aggregation_size) consecutive coarse groups. coarse_phi_old and coarse_phi_new hold the values of the local coarse cells, indexed by coarse cell local id * num_coarse_groups + coarse group. The ratio of a fine cell is that of its coarse cell and coarse group, or one where the old coarse value is zero. Coarse cells owned by other ranks send their ratios, so the operation is collective.

Throws:

std::invalid_argument – If group_aggregation_size is zero or a coarse vector has the wrong size.

Returns:

Ratios indexed by fine cell local id * num_coarse_groups + coarse group.