Skip to content

Commit

Permalink
Possible fix for feed inventory error
Browse files Browse the repository at this point in the history
  • Loading branch information
maxschalz committed Jun 10, 2021
1 parent 5e20a18 commit c38b334
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/enrichment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,23 @@ cyclus::Material::Ptr Enrichment::Enrich_(cyclus::Material::Ptr mat,
nucs.insert(922380000);
double natu_frac = mq.mass_frac(nucs);
double feed_req = natu_req / natu_frac;
// Take into account the above mentioned special case.
if (feed_req > pop_qty) {
// All of the available feed is to be used.
feed_req = pop_qty;

// Amount of U235 and U238 in the available feed.
double u235_u238_available = pop_qty * natu_frac;
double factor = (assays.Product() - assays.Tails())
/ (assays.Feed() - assays.Tails());
// Reevaluate how much product can be produced.
qty = u235_u238_available / factor;

// The SWU needs to be recalculated as well because all non-U235 and
// non-U238 elements/isotopes are directly sent to the tails and do
// not contribute to the SWU.
swu_req = SwuRequired(qty, assays);
}

// pop amount from inventory and blob it into one material
Material::Ptr r;
Expand Down

0 comments on commit c38b334

Please sign in to comment.