1 #ifndef CYCAMORE_SRC_FUEL_FAB_H_ 2 #define CYCAMORE_SRC_FUEL_FAB_H_ 57 :
public cyclus::Facility,
58 public cyclus::toolkit::Position {
59 #pragma cyclus note { \ 60 "niche": "fabrication", \ 62 "FuelFab takes in 2 streams of material and mixes them in ratios in order to" \ 63 " supply material that matches some neutronics properties of reqeusted" \ 64 " material. It uses an equivalence type method [1]" \ 65 " inspired by a similar approach in the COSI fuel cycle simulator." \ 67 "The FuelFab has 3 input inventories: fissile stream, filler stream, and an" \ 68 " optional top-up inventory. All materials received into each inventory are" \ 69 " always combined into a single material (i.e. a single fissile material, a" \ 70 " single filler material, etc.). The input streams and requested fuel" \ 71 " composition are each assigned weights based on summing:" \ 73 " N * (p_i - p_U238) / (p_Pu239 - p_U238)" \ 75 "for each nuclide where:" \ 77 "\n - p = nu*sigma_f - sigma_a for the nuclide" \ 78 "\n - p_U238 is p for pure U238" \ 79 "\n - p_Pu239 is p for pure Pu239" \ 80 "\n - N is the nuclide's atom fraction" \ 81 "\n - nu is the average # neutrons per fission" \ 82 "\n - sigma_f is the microscopic fission cross-section" \ 83 "\n - sigma_a is the microscopic neutron absorption cross-section" \ 85 "The cross sections are from the simple cross section library in PyNE. They" \ 86 " can be set to either a thermal or fast neutron spectrum. A linear" \ 87 " interpolation is performed using the weights of the fissile, filler, and" \ 88 " target streams. The interpolation is used to compute a mixing ratio of the" \ 89 " input streams that matches the target weight. In the event that the target" \ 90 " weight is higher than the fissile stream weight, the FuelFab will attempt" \ 91 " to use the top-up and fissile input streams together instead of the fissile" \ 92 " and filler streams. All supplied material will always have the same weight" \ 93 " as the requested material." \ 95 "The supplying of mixed material is constrained by available inventory" \ 96 " quantities and a per time step throughput limit. Requests for fuel" \ 97 " material larger than the throughput can never be met. Fissile inventory" \ 98 " can be requested/received via one or more commodities. The DRE request" \ 99 " preference for each of these commodities can also optionally be specified." \ 100 " By default, the top-up inventory size is zero, and it is not used for" \ 103 "[1] Baker, A. R., and R. W. Ross. \"Comparison of the value of plutonium and" \ 104 " uranium isotopes in fast reactors.\" Proceedings of the Conference on" \ 105 " Breeding. Economics, and Safety in Large Fast Power Reactors. 1963." \ 120 virtual std::set<cyclus::BidPortfolio<cyclus::Material>::Ptr>
GetMatlBids(
121 cyclus::CommodMap<cyclus::Material>::type& commod_requests);
124 const std::vector<cyclus::Trade<cyclus::Material> >& trades,
125 std::vector<std::pair<cyclus::Trade<cyclus::Material>,
126 cyclus::Material::Ptr> >& responses);
129 cyclus::Trade<cyclus::Material>, cyclus::Material::Ptr> >& responses);
131 virtual std::set<cyclus::RequestPortfolio<cyclus::Material>::Ptr>
135 #pragma cyclus var { \ 136 "doc": "Ordered list of commodities on which to requesting filler stream material.", \ 137 "uilabel": "Filler Stream Commodities", \ 138 "uitype": ["oneormore", "incommodity"], \ 141 #pragma cyclus var { \ 143 "uilabel": "Filler Stream Preferences", \ 144 "doc": "Filler stream commodity request preferences for each of the given filler commodities (same order)." \ 145 " If unspecified, default is to use 1.0 for all preferences.", \ 148 #pragma cyclus var { \ 149 "doc": "Name of recipe to be used in filler material stream requests.", \ 150 "uilabel": "Filler Stream Recipe", \ 151 "uitype": "inrecipe", \ 154 #pragma cyclus var { \ 155 "doc": "Size of filler material stream inventory.", \ 156 "uilabel": "Filler Stream Inventory Capacity", \ 160 #pragma cyclus var {"capacity": "fill_size"} 161 cyclus::toolkit::ResBuf<cyclus::Material>
fill;
163 #pragma cyclus var { \ 164 "doc": "Ordered list of commodities on which to requesting fissile stream material.", \ 165 "uilabel": "Fissile Stream Commodities", \ 166 "uitype": ["oneormore", "incommodity"], \ 169 #pragma cyclus var { \ 171 "uilabel": "Fissile Stream Preferences", \ 172 "doc": "Fissile stream commodity request preferences for each of the given fissile commodities (same order)." \ 173 " If unspecified, default is to use 1.0 for all preferences.", \ 176 #pragma cyclus var { \ 177 "doc": "Name for recipe to be used in fissile stream requests." \ 178 " Empty string results in use of an empty dummy recipe.", \ 179 "uitype": "inrecipe", \ 180 "uilabel": "Fissile Stream Recipe", \ 184 #pragma cyclus var { \ 185 "doc": "Size of fissile material stream inventory.", \ 186 "uilabel": "Fissile Stream Inventory Capacity", \ 190 #pragma cyclus var {"capacity": "fiss_size"} 191 cyclus::toolkit::ResBuf<cyclus::Material>
fiss;
193 #pragma cyclus var { \ 194 "doc": "Commodity on which to request material for top-up stream." \ 195 " This MUST be set if 'topup_size > 0'.", \ 196 "uilabel": "Top-up Stream Commodity", \ 198 "uitype": "incommodity", \ 201 #pragma cyclus var { \ 202 "doc": "Top-up material stream request preference.", \ 203 "uilabel": "Top-up Stream Preference", \ 208 #pragma cyclus var { \ 209 "doc": "Name of recipe to be used in top-up material stream requests." \ 210 " This MUST be set if 'topup_size > 0'.", \ 211 "uilabel": "Top-up Stream Recipe", \ 212 "uitype": "inrecipe", \ 216 #pragma cyclus var { \ 217 "doc": "Size of top-up material stream inventory.", \ 218 "uilabel": "Top-up Stream Inventory Capacity", \ 223 #pragma cyclus var {"capacity": "topup_size"} 224 cyclus::toolkit::ResBuf<cyclus::Material>
topup;
226 #pragma cyclus var { \ 227 "doc": "Commodity on which to offer/supply mixed fuel material.", \ 228 "uilabel": "Output Commodity", \ 229 "uitype": "outcommodity", \ 233 #pragma cyclus var { \ 234 "doc": "Maximum number of kg of fuel material that can be supplied per time step.", \ 235 "uilabel": "Maximum Throughput", \ 239 "range": [0.0, 1e299], \ 243 #pragma cyclus var { \ 244 "uilabel": "Spectrum type", \ 245 "uitype": "combobox", \ 246 "categorical": ["fission_spectrum_ave", "thermal"], \ 247 "doc": "The type of cross-sections to use for composition property calculation." \ 248 " Use 'fission_spectrum_ave' for fast reactor compositions or 'thermal' for thermal reactors.", \ 256 #pragma cyclus var { \ 258 "uilabel": "Geographical latitude in degrees as a double", \ 259 "doc": "Latitude of the agent's geographical position. The value should " \ 260 "be expressed in degrees as a double." \ 264 #pragma cyclus var { \ 266 "uilabel": "Geographical longitude in degrees as a double", \ 267 "doc": "Longitude of the agent's geographical position. The value should " \ 268 "be expressed in degrees as a double." \ 279 bool ValidWeights(
double w_low,
double w_tgt,
double w_high);
280 double LowFrac(
double w_low,
double w_tgt,
double w_high,
double eps = 1e-6);
281 double HighFrac(
double w_low,
double w_tgt,
double w_high,
double eps = 1e-6);
282 double AtomToMassFrac(
double atomfrac, cyclus::Composition::Ptr c1, cyclus::Composition::Ptr c2);
287 #endif // CYCAMORE_SRC_FUEL_FAB_H_
std::vector< double > fill_commod_prefs
cyclus::toolkit::ResBuf< cyclus::Material > fill
double HighFrac(double w_low, double w_target, double w_high, double eps)
cyclus::toolkit::ResBuf< cyclus::Material > topup
virtual std::string version()
double AtomToMassFrac(double atomfrac, Composition::Ptr c1, Composition::Ptr c2)
double CosiWeight(cyclus::Composition::Ptr c, const std::string &spectrum)
std::map< cyclus::Request< cyclus::Material > *, std::string > req_inventories_
std::vector< std::string > fill_commods
cycamore::GrowthRegion string
std::vector< double > fiss_commod_prefs
virtual void AcceptMatlTrades(const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
FuelFab(cyclus::Context *ctx)
virtual void GetMatlTrades(const std::vector< cyclus::Trade< cyclus::Material > > &trades, std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
virtual void EnterNotify()
void RecordPosition()
Records an agent's latitude and longitude to the output db.
std::vector< std::string > fiss_commods
bool ValidWeights(double w_low, double w_target, double w_high)
cyclus::toolkit::ResBuf< cyclus::Material > fiss
virtual std::set< cyclus::RequestPortfolio< cyclus::Material >::Ptr > GetMatlRequests()
cyclus::toolkit::Position coordinates
double LowFrac(double w_low, double w_target, double w_high, double eps)
virtual std::set< cyclus::BidPortfolio< cyclus::Material >::Ptr > GetMatlBids(cyclus::CommodMap< cyclus::Material >::type &commod_requests)