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