From e4112ec16bb9591f2f5b2a9c8e02e3b2a416655e Mon Sep 17 00:00:00 2001 From: Katie Mummah Date: Fri, 19 Jul 2024 15:31:31 -0500 Subject: [PATCH] reactor keep packaging --- CHANGELOG.rst | 1 + src/reactor.cc | 6 ++++++ src/reactor.h | 21 ++++++++++++++++++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e4460ca1b1..c39a987b04 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,7 @@ Since last release **Added:** * Added package parameter to storage (#603, #612) * Added package parameter to source (#613, #617) +* Added default keep packaging to reactor (#618) **Changed:** diff --git a/src/reactor.cc b/src/reactor.cc index 27297cc297..0e4dca51c7 100644 --- a/src/reactor.cc +++ b/src/reactor.cc @@ -23,6 +23,7 @@ Reactor::Reactor(cyclus::Context* ctx) discharged(false), latitude(0.0), longitude(0.0), + keep_packaging(1), coordinates(latitude, longitude) {} @@ -62,6 +63,11 @@ void Reactor::InitFrom(cyclus::QueryableBackend* b) { void Reactor::EnterNotify() { cyclus::Facility::EnterNotify(); + // Set keep packaging parameter in all ResBufs + fresh.keep_packaging(keep_packaging); + core.keep_packaging(keep_packaging); + spent.keep_packaging(keep_packaging); + // If the user ommitted fuel_prefs, we set it to zeros for each fuel // type. Without this segfaults could occur - yuck. if (fuel_prefs.size() == 0) { diff --git a/src/reactor.h b/src/reactor.h index d412f2026c..f94e5a0eab 100644 --- a/src/reactor.h +++ b/src/reactor.h @@ -407,13 +407,28 @@ class Reactor : public cyclus::Facility, } std::vector pref_change_values; + #pragma cyclus var { \ + "default": 1, \ + "tooltip": "Whether to persist packaging throughout the reactor", \ + "doc": "Boolean value about whether to keep packaging. If true, " \ + "packaging will not be stripped upon acceptance into the " \ + "reactor. If false, package type will be stripped immediately " \ + "upon acceptance. Has no effect if the incoming material is not " \ + "packaged.", \ + "uilabel": "Keep Packaging", \ + "uitype": "bool"} + bool keep_packaging; + // Resource inventories - these must be defined AFTER/BELOW the member vars // referenced (e.g. n_batch_fresh, assem_size, etc.). - #pragma cyclus var {"capacity": "n_assem_fresh * assem_size"} + #pragma cyclus var {"capacity": "n_assem_fresh * assem_size", \ + "keep_packaging": "keep_packaging"} cyclus::toolkit::ResBuf fresh; - #pragma cyclus var {"capacity": "n_assem_core * assem_size"} + #pragma cyclus var {"capacity": "n_assem_core * assem_size", \ + "keep_packaging": "keep_packaging"} cyclus::toolkit::ResBuf core; - #pragma cyclus var {"capacity": "n_assem_spent * assem_size"} + #pragma cyclus var {"capacity": "n_assem_spent * assem_size", \ + "keep_packaging": "keep_packaging"} cyclus::toolkit::ResBuf spent;