From 81189ab96187ace1e9738a092c87d6815f854e7d Mon Sep 17 00:00:00 2001 From: aprilnovak Date: Sun, 4 Aug 2019 17:50:13 -0700 Subject: [PATCH] Ensure that number of OpenMC cells tracked in the surrogate mapping in the pellet region matches the number of total fissionable cells. Refs #55 --- src/openmc_heat_driver.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/openmc_heat_driver.cpp b/src/openmc_heat_driver.cpp index 4a8ad1bd..73288882 100644 --- a/src/openmc_heat_driver.cpp +++ b/src/openmc_heat_driver.cpp @@ -56,6 +56,8 @@ void OpenmcHeatDriver::init_mappings() // TODO: Don't hardcode number of azimuthal segments int n_azimuthal = 4; + int n_fissionable_mapped = 0; + for (int i = 0; i < heat_driver_->n_pins_; ++i) { // Get coordinate of pin center double x_center = heat_driver_->pin_centers_(i, 0); @@ -87,6 +89,9 @@ void OpenmcHeatDriver::init_mappings() if (tracked.find(c) == tracked.end()) { openmc_driver_->cells_.push_back(c); tracked[c] = openmc_driver_->cells_.size() - 1; + + if (k < heat_driver_->n_fuel_rings_) + n_fissionable_mapped++; } // ensure that the cell being mapped for the pellet region contains @@ -113,6 +118,12 @@ void OpenmcHeatDriver::init_mappings() } } + // check that all fissionable cells have been mapped to the T/H model. + // Note that this does not check for distortions in the model, just that + // the surrogate T/H model is sufficiently fine in the pellet region to + // capture all fissionable cells in OpenMC. + Ensures(openmc_driver_->n_fissionable_cells_ == n_fissionable_mapped); + if (openmc_driver_->active()) { n_materials_ = openmc_driver_->cells_.size(); }