CYCAMORE
Loading...
Searching...
No Matches
build/cycamore/fuel_fab.h
Go to the documentation of this file.
1
2#line 1 "/cycamore/src/fuel_fab.h"
3#ifndef CYCAMORE_SRC_FUEL_FAB_H_
4#define CYCAMORE_SRC_FUEL_FAB_H_
5
6#include <string>
7#include "cyclus.h"
8#include "cycamore_version.h"
9
10#pragma cyclus exec from cyclus.system import CY_LARGE_DOUBLE, CY_LARGE_INT, CY_NEAR_ZERO
11
12namespace cycamore {
13
58/// Breeding. Economics, and Safety in Large Fast Power Reactors. 1963.
59/// @endcode
60class FuelFab
61 : public cyclus::Facility,
62 public cyclus::toolkit::Position {
63#pragma cyclus note { "niche": "fabrication", "doc": "FuelFab takes in 2 streams of material and mixes them in ratios in order to" " supply material that matches some neutronics properties of reqeusted" " material. It uses an equivalence type method [1]" " inspired by a similar approach in the COSI fuel cycle simulator." "\n\n" "The FuelFab has 3 input inventories: fissile stream, filler stream, and an" " optional top-up inventory. All materials received into each inventory are" " always combined into a single material (i.e. a single fissile material, a" " single filler material, etc.). The input streams and requested fuel" " composition are each assigned weights based on summing:" "\n\n" " N * (p_i - p_U238) / (p_Pu239 - p_U238)" "\n\n" "for each nuclide where:" "\n" "\n - p = nu*sigma_f - sigma_a for the nuclide" "\n - p_U238 is p for pure U238" "\n - p_Pu239 is p for pure Pu239" "\n - N is the nuclide's atom fraction" "\n - nu is the average # neutrons per fission" "\n - sigma_f is the microscopic fission cross-section" "\n - sigma_a is the microscopic neutron absorption cross-section" "\n\n" "The cross sections are from the simple cross section library in PyNE. They" " can be set to either a thermal or fast neutron spectrum. A linear" " interpolation is performed using the weights of the fissile, filler, and" " target streams. The interpolation is used to compute a mixing ratio of the" " input streams that matches the target weight. In the event that the target" " weight is higher than the fissile stream weight, the FuelFab will attempt" " to use the top-up and fissile input streams together instead of the fissile" " and filler streams. All supplied material will always have the same weight" " as the requested material." "\n\n" "The supplying of mixed material is constrained by available inventory" " quantities and a per time step throughput limit. Requests for fuel" " material larger than the throughput can never be met. Fissile inventory" " can be requested/received via one or more commodities. The DRE request" " preference for each of these commodities can also optionally be specified." " By default, the top-up inventory size is zero, and it is not used for" " mixing. " "\n\n" "[1] Baker, A. R., and R. W. Ross. \"Comparison of the value of plutonium and" " uranium isotopes in fast reactors.\" Proceedings of the Conference on" " Breeding. Economics, and Safety in Large Fast Power Reactors. 1963." "", }
64#line 110 "/cycamore/src/fuel_fab.h"
65 public:
66 FuelFab(cyclus::Context* ctx);
67 virtual ~FuelFab(){};
69 virtual std::string version() { return CYCAMORE_VERSION; }
70 virtual void InitFrom(cycamore::FuelFab* m) {
71 cyclus::Facility::InitFrom(m);
72 int rawcycpp_shape_latitude[1] = {-1};
73 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
74 int rawcycpp_shape_longitude[1] = {-1};
75 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
76 int rawcycpp_shape_fill_commods[2] = {-1, -1};
77 cycpp_shape_fill_commods = std::vector<int>(rawcycpp_shape_fill_commods, rawcycpp_shape_fill_commods + 2);
78 int rawcycpp_shape_fill_commod_prefs[2] = {-1, -1};
79 cycpp_shape_fill_commod_prefs = std::vector<int>(rawcycpp_shape_fill_commod_prefs, rawcycpp_shape_fill_commod_prefs + 2);
80 int rawcycpp_shape_fill_recipe[1] = {-1};
81 cycpp_shape_fill_recipe = std::vector<int>(rawcycpp_shape_fill_recipe, rawcycpp_shape_fill_recipe + 1);
82 int rawcycpp_shape_fill_size[1] = {-1};
83 cycpp_shape_fill_size = std::vector<int>(rawcycpp_shape_fill_size, rawcycpp_shape_fill_size + 1);
84 int rawcycpp_shape_fill[2] = {-1, -1};
85 cycpp_shape_fill = std::vector<int>(rawcycpp_shape_fill, rawcycpp_shape_fill + 2);
86 int rawcycpp_shape_fiss_commods[2] = {-1, -1};
87 cycpp_shape_fiss_commods = std::vector<int>(rawcycpp_shape_fiss_commods, rawcycpp_shape_fiss_commods + 2);
88 int rawcycpp_shape_fiss_commod_prefs[2] = {-1, -1};
89 cycpp_shape_fiss_commod_prefs = std::vector<int>(rawcycpp_shape_fiss_commod_prefs, rawcycpp_shape_fiss_commod_prefs + 2);
90 int rawcycpp_shape_fiss_recipe[1] = {-1};
91 cycpp_shape_fiss_recipe = std::vector<int>(rawcycpp_shape_fiss_recipe, rawcycpp_shape_fiss_recipe + 1);
92 int rawcycpp_shape_fiss_size[1] = {-1};
93 cycpp_shape_fiss_size = std::vector<int>(rawcycpp_shape_fiss_size, rawcycpp_shape_fiss_size + 1);
94 int rawcycpp_shape_fiss[2] = {-1, -1};
95 cycpp_shape_fiss = std::vector<int>(rawcycpp_shape_fiss, rawcycpp_shape_fiss + 2);
96 int rawcycpp_shape_topup_commod[1] = {-1};
97 cycpp_shape_topup_commod = std::vector<int>(rawcycpp_shape_topup_commod, rawcycpp_shape_topup_commod + 1);
98 int rawcycpp_shape_topup_pref[1] = {-1};
99 cycpp_shape_topup_pref = std::vector<int>(rawcycpp_shape_topup_pref, rawcycpp_shape_topup_pref + 1);
100 int rawcycpp_shape_topup_recipe[1] = {-1};
101 cycpp_shape_topup_recipe = std::vector<int>(rawcycpp_shape_topup_recipe, rawcycpp_shape_topup_recipe + 1);
102 int rawcycpp_shape_topup_size[1] = {-1};
103 cycpp_shape_topup_size = std::vector<int>(rawcycpp_shape_topup_size, rawcycpp_shape_topup_size + 1);
104 int rawcycpp_shape_topup[2] = {-1, -1};
105 cycpp_shape_topup = std::vector<int>(rawcycpp_shape_topup, rawcycpp_shape_topup + 2);
106 int rawcycpp_shape_outcommod[1] = {-1};
107 cycpp_shape_outcommod = std::vector<int>(rawcycpp_shape_outcommod, rawcycpp_shape_outcommod + 1);
108 int rawcycpp_shape_throughput[1] = {-1};
109 cycpp_shape_throughput = std::vector<int>(rawcycpp_shape_throughput, rawcycpp_shape_throughput + 1);
110 int rawcycpp_shape_spectrum[1] = {-1};
111 cycpp_shape_spectrum = std::vector<int>(rawcycpp_shape_spectrum, rawcycpp_shape_spectrum + 1);
112 latitude = m->latitude;
113 longitude = m->longitude;
117 fill_size = m->fill_size;
121 fiss_size = m->fiss_size;
126 outcommod = m->outcommod;
128 spectrum = m->spectrum;
129 fill.capacity(m->fill.capacity());
130 fiss.capacity(m->fiss.capacity());
131 topup.capacity(m->topup.capacity());
132 };
133#line 115 "/cycamore/src/fuel_fab.h"
134
135 virtual void InitFrom(cyclus::QueryableBackend* b) {
136 cyclus::Facility::InitFrom(b);
137 int rawcycpp_shape_latitude[1] = {-1};
138 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
139 int rawcycpp_shape_longitude[1] = {-1};
140 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
141 int rawcycpp_shape_fill_commods[2] = {-1, -1};
142 cycpp_shape_fill_commods = std::vector<int>(rawcycpp_shape_fill_commods, rawcycpp_shape_fill_commods + 2);
143 int rawcycpp_shape_fill_commod_prefs[2] = {-1, -1};
144 cycpp_shape_fill_commod_prefs = std::vector<int>(rawcycpp_shape_fill_commod_prefs, rawcycpp_shape_fill_commod_prefs + 2);
145 int rawcycpp_shape_fill_recipe[1] = {-1};
146 cycpp_shape_fill_recipe = std::vector<int>(rawcycpp_shape_fill_recipe, rawcycpp_shape_fill_recipe + 1);
147 int rawcycpp_shape_fill_size[1] = {-1};
148 cycpp_shape_fill_size = std::vector<int>(rawcycpp_shape_fill_size, rawcycpp_shape_fill_size + 1);
149 int rawcycpp_shape_fill[2] = {-1, -1};
150 cycpp_shape_fill = std::vector<int>(rawcycpp_shape_fill, rawcycpp_shape_fill + 2);
151 int rawcycpp_shape_fiss_commods[2] = {-1, -1};
152 cycpp_shape_fiss_commods = std::vector<int>(rawcycpp_shape_fiss_commods, rawcycpp_shape_fiss_commods + 2);
153 int rawcycpp_shape_fiss_commod_prefs[2] = {-1, -1};
154 cycpp_shape_fiss_commod_prefs = std::vector<int>(rawcycpp_shape_fiss_commod_prefs, rawcycpp_shape_fiss_commod_prefs + 2);
155 int rawcycpp_shape_fiss_recipe[1] = {-1};
156 cycpp_shape_fiss_recipe = std::vector<int>(rawcycpp_shape_fiss_recipe, rawcycpp_shape_fiss_recipe + 1);
157 int rawcycpp_shape_fiss_size[1] = {-1};
158 cycpp_shape_fiss_size = std::vector<int>(rawcycpp_shape_fiss_size, rawcycpp_shape_fiss_size + 1);
159 int rawcycpp_shape_fiss[2] = {-1, -1};
160 cycpp_shape_fiss = std::vector<int>(rawcycpp_shape_fiss, rawcycpp_shape_fiss + 2);
161 int rawcycpp_shape_topup_commod[1] = {-1};
162 cycpp_shape_topup_commod = std::vector<int>(rawcycpp_shape_topup_commod, rawcycpp_shape_topup_commod + 1);
163 int rawcycpp_shape_topup_pref[1] = {-1};
164 cycpp_shape_topup_pref = std::vector<int>(rawcycpp_shape_topup_pref, rawcycpp_shape_topup_pref + 1);
165 int rawcycpp_shape_topup_recipe[1] = {-1};
166 cycpp_shape_topup_recipe = std::vector<int>(rawcycpp_shape_topup_recipe, rawcycpp_shape_topup_recipe + 1);
167 int rawcycpp_shape_topup_size[1] = {-1};
168 cycpp_shape_topup_size = std::vector<int>(rawcycpp_shape_topup_size, rawcycpp_shape_topup_size + 1);
169 int rawcycpp_shape_topup[2] = {-1, -1};
170 cycpp_shape_topup = std::vector<int>(rawcycpp_shape_topup, rawcycpp_shape_topup + 2);
171 int rawcycpp_shape_outcommod[1] = {-1};
172 cycpp_shape_outcommod = std::vector<int>(rawcycpp_shape_outcommod, rawcycpp_shape_outcommod + 1);
173 int rawcycpp_shape_throughput[1] = {-1};
174 cycpp_shape_throughput = std::vector<int>(rawcycpp_shape_throughput, rawcycpp_shape_throughput + 1);
175 int rawcycpp_shape_spectrum[1] = {-1};
176 cycpp_shape_spectrum = std::vector<int>(rawcycpp_shape_spectrum, rawcycpp_shape_spectrum + 1);
177 cyclus::QueryResult qr = b->Query("Info", NULL);
178 latitude = qr.GetVal<double>("latitude");
179 longitude = qr.GetVal<double>("longitude");
180 fill_commods = qr.GetVal<std::vector< std::string > >("fill_commods");
181 fill_commod_prefs = qr.GetVal<std::vector< double > >("fill_commod_prefs");
182 fill_recipe = qr.GetVal<std::string>("fill_recipe");
183 fill_size = qr.GetVal<double>("fill_size");
184 fiss_commods = qr.GetVal<std::vector< std::string > >("fiss_commods");
185 fiss_commod_prefs = qr.GetVal<std::vector< double > >("fiss_commod_prefs");
186 fiss_recipe = qr.GetVal<std::string>("fiss_recipe");
187 fiss_size = qr.GetVal<double>("fiss_size");
188 topup_commod = qr.GetVal<std::string>("topup_commod");
189 topup_pref = qr.GetVal<double>("topup_pref");
190 topup_recipe = qr.GetVal<std::string>("topup_recipe");
191 topup_size = qr.GetVal<double>("topup_size");
192 outcommod = qr.GetVal<std::string>("outcommod");
193 throughput = qr.GetVal<double>("throughput");
194 spectrum = qr.GetVal<std::string>("spectrum");
195 fill.capacity(fill_size);
196 fiss.capacity(fiss_size);
197 topup.capacity(topup_size);
198 };
199
200 virtual void InfileToDb(cyclus::InfileTree* tree, cyclus::DbInit di) {
201 cyclus::Facility::InfileToDb(tree, di);
202 int rawcycpp_shape_latitude[1] = {-1};
203 cycpp_shape_latitude = std::vector<int>(rawcycpp_shape_latitude, rawcycpp_shape_latitude + 1);
204 int rawcycpp_shape_longitude[1] = {-1};
205 cycpp_shape_longitude = std::vector<int>(rawcycpp_shape_longitude, rawcycpp_shape_longitude + 1);
206 int rawcycpp_shape_fill_commods[2] = {-1, -1};
207 cycpp_shape_fill_commods = std::vector<int>(rawcycpp_shape_fill_commods, rawcycpp_shape_fill_commods + 2);
208 int rawcycpp_shape_fill_commod_prefs[2] = {-1, -1};
209 cycpp_shape_fill_commod_prefs = std::vector<int>(rawcycpp_shape_fill_commod_prefs, rawcycpp_shape_fill_commod_prefs + 2);
210 int rawcycpp_shape_fill_recipe[1] = {-1};
211 cycpp_shape_fill_recipe = std::vector<int>(rawcycpp_shape_fill_recipe, rawcycpp_shape_fill_recipe + 1);
212 int rawcycpp_shape_fill_size[1] = {-1};
213 cycpp_shape_fill_size = std::vector<int>(rawcycpp_shape_fill_size, rawcycpp_shape_fill_size + 1);
214 int rawcycpp_shape_fill[2] = {-1, -1};
215 cycpp_shape_fill = std::vector<int>(rawcycpp_shape_fill, rawcycpp_shape_fill + 2);
216 int rawcycpp_shape_fiss_commods[2] = {-1, -1};
217 cycpp_shape_fiss_commods = std::vector<int>(rawcycpp_shape_fiss_commods, rawcycpp_shape_fiss_commods + 2);
218 int rawcycpp_shape_fiss_commod_prefs[2] = {-1, -1};
219 cycpp_shape_fiss_commod_prefs = std::vector<int>(rawcycpp_shape_fiss_commod_prefs, rawcycpp_shape_fiss_commod_prefs + 2);
220 int rawcycpp_shape_fiss_recipe[1] = {-1};
221 cycpp_shape_fiss_recipe = std::vector<int>(rawcycpp_shape_fiss_recipe, rawcycpp_shape_fiss_recipe + 1);
222 int rawcycpp_shape_fiss_size[1] = {-1};
223 cycpp_shape_fiss_size = std::vector<int>(rawcycpp_shape_fiss_size, rawcycpp_shape_fiss_size + 1);
224 int rawcycpp_shape_fiss[2] = {-1, -1};
225 cycpp_shape_fiss = std::vector<int>(rawcycpp_shape_fiss, rawcycpp_shape_fiss + 2);
226 int rawcycpp_shape_topup_commod[1] = {-1};
227 cycpp_shape_topup_commod = std::vector<int>(rawcycpp_shape_topup_commod, rawcycpp_shape_topup_commod + 1);
228 int rawcycpp_shape_topup_pref[1] = {-1};
229 cycpp_shape_topup_pref = std::vector<int>(rawcycpp_shape_topup_pref, rawcycpp_shape_topup_pref + 1);
230 int rawcycpp_shape_topup_recipe[1] = {-1};
231 cycpp_shape_topup_recipe = std::vector<int>(rawcycpp_shape_topup_recipe, rawcycpp_shape_topup_recipe + 1);
232 int rawcycpp_shape_topup_size[1] = {-1};
233 cycpp_shape_topup_size = std::vector<int>(rawcycpp_shape_topup_size, rawcycpp_shape_topup_size + 1);
234 int rawcycpp_shape_topup[2] = {-1, -1};
235 cycpp_shape_topup = std::vector<int>(rawcycpp_shape_topup, rawcycpp_shape_topup + 2);
236 int rawcycpp_shape_outcommod[1] = {-1};
237 cycpp_shape_outcommod = std::vector<int>(rawcycpp_shape_outcommod, rawcycpp_shape_outcommod + 1);
238 int rawcycpp_shape_throughput[1] = {-1};
239 cycpp_shape_throughput = std::vector<int>(rawcycpp_shape_throughput, rawcycpp_shape_throughput + 1);
240 int rawcycpp_shape_spectrum[1] = {-1};
241 cycpp_shape_spectrum = std::vector<int>(rawcycpp_shape_spectrum, rawcycpp_shape_spectrum + 1);
242 cyclus::InfileTree* sub = tree->SubTree("config/*");
243 int i;
244 int n;
245 if (sub->NMatches("latitude") > 0) {
246 {
247 double latitude_val = cyclus::Query<double>(sub, "latitude");
248 latitude = latitude_val;
249 }
250 } else {
251 double latitude_tmp = 0.0;
252 latitude = latitude_tmp;
253 }
254 if (sub->NMatches("longitude") > 0) {
255 {
256 double longitude_val = cyclus::Query<double>(sub, "longitude");
257 longitude = longitude_val;
258 }
259 } else {
260 double longitude_tmp = 0.0;
261 longitude = longitude_tmp;
262 }
263 {
264 cyclus::InfileTree* bub = sub->SubTree("fill_commods", 0);
265 cyclus::InfileTree* sub = bub;
266 int n1 = sub->NMatches("val");
267 std::vector< std::string > fill_commods_val;
268 fill_commods_val.resize(n1);
269 for (int i1 = 0; i1 < n1; ++i1) {
270 std::string elem;
271 {
272 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
273 elem = elem_in;
274 }
275 fill_commods_val[i1] = elem;
276 }
277 fill_commods = fill_commods_val;
278 }
279 if (sub->NMatches("fill_commod_prefs") > 0) {
280 {
281 cyclus::InfileTree* bub = sub->SubTree("fill_commod_prefs", 0);
282 cyclus::InfileTree* sub = bub;
283 int n1 = sub->NMatches("val");
284 std::vector< double > fill_commod_prefs_val;
285 fill_commod_prefs_val.resize(n1);
286 for (int i1 = 0; i1 < n1; ++i1) {
287 double elem;
288 {
289 double elem_in = cyclus::Query<double>(sub, "val", i1);
290 elem = elem_in;
291 }
292 fill_commod_prefs_val[i1] = elem;
293 }
294 fill_commod_prefs = fill_commod_prefs_val;
295 }
296 } else {
297 std::vector< double > fill_commod_prefs_tmp;
298 fill_commod_prefs_tmp.resize(0);
299 {
300 }
301 fill_commod_prefs = fill_commod_prefs_tmp;
302 }
303 {
304 std::string fill_recipe_val = cyclus::Query<std::string>(sub, "fill_recipe");
305 fill_recipe = fill_recipe_val;
306 }
307 {
308 double fill_size_val = cyclus::Query<double>(sub, "fill_size");
309 fill_size = fill_size_val;
310 }
311 {
312 cyclus::InfileTree* bub = sub->SubTree("fiss_commods", 0);
313 cyclus::InfileTree* sub = bub;
314 int n1 = sub->NMatches("val");
315 std::vector< std::string > fiss_commods_val;
316 fiss_commods_val.resize(n1);
317 for (int i1 = 0; i1 < n1; ++i1) {
318 std::string elem;
319 {
320 std::string elem_in = cyclus::Query<std::string>(sub, "val", i1);
321 elem = elem_in;
322 }
323 fiss_commods_val[i1] = elem;
324 }
325 fiss_commods = fiss_commods_val;
326 }
327 if (sub->NMatches("fiss_commod_prefs") > 0) {
328 {
329 cyclus::InfileTree* bub = sub->SubTree("fiss_commod_prefs", 0);
330 cyclus::InfileTree* sub = bub;
331 int n1 = sub->NMatches("val");
332 std::vector< double > fiss_commod_prefs_val;
333 fiss_commod_prefs_val.resize(n1);
334 for (int i1 = 0; i1 < n1; ++i1) {
335 double elem;
336 {
337 double elem_in = cyclus::Query<double>(sub, "val", i1);
338 elem = elem_in;
339 }
340 fiss_commod_prefs_val[i1] = elem;
341 }
342 fiss_commod_prefs = fiss_commod_prefs_val;
343 }
344 } else {
345 std::vector< double > fiss_commod_prefs_tmp;
346 fiss_commod_prefs_tmp.resize(0);
347 {
348 }
349 fiss_commod_prefs = fiss_commod_prefs_tmp;
350 }
351 if (sub->NMatches("fiss_recipe") > 0) {
352 {
353 std::string fiss_recipe_val = cyclus::Query<std::string>(sub, "fiss_recipe");
354 fiss_recipe = fiss_recipe_val;
355 }
356 } else {
357 std::string fiss_recipe_tmp("");
358 fiss_recipe = fiss_recipe_tmp;
359 }
360 {
361 double fiss_size_val = cyclus::Query<double>(sub, "fiss_size");
362 fiss_size = fiss_size_val;
363 }
364 if (sub->NMatches("topup_commod") > 0) {
365 {
366 std::string topup_commod_val = cyclus::Query<std::string>(sub, "topup_commod");
367 topup_commod = topup_commod_val;
368 }
369 } else {
370 std::string topup_commod_tmp("");
371 topup_commod = topup_commod_tmp;
372 }
373 if (sub->NMatches("topup_pref") > 0) {
374 {
375 double topup_pref_val = cyclus::Query<double>(sub, "topup_pref");
376 topup_pref = topup_pref_val;
377 }
378 } else {
379 double topup_pref_tmp = 1.0;
380 topup_pref = topup_pref_tmp;
381 }
382 if (sub->NMatches("topup_recipe") > 0) {
383 {
384 std::string topup_recipe_val = cyclus::Query<std::string>(sub, "topup_recipe");
385 topup_recipe = topup_recipe_val;
386 }
387 } else {
388 std::string topup_recipe_tmp("");
389 topup_recipe = topup_recipe_tmp;
390 }
391 if (sub->NMatches("topup_size") > 0) {
392 {
393 double topup_size_val = cyclus::Query<double>(sub, "topup_size");
394 topup_size = topup_size_val;
395 }
396 } else {
397 double topup_size_tmp = 0;
398 topup_size = topup_size_tmp;
399 }
400 {
401 std::string outcommod_val = cyclus::Query<std::string>(sub, "outcommod");
402 outcommod = outcommod_val;
403 }
404 if (sub->NMatches("throughput") > 0) {
405 {
406 double throughput_val = cyclus::Query<double>(sub, "throughput");
407 throughput = throughput_val;
408 }
409 } else {
410 double throughput_tmp = 1e+299;
411 throughput = throughput_tmp;
412 }
413 {
414 std::string spectrum_val = cyclus::Query<std::string>(sub, "spectrum");
415 spectrum = spectrum_val;
416 }
417 di.NewDatum("Info")
418 ->AddVal("latitude", latitude, &cycpp_shape_latitude)
419 ->AddVal("longitude", longitude, &cycpp_shape_longitude)
420 ->AddVal("fill_commods", fill_commods, &cycpp_shape_fill_commods)
421 ->AddVal("fill_commod_prefs", fill_commod_prefs, &cycpp_shape_fill_commod_prefs)
422 ->AddVal("fill_recipe", fill_recipe, &cycpp_shape_fill_recipe)
423 ->AddVal("fill_size", fill_size, &cycpp_shape_fill_size)
424 ->AddVal("fiss_commods", fiss_commods, &cycpp_shape_fiss_commods)
425 ->AddVal("fiss_commod_prefs", fiss_commod_prefs, &cycpp_shape_fiss_commod_prefs)
426 ->AddVal("fiss_recipe", fiss_recipe, &cycpp_shape_fiss_recipe)
427 ->AddVal("fiss_size", fiss_size, &cycpp_shape_fiss_size)
428 ->AddVal("topup_commod", topup_commod, &cycpp_shape_topup_commod)
429 ->AddVal("topup_pref", topup_pref, &cycpp_shape_topup_pref)
430 ->AddVal("topup_recipe", topup_recipe, &cycpp_shape_topup_recipe)
431 ->AddVal("topup_size", topup_size, &cycpp_shape_topup_size)
432 ->AddVal("outcommod", outcommod, &cycpp_shape_outcommod)
433 ->AddVal("throughput", throughput, &cycpp_shape_throughput)
434 ->AddVal("spectrum", spectrum, &cycpp_shape_spectrum)
435 ->Record();
436 };
437
438 virtual cyclus::Agent* Clone() {
439 cycamore::FuelFab* m = new cycamore::FuelFab(context());
440 m->InitFrom(this);
441 return m;
442 };
443
444 virtual std::string schema() {
445 return ""
446 "<interleave>\n"
447 " <optional>\n"
448 " <element name=\"latitude\">\n"
449 " <a:documentation>Latitude of the agent's geographical position. The value should be expressed in degrees as a double.</a:documentation>\n"
450 " <data type=\"double\"/>\n"
451 " </element>\n"
452 " </optional>\n"
453 " <optional>\n"
454 " <element name=\"longitude\">\n"
455 " <a:documentation>Longitude of the agent's geographical position. The value should be expressed in degrees as a double.</a:documentation>\n"
456 " <data type=\"double\"/>\n"
457 " </element>\n"
458 " </optional>\n"
459 " <element name=\"fill_commods\">\n"
460 " <oneOrMore>\n"
461 " <element name=\"val\">\n"
462 " <data type=\"string\"/>\n"
463 " </element>\n"
464 " </oneOrMore>\n"
465 " </element>\n"
466 " <optional>\n"
467 " <element name=\"fill_commod_prefs\">\n"
468 " <oneOrMore>\n"
469 " <element name=\"val\">\n"
470 " <data type=\"double\"/>\n"
471 " </element>\n"
472 " </oneOrMore>\n"
473 " </element>\n"
474 " </optional>\n"
475 " <element name=\"fill_recipe\">\n"
476 " <a:documentation>Name of recipe to be used in filler material stream requests.</a:documentation>\n"
477 " <data type=\"string\"/>\n"
478 " </element>\n"
479 " <element name=\"fill_size\">\n"
480 " <a:documentation>Size of filler material stream inventory.</a:documentation>\n"
481 " <data type=\"double\"/>\n"
482 " </element>\n"
483 " <element name=\"fiss_commods\">\n"
484 " <oneOrMore>\n"
485 " <element name=\"val\">\n"
486 " <data type=\"string\"/>\n"
487 " </element>\n"
488 " </oneOrMore>\n"
489 " </element>\n"
490 " <optional>\n"
491 " <element name=\"fiss_commod_prefs\">\n"
492 " <oneOrMore>\n"
493 " <element name=\"val\">\n"
494 " <data type=\"double\"/>\n"
495 " </element>\n"
496 " </oneOrMore>\n"
497 " </element>\n"
498 " </optional>\n"
499 " <optional>\n"
500 " <element name=\"fiss_recipe\">\n"
501 " <a:documentation>Name for recipe to be used in fissile stream requests. Empty string results in use of an empty dummy recipe.</a:documentation>\n"
502 " <data type=\"string\"/>\n"
503 " </element>\n"
504 " </optional>\n"
505 " <element name=\"fiss_size\">\n"
506 " <a:documentation>Size of fissile material stream inventory.</a:documentation>\n"
507 " <data type=\"double\"/>\n"
508 " </element>\n"
509 " <optional>\n"
510 " <element name=\"topup_commod\">\n"
511 " <a:documentation>Commodity on which to request material for top-up stream. This MUST be set if 'topup_size &gt; 0'.</a:documentation>\n"
512 " <data type=\"string\"/>\n"
513 " </element>\n"
514 " </optional>\n"
515 " <optional>\n"
516 " <element name=\"topup_pref\">\n"
517 " <a:documentation>Top-up material stream request preference.</a:documentation>\n"
518 " <data type=\"double\"/>\n"
519 " </element>\n"
520 " </optional>\n"
521 " <optional>\n"
522 " <element name=\"topup_recipe\">\n"
523 " <a:documentation>Name of recipe to be used in top-up material stream requests. This MUST be set if 'topup_size &gt; 0'.</a:documentation>\n"
524 " <data type=\"string\"/>\n"
525 " </element>\n"
526 " </optional>\n"
527 " <optional>\n"
528 " <element name=\"topup_size\">\n"
529 " <a:documentation>Size of top-up material stream inventory.</a:documentation>\n"
530 " <data type=\"double\"/>\n"
531 " </element>\n"
532 " </optional>\n"
533 " <element name=\"outcommod\">\n"
534 " <a:documentation>Commodity on which to offer/supply mixed fuel material.</a:documentation>\n"
535 " <data type=\"string\"/>\n"
536 " </element>\n"
537 " <optional>\n"
538 " <element name=\"throughput\">\n"
539 " <a:documentation>Maximum number of kg of fuel material that can be supplied per time step.</a:documentation>\n"
540 " <data type=\"double\"/>\n"
541 " </element>\n"
542 " </optional>\n"
543 " <element name=\"spectrum\">\n"
544 " <a:documentation>The type of cross-sections to use for composition property calculation. Use 'fission_spectrum_ave' for fast reactor compositions or 'thermal' for thermal reactors.</a:documentation>\n"
545 " <data type=\"string\"/>\n"
546 " </element>\n"
547 "</interleave>\n";
548 };
549
550 virtual Json::Value annotations() {
551 Json::Value root;
552 Json::Reader reader;
553 bool parsed_ok = reader.parse(
554 "{\"name\":\"cycamore::FuelFab\",\"entity\":\"facility\",\"p"
555 "arents\":[\"cyclus::Facility\",\"cyclus::toolkit::Posi"
556 "tion\"],\"all_parents\":[\"EconomicEntity\",\"cyclus::Ag"
557 "ent\",\"cyclus::Facility\",\"cyclus::Ider\",\"cyclus::St"
558 "ateWrangler\",\"cyclus::TimeListener\",\"cyclus::Trade"
559 "r\",\"cyclus::toolkit::Position\"],\"vars\":{\"latitude\""
560 ":{\"default\":0.0,\"uilabel\":\"Geographical latitude "
561 "in degrees as a double\",\"doc\":\"Latitude of the "
562 "agent's geographical position. The value should be"
563 " expressed in degrees as a double.\",\"type\":\"double"
564 "\",\"index\":0,\"shape\":[-"
565 "1],\"alias\":\"latitude\",\"tooltip\":\"latitude\"},\"longi"
566 "tude\":{\"default\":0.0,\"uilabel\":\"Geographical "
567 "longitude in degrees as a double\",\"doc\":\"Longitude"
568 " of the agent's geographical position. The value "
569 "should be expressed in degrees as a double.\",\"type"
570 "\":\"double\",\"index\":1,\"shape\":[-"
571 "1],\"alias\":\"longitude\",\"tooltip\":\"longitude\"},\"fil"
572 "l_commods\":{\"doc\":\"Ordered list of commodities on "
573 "which to requesting filler stream "
574 "material.\",\"uilabel\":[\"Filler Stream Commodities\","
575 "\"\"],\"uitype\":[\"oneormore\",\"incommodity\"],\"type\":[\""
576 "std::vector\",\"std::string\"],\"index\":2,\"shape\":[-"
577 "1,-"
578 "1],\"alias\":[\"fill_commods\",\"val\"],\"tooltip\":[\"fill"
579 "_commods\",\"\"]},\"fill_commod_prefs\":{\"default\":[],\""
580 "uilabel\":[\"Filler Stream "
581 "Preferences\",\"\"],\"doc\":\"Filler stream commodity "
582 "request preferences for each of the given filler "
583 "commodities (same order). If unspecified, default "
584 "is to use 1.0 for all preferences.\",\"type\":[\"std::"
585 "vector\",\"double\"],\"index\":3,\"shape\":[-1,-"
586 "1],\"alias\":[\"fill_commod_prefs\",\"val\"],\"tooltip\":["
587 "\"fill_commod_prefs\",\"\"]},\"fill_recipe\":{\"doc\":\"Nam"
588 "e of recipe to be used in filler material stream "
589 "requests.\",\"uilabel\":\"Filler Stream Recipe\",\"uityp"
590 "e\":\"inrecipe\",\"type\":\"std::string\",\"index\":4,\"shap"
591 "e\":[-"
592 "1],\"alias\":\"fill_recipe\",\"tooltip\":\"fill_recipe\"},"
593 "\"fill_size\":{\"doc\":\"Size of filler material stream"
594 " inventory.\",\"uilabel\":\"Filler Stream Inventory Ca"
595 "pacity\",\"units\":\"kg\",\"type\":\"double\",\"index\":5,\"sh"
596 "ape\":[-"
597 "1],\"alias\":\"fill_size\",\"tooltip\":\"fill_size\"},\"fil"
598 "l\":{\"capacity\":\"fill_size\",\"type\":[\"cyclus::toolki"
599 "t::ResBuf\",\"cyclus::Material\"],\"index\":6,\"shape\":["
600 "-1,-1]},\"fiss_commods\":{\"doc\":\"Ordered list of "
601 "commodities on which to requesting fissile stream "
602 "material.\",\"uilabel\":[\"Fissile Stream Commodities\""
603 ",\"\"],\"uitype\":[\"oneormore\",\"incommodity\"],\"type\":["
604 "\"std::vector\",\"std::string\"],\"index\":7,\"shape\":[-"
605 "1,-"
606 "1],\"alias\":[\"fiss_commods\",\"val\"],\"tooltip\":[\"fiss"
607 "_commods\",\"\"]},\"fiss_commod_prefs\":{\"default\":[],\""
608 "uilabel\":[\"Fissile Stream "
609 "Preferences\",\"\"],\"doc\":\"Fissile stream commodity "
610 "request preferences for each of the given fissile "
611 "commodities (same order). If unspecified, default "
612 "is to use 1.0 for all preferences.\",\"type\":[\"std::"
613 "vector\",\"double\"],\"index\":8,\"shape\":[-1,-"
614 "1],\"alias\":[\"fiss_commod_prefs\",\"val\"],\"tooltip\":["
615 "\"fiss_commod_prefs\",\"\"]},\"fiss_recipe\":{\"doc\":\"Nam"
616 "e for recipe to be used in fissile stream "
617 "requests. Empty string results in use of an empty "
618 "dummy "
619 "recipe.\",\"uitype\":\"inrecipe\",\"uilabel\":\"Fissile "
620 "Stream Recipe\",\"default\":\"\",\"type\":\"std::string\",\""
621 "index\":9,\"shape\":[-"
622 "1],\"alias\":\"fiss_recipe\",\"tooltip\":\"fiss_recipe\"},"
623 "\"fiss_size\":{\"doc\":\"Size of fissile material "
624 "stream inventory.\",\"uilabel\":\"Fissile Stream "
625 "Inventory Capacity\",\"units\":\"kg\",\"type\":\"double\",\""
626 "index\":10,\"shape\":[-"
627 "1],\"alias\":\"fiss_size\",\"tooltip\":\"fiss_size\"},\"fis"
628 "s\":{\"capacity\":\"fiss_size\",\"type\":[\"cyclus::toolki"
629 "t::ResBuf\",\"cyclus::Material\"],\"index\":11,\"shape\":"
630 "[-1,-1]},\"topup_commod\":{\"doc\":\"Commodity on which"
631 " to request material for top-up stream. This MUST "
632 "be set if 'topup_size > 0'.\",\"uilabel\":\"Top-up "
633 "Stream Commodity\",\"default\":\"\",\"uitype\":\"incommodi"
634 "ty\",\"type\":\"std::string\",\"index\":12,\"shape\":[-"
635 "1],\"alias\":\"topup_commod\",\"tooltip\":\"topup_commod\""
636 "},\"topup_pref\":{\"doc\":\"Top-up material stream "
637 "request preference.\",\"uilabel\":\"Top-up Stream Pref"
638 "erence\",\"default\":1.0,\"type\":\"double\",\"index\":13,\""
639 "shape\":[-"
640 "1],\"alias\":\"topup_pref\",\"tooltip\":\"topup_pref\"},\"t"
641 "opup_recipe\":{\"doc\":\"Name of recipe to be used in "
642 "top-up material stream requests. This MUST be set "
643 "if 'topup_size > 0'.\",\"uilabel\":\"Top-up Stream Rec"
644 "ipe\",\"uitype\":\"inrecipe\",\"default\":\"\",\"type\":\"std:"
645 ":string\",\"index\":14,\"shape\":[-"
646 "1],\"alias\":\"topup_recipe\",\"tooltip\":\"topup_recipe\""
647 "},\"topup_size\":{\"doc\":\"Size of top-up material "
648 "stream inventory.\",\"uilabel\":\"Top-up Stream "
649 "Inventory Capacity\",\"units\":\"kg\",\"default\":0,\"type"
650 "\":\"double\",\"index\":15,\"shape\":[-"
651 "1],\"alias\":\"topup_size\",\"tooltip\":\"topup_size\"},\"t"
652 "opup\":{\"capacity\":\"topup_size\",\"type\":[\"cyclus::to"
653 "olkit::ResBuf\",\"cyclus::Material\"],\"index\":16,\"sha"
654 "pe\":[-1,-1]},\"outcommod\":{\"doc\":\"Commodity on "
655 "which to offer/supply mixed fuel "
656 "material.\",\"uilabel\":\"Output Commodity\",\"uitype\":\""
657 "outcommodity\",\"type\":\"std::string\",\"index\":17,\"sha"
658 "pe\":[-"
659 "1],\"alias\":\"outcommod\",\"tooltip\":\"outcommod\"},\"thr"
660 "oughput\":{\"doc\":\"Maximum number of kg of fuel "
661 "material that can be supplied per time "
662 "step.\",\"uilabel\":\"Maximum Throughput\",\"units\":\"kg\""
663 ",\"default\":1e+299,\"uitype\":\"range\",\"range\":[0.0,1e"
664 "+299],\"type\":\"double\",\"index\":18,\"shape\":[-"
665 "1],\"alias\":\"throughput\",\"tooltip\":\"throughput\"},\"s"
666 "pectrum\":{\"uilabel\":\"Spectrum type\",\"uitype\":\"comb"
667 "obox\",\"categorical\":[\"fission_spectrum_ave\",\"therm"
668 "al\"],\"doc\":\"The type of cross-sections to use for "
669 "composition property calculation. Use "
670 "'fission_spectrum_ave' for fast reactor "
671 "compositions or 'thermal' for thermal reactors.\",\""
672 "type\":\"std::string\",\"index\":19,\"shape\":[-"
673 "1],\"alias\":\"spectrum\",\"tooltip\":\"spectrum\"}},\"nich"
674 "e\":\"fabrication\",\"doc\":\"FuelFab takes in 2 streams"
675 " of material and mixes them in ratios in order to "
676 "supply material that matches some neutronics "
677 "properties of reqeusted material. It uses an "
678 "equivalence type method [1] inspired by a similar "
679 "approach in the COSI fuel cycle simulator.\\n\\nThe "
680 "FuelFab has 3 input inventories: fissile stream, "
681 "filler stream, and an optional top-up inventory. "
682 "All materials received into each inventory are "
683 "always combined into a single material (i.e. a "
684 "single fissile material, a single filler material,"
685 " etc.). The input streams and requested fuel "
686 "composition are each assigned weights based on "
687 "summing:\\n\\n N * (p_i - p_U238) / (p_Pu239 - "
688 "p_U238)\\n\\nfor each nuclide where:\\n\\n - p = "
689 "nu*sigma_f - sigma_a for the nuclide\\n - "
690 "p_U238 is p for pure U238\\n - p_Pu239 is p for "
691 "pure Pu239\\n - N is the nuclide's atom "
692 "fraction\\n - nu is the average # neutrons per "
693 "fission\\n - sigma_f is the microscopic fission "
694 "cross-section\\n - sigma_a is the microscopic "
695 "neutron absorption cross-section\\n\\nThe cross "
696 "sections are from the simple cross section library"
697 " in PyNE. They can be set to either a thermal or "
698 "fast neutron spectrum. A linear interpolation is "
699 "performed using the weights of the fissile, "
700 "filler, and target streams. The interpolation is "
701 "used to compute a mixing ratio of the input "
702 "streams that matches the target weight. In the "
703 "event that the target weight is higher than the "
704 "fissile stream weight, the FuelFab will attempt to"
705 " use the top-up and fissile input streams together"
706 " instead of the fissile and filler streams. All "
707 "supplied material will always have the same weight"
708 " as the requested material.\\n\\nThe supplying of "
709 "mixed material is constrained by available "
710 "inventory quantities and a per time step "
711 "throughput limit. Requests for fuel material "
712 "larger than the throughput can never be met. "
713 "Fissile inventory can be requested/received via "
714 "one or more commodities. The DRE request "
715 "preference for each of these commodities can also "
716 "optionally be specified. By default, the top-up "
717 "inventory size is zero, and it is not used for "
718 "mixing. \\n\\n[1] Baker, A. R., and R. W. Ross. "
719 "\\\"Comparison of the value of plutonium and "
720 "uranium isotopes in fast reactors.\\\" Proceedings "
721 "of the Conference on Breeding. Economics, and "
722 "Safety in Large Fast Power Reactors. 1963.\"}", root);
723 if (!parsed_ok) {
724 throw cyclus::ValueError("failed to parse annotations for cycamore::FuelFab.");
725 }
726 return root;
727 };
728
729 virtual void InitInv(cyclus::Inventories& inv) {
730 fill.Push(inv["fill"]);
731 fiss.Push(inv["fiss"]);
732 topup.Push(inv["topup"]);
733
734 };
735
736 virtual cyclus::Inventories SnapshotInv() {
737 cyclus::Inventories invs;
738 invs["fill"] = fill.PopNRes(fill.count());
739 fill.Push(invs["fill"]);
740 invs["fiss"] = fiss.PopNRes(fiss.count());
741 fiss.Push(invs["fiss"]);
742 invs["topup"] = topup.PopNRes(topup.count());
743 topup.Push(invs["topup"]);
744 return invs;
745 };
746
747 virtual void Snapshot(cyclus::DbInit di) {
748 di.NewDatum("Info")
749 ->AddVal("latitude", latitude, &cycpp_shape_latitude)
750 ->AddVal("longitude", longitude, &cycpp_shape_longitude)
751 ->AddVal("fill_commods", fill_commods, &cycpp_shape_fill_commods)
752 ->AddVal("fill_commod_prefs", fill_commod_prefs, &cycpp_shape_fill_commod_prefs)
753 ->AddVal("fill_recipe", fill_recipe, &cycpp_shape_fill_recipe)
754 ->AddVal("fill_size", fill_size, &cycpp_shape_fill_size)
755 ->AddVal("fiss_commods", fiss_commods, &cycpp_shape_fiss_commods)
756 ->AddVal("fiss_commod_prefs", fiss_commod_prefs, &cycpp_shape_fiss_commod_prefs)
757 ->AddVal("fiss_recipe", fiss_recipe, &cycpp_shape_fiss_recipe)
758 ->AddVal("fiss_size", fiss_size, &cycpp_shape_fiss_size)
759 ->AddVal("topup_commod", topup_commod, &cycpp_shape_topup_commod)
760 ->AddVal("topup_pref", topup_pref, &cycpp_shape_topup_pref)
761 ->AddVal("topup_recipe", topup_recipe, &cycpp_shape_topup_recipe)
762 ->AddVal("topup_size", topup_size, &cycpp_shape_topup_size)
763 ->AddVal("outcommod", outcommod, &cycpp_shape_outcommod)
764 ->AddVal("throughput", throughput, &cycpp_shape_throughput)
765 ->AddVal("spectrum", spectrum, &cycpp_shape_spectrum)
766 ->Record();
767 };
768#line 117 "/cycamore/src/fuel_fab.h"
770 virtual void Tick(){};
771 virtual void Tock(){};
772 virtual void EnterNotify();
773
774 virtual std::set<cyclus::BidPortfolio<cyclus::Material>::Ptr> GetMatlBids(
775 cyclus::CommodMap<cyclus::Material>::type& commod_requests);
776
777 virtual void GetMatlTrades(
778 const std::vector<cyclus::Trade<cyclus::Material> >& trades,
779 std::vector<std::pair<cyclus::Trade<cyclus::Material>,
780 cyclus::Material::Ptr> >& responses);
781
782 virtual void AcceptMatlTrades(const std::vector<std::pair<
783 cyclus::Trade<cyclus::Material>, cyclus::Material::Ptr> >& responses);
784
785 virtual std::set<cyclus::RequestPortfolio<cyclus::Material>::Ptr>
787
788 private:
789 // Code Injection:
790 #include "toolkit/position.cycpp.h"
791
792 #pragma cyclus var { "doc": "Ordered list of commodities on which to requesting filler stream material.", "uilabel": "Filler Stream Commodities", "uitype": ["oneormore", "incommodity"], }
793#line 145 "/cycamore/src/fuel_fab.h"
794 std::vector<std::string> fill_commods;
795 std::vector<int> cycpp_shape_fill_commods;
796#line 146 "/cycamore/src/fuel_fab.h"
797
798
799 #pragma cyclus var { "default": [], "uilabel": "Filler Stream Preferences", "doc": "Filler stream commodity request preferences for each of the given filler commodities (same order)." " If unspecified, default is to use 1.0 for all preferences.", }
800#line 153 "/cycamore/src/fuel_fab.h"
801 std::vector<double> fill_commod_prefs;
802 std::vector<int> cycpp_shape_fill_commod_prefs;
803#line 154 "/cycamore/src/fuel_fab.h"
804
805
806 #pragma cyclus var { "doc": "Name of recipe to be used in filler material stream requests.", "uilabel": "Filler Stream Recipe", "uitype": "inrecipe", }
807#line 160 "/cycamore/src/fuel_fab.h"
808 std::string fill_recipe;
809 std::vector<int> cycpp_shape_fill_recipe;
810#line 161 "/cycamore/src/fuel_fab.h"
811
812
813 #pragma cyclus var { "doc": "Size of filler material stream inventory.", "uilabel": "Filler Stream Inventory Capacity", "units": "kg", }
814#line 167 "/cycamore/src/fuel_fab.h"
815 double fill_size;
816 std::vector<int> cycpp_shape_fill_size;
817
818#line 168 "/cycamore/src/fuel_fab.h"
820 #pragma cyclus var {"capacity": "fill_size"}
821 cyclus::toolkit::ResBuf<cyclus::Material> fill;
822 std::vector<int> cycpp_shape_fill;
823#line 171 "/cycamore/src/fuel_fab.h"
824
825
826 #pragma cyclus var { "doc": "Ordered list of commodities on which to requesting fissile stream material.", "uilabel": "Fissile Stream Commodities", "uitype": ["oneormore", "incommodity"], }
827#line 177 "/cycamore/src/fuel_fab.h"
828 std::vector<std::string> fiss_commods;
829 std::vector<int> cycpp_shape_fiss_commods;
830#line 178 "/cycamore/src/fuel_fab.h"
831
832
833 #pragma cyclus var { "default": [], "uilabel": "Fissile Stream Preferences", "doc": "Fissile stream commodity request preferences for each of the given fissile commodities (same order)." " If unspecified, default is to use 1.0 for all preferences.", }
834#line 185 "/cycamore/src/fuel_fab.h"
835 std::vector<double> fiss_commod_prefs;
836 std::vector<int> cycpp_shape_fiss_commod_prefs;
837#line 186 "/cycamore/src/fuel_fab.h"
838
839
840 #pragma cyclus var { "doc": "Name for recipe to be used in fissile stream requests." " Empty string results in use of an empty dummy recipe.", "uitype": "inrecipe", "uilabel": "Fissile Stream Recipe", "default": "", }
841#line 194 "/cycamore/src/fuel_fab.h"
842 std::string fiss_recipe;
843 std::vector<int> cycpp_shape_fiss_recipe;
844#line 195 "/cycamore/src/fuel_fab.h"
845
846
847 #pragma cyclus var { "doc": "Size of fissile material stream inventory.", "uilabel": "Fissile Stream Inventory Capacity", "units": "kg", }
848#line 201 "/cycamore/src/fuel_fab.h"
849 double fiss_size;
850 std::vector<int> cycpp_shape_fiss_size;
851
852#line 202 "/cycamore/src/fuel_fab.h"
854 #pragma cyclus var {"capacity": "fiss_size"}
855 cyclus::toolkit::ResBuf<cyclus::Material> fiss;
856 std::vector<int> cycpp_shape_fiss;
857#line 205 "/cycamore/src/fuel_fab.h"
858
859
860 #pragma cyclus var { "doc": "Commodity on which to request material for top-up stream." " This MUST be set if 'topup_size > 0'.", "uilabel": "Top-up Stream Commodity", "default": "", "uitype": "incommodity", }
861#line 213 "/cycamore/src/fuel_fab.h"
862 std::string topup_commod;
863 std::vector<int> cycpp_shape_topup_commod;
864#line 214 "/cycamore/src/fuel_fab.h"
865
866#line 221 "/cycamore/src/fuel_fab.h"
868 #pragma cyclus var { "doc": "Top-up material stream request preference.", "uilabel": "Top-up Stream Preference", "default": 1.0, }
869 double topup_pref;
870 std::vector<int> cycpp_shape_topup_pref;
871 // default must be in range (0, cyclus::kDefaultPref)
872
873 #pragma cyclus var { "doc": "Name of recipe to be used in top-up material stream requests." " This MUST be set if 'topup_size > 0'.", "uilabel": "Top-up Stream Recipe", "uitype": "inrecipe", "default": "", }
874#line 229 "/cycamore/src/fuel_fab.h"
875 std::string topup_recipe;
876 std::vector<int> cycpp_shape_topup_recipe;
877#line 230 "/cycamore/src/fuel_fab.h"
878
879
880 #pragma cyclus var { "doc": "Size of top-up material stream inventory.", "uilabel": "Top-up Stream Inventory Capacity", "units": "kg", "default": 0, }
881#line 237 "/cycamore/src/fuel_fab.h"
882 double topup_size;
883 std::vector<int> cycpp_shape_topup_size;
884
885#line 238 "/cycamore/src/fuel_fab.h"
887 #pragma cyclus var {"capacity": "topup_size"}
888 cyclus::toolkit::ResBuf<cyclus::Material> topup;
889 std::vector<int> cycpp_shape_topup;
890#line 241 "/cycamore/src/fuel_fab.h"
891
892
893 #pragma cyclus var { "doc": "Commodity on which to offer/supply mixed fuel material.", "uilabel": "Output Commodity", "uitype": "outcommodity", }
894#line 247 "/cycamore/src/fuel_fab.h"
895 std::string outcommod;
896 std::vector<int> cycpp_shape_outcommod;
897#line 248 "/cycamore/src/fuel_fab.h"
898
899
900 #pragma cyclus var { "doc": "Maximum number of kg of fuel material that can be supplied per time step.", "uilabel": "Maximum Throughput", "units": "kg", "default": CY_LARGE_DOUBLE, "uitype": "range", "range": [0.0, CY_LARGE_DOUBLE], }
901#line 257 "/cycamore/src/fuel_fab.h"
902 double throughput;
903 std::vector<int> cycpp_shape_throughput;
904#line 258 "/cycamore/src/fuel_fab.h"
905
906
907 #pragma cyclus var { "uilabel": "Spectrum type", "uitype": "combobox", "categorical": ["fission_spectrum_ave", "thermal"], "doc": "The type of cross-sections to use for composition property calculation." " Use 'fission_spectrum_ave' for fast reactor compositions or 'thermal' for thermal reactors.", }
908#line 266 "/cycamore/src/fuel_fab.h"
909 std::string spectrum;
910 std::vector<int> cycpp_shape_spectrum;
911
912#line 267 "/cycamore/src/fuel_fab.h"
913
914 // intra-time-step state - no need to be a state var
915 // map<request, inventory name>
916 std::map<cyclus::Request<cyclus::Material>*, std::string> req_inventories_;
917
919
920double CosiWeight(cyclus::Composition::Ptr c, const std::string& spectrum);
921bool ValidWeights(double w_low, double w_tgt, double w_high);
922double LowFrac(double w_low, double w_tgt, double w_high, double eps = cyclus::CY_NEAR_ZERO);
923double HighFrac(double w_low, double w_tgt, double w_high, double eps = cyclus::CY_NEAR_ZERO);
924double AtomToMassFrac(double atomfrac, cyclus::Composition::Ptr c1, cyclus::Composition::Ptr c2);
925
926} // namespace cycamore
927
928
929#endif // CYCAMORE_SRC_FUEL_FAB_H_
#define CYCAMORE_VERSION
FuelFab takes in 2 streams of material and mixes them in ratios in order to supply material that matc...
std::vector< int > cycpp_shape_topup_commod
FuelFab(cyclus::Context *ctx)
std::vector< int > cycpp_shape_fill_commod_prefs
std::vector< int > cycpp_shape_fill_recipe
virtual void AcceptMatlTrades(const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
cyclus::toolkit::ResBuf< cyclus::Material > fill
std::vector< int > cycpp_shape_outcommod
virtual void InfileToDb(cyclus::InfileTree *tree, cyclus::DbInit di)
std::vector< int > cycpp_shape_fiss_commod_prefs
std::vector< int > cycpp_shape_fill_commods
std::vector< int > cycpp_shape_fill
virtual void Snapshot(cyclus::DbInit di)
std::vector< int > cycpp_shape_fiss_size
virtual cyclus::Agent * Clone()
std::vector< int > cycpp_shape_fill_size
std::map< cyclus::Request< cyclus::Material > *, std::string > req_inventories_
virtual void GetMatlTrades(const std::vector< cyclus::Trade< cyclus::Material > > &trades, std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
virtual std::set< cyclus::RequestPortfolio< cyclus::Material >::Ptr > GetMatlRequests()
virtual void InitFrom(cycamore::FuelFab *m)
std::vector< double > fill_commod_prefs
std::vector< int > cycpp_shape_throughput
std::vector< int > cycpp_shape_topup
virtual Json::Value annotations()
virtual std::string schema()
virtual std::set< cyclus::BidPortfolio< cyclus::Material >::Ptr > GetMatlBids(cyclus::CommodMap< cyclus::Material >::type &commod_requests)
cyclus::toolkit::ResBuf< cyclus::Material > topup
virtual cyclus::Inventories SnapshotInv()
std::vector< int > cycpp_shape_fiss_commods
std::vector< int > cycpp_shape_spectrum
cyclus::toolkit::ResBuf< cyclus::Material > fiss
std::vector< int > cycpp_shape_topup_pref
virtual void InitInv(cyclus::Inventories &inv)
std::vector< std::string > fiss_commods
std::vector< std::string > fill_commods
std::vector< int > cycpp_shape_topup_size
std::vector< int > cycpp_shape_topup_recipe
std::vector< int > cycpp_shape_fiss
std::vector< double > fiss_commod_prefs
virtual std::string version()
std::vector< int > cycpp_shape_fiss_recipe
double HighFrac(double w_low, double w_target, double w_high, double eps)
double CosiWeight(Composition::Ptr c, const std::string &spectrum)
bool ValidWeights(double w_low, double w_target, double w_high)
double AtomToMassFrac(double atomfrac, Composition::Ptr c1, Composition::Ptr c2)
double LowFrac(double w_low, double w_target, double w_high, double eps)