Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enrichment facility fails in case of limited feed availability #527

Open
maxschalz opened this issue Jun 10, 2021 · 1 comment
Open

Enrichment facility fails in case of limited feed availability #527

maxschalz opened this issue Jun 10, 2021 · 1 comment

Comments

@maxschalz
Copy link
Contributor

In case of an enrichment feed composed of more than just U235 and U238 and the feed quantity being the limiting factor, the simulation fails. This is caused by the enrichment facility trying to retrieve too much feed uranium:

A(n) :cycamore:Enrichment named MyEnrichment at time 0 received the following error:
 tried to remove 1000.05 from its inventory of size 1000 and the conversion of the material into natu is 2.17755e+301

A minimum working example can be found here.

I may have found the cause of this problem. In the following line,

double feed_req = natu_req / natu_frac;

the feed to be enriched gets calculated while taking into account possible adjustments in case the feed is not a pure U235/U238 mixture (this impurity is encoded in the natu_frac variable).
However, if there is limited feed available, this leads to the above problem: natu_req is equal to the amount of material in the feed inventory and division by natu_frac (natu_frac < 0) leads to a larger number.

One possible fix could be the following, to be inserted at line 387

  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' is the product quantity asked for in the DRE request.
    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);
  }

Possible caveat: by recalculating qty, there will eventually be less enriched U than asked for in the enrichment request.
I don't know if that could be a problem or not

maxschalz added a commit to maxschalz/cycamore that referenced this issue Jun 10, 2021
@maxschalz
Copy link
Contributor Author

I have realised that the above code is maybe difficult to understand out of context. I have uploaded it in my fork, see https://github.com/maxschalz/cycamore/blob/enrichment_feed_error/src/enrichment.cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant