mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Adding vacuum BCs to graveyard volumes automatically.
This commit is contained in:
parent
f5dd6abf7d
commit
6e2a601fe9
3 changed files with 22 additions and 1 deletions
|
|
@ -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_;
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue