Skip to content

Commit

Permalink
reactor keep packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearkatie committed Jul 19, 2024
1 parent 2724432 commit e4112ec
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:**

Expand Down
6 changes: 6 additions & 0 deletions src/reactor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Reactor::Reactor(cyclus::Context* ctx)
discharged(false),
latitude(0.0),
longitude(0.0),
keep_packaging(1),
coordinates(latitude, longitude) {}


Expand Down Expand Up @@ -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) {
Expand Down
21 changes: 18 additions & 3 deletions src/reactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,28 @@ class Reactor : public cyclus::Facility,
}
std::vector<double> 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<cyclus::Material> 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<cyclus::Material> 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<cyclus::Material> spent;


Expand Down

0 comments on commit e4112ec

Please sign in to comment.