diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f7fe79d18..689956a52 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,7 @@ Since last release **Added:** * Added package parameter to storage (#603, #612, #616) * 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 27297cc29..30e7857eb 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(true), 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 d412f2026..7767403fb 100644 --- a/src/reactor.h +++ b/src/reactor.h @@ -407,6 +407,18 @@ class Reactor : public cyclus::Facility, } std::vector pref_change_values; + #pragma cyclus var { \ + "default": true, \ + "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"} diff --git a/src/sink.cc b/src/sink.cc index bb7894e5a..b2b564438 100644 --- a/src/sink.cc +++ b/src/sink.cc @@ -14,6 +14,7 @@ Sink::Sink(cyclus::Context* ctx) capacity(std::numeric_limits::max()), latitude(0.0), longitude(0.0), + keep_packaging(true), coordinates(latitude, longitude) { SetMaxInventorySize(std::numeric_limits::max());} @@ -43,6 +44,8 @@ void Sink::EnterNotify() { cyclus::Facility::EnterNotify(); LOG(cyclus::LEV_INFO4, "SnkFac") << " using random behavior " << random_size_type; + inventory.keep_packaging(keep_packaging); + if (in_commod_prefs.size() == 0) { for (int i = 0; i < in_commods.size(); ++i) { in_commod_prefs.push_back(cyclus::kDefaultPref); diff --git a/src/sink.h b/src/sink.h index 0355d0e0e..b9be25ca7 100644 --- a/src/sink.h +++ b/src/sink.h @@ -257,6 +257,18 @@ class Sink f"frequency of the request, this is the upper bound. Default {CY_LARGE_INT} (CY_LARGE_INT)"} int random_frequency_max; + #pragma cyclus var { \ + "default": true, \ + "tooltip": "Whether to persist packaging in the sink.", \ + "doc": "Boolean value about whether to keep packaging. If true, " \ + "packaging will not be stripped upon acceptance into the " \ + "sink. 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; + #pragma cyclus var { \ "default": 0.0, \ "uilabel": "Geographical latitude in degrees as a double", \