diff --git a/src/dagmc.cpp b/src/dagmc.cpp index 1acef12629..a86f3c3e01 100644 --- a/src/dagmc.cpp +++ b/src/dagmc.cpp @@ -134,7 +134,7 @@ void load_dagmc_geometry() // initialize cell objects model::n_cells = model::DAG->num_entities(3); - + moab::EntityHandle graveyard = 0; for (int i = 0; i < model::n_cells; i++) { moab::EntityHandle vol_handle = model::DAG->entity_by_index(3, i+1); @@ -199,6 +199,11 @@ void load_dagmc_geometry() std::string cmp_str = mat_value; to_lower(cmp_str); + + if (cmp_str.find("graveyard") != std::string::npos) { + graveyard = vol_handle; + } + // material void checks if (cmp_str.find("void") != std::string::npos || cmp_str.find("vacuum") != std::string::npos || @@ -231,6 +236,11 @@ void load_dagmc_geometry() model::overlap_check_count.resize(model::cells.size(), 0); } + if (!graveyard) { + std::cout << "WARNING: No graveyard volume found in the DagMC model.\n"; + std::cout << "This may result in lost particles and rapid simulation failure.\n"; + } + /// Surfaces \\\ // initialize surface objects @@ -271,6 +281,17 @@ void load_dagmc_geometry() s->bc_ = BC_TRANSMIT; } + // graveyard check + moab::Range parent_vols; + rval = model::DAG->moab_instance()->get_parent_meshsets(surf_handle, parent_vols); + MB_CHK_ERR_CONT(rval); + + // if this surface belongs to the graveyard + if (graveyard && parent_vols.find(graveyard) != parent_vols.end()) { + // set BC to vacuum + s->bc_ = BC_VACUUM; + } + // add to global array and map model::surfaces[i] = s; model::surface_map[s->id_] = s->id_; diff --git a/tests/regression_tests/dagmc/dagmc.h5m b/tests/regression_tests/dagmc/dagmc.h5m index 49c28c4f5e..a55e061dca 100644 Binary files a/tests/regression_tests/dagmc/dagmc.h5m and b/tests/regression_tests/dagmc/dagmc.h5m differ diff --git a/tests/regression_tests/uwuw/dagmc.h5m b/tests/regression_tests/uwuw/dagmc.h5m index 8fca1fff14..4fbba3bb62 100644 Binary files a/tests/regression_tests/uwuw/dagmc.h5m and b/tests/regression_tests/uwuw/dagmc.h5m differ