2#line 1 "/cycamore/src/reactor.h"
3#ifndef CYCAMORE_SRC_REACTOR_H_
4#define CYCAMORE_SRC_REACTOR_H_
58 public cyclus::toolkit::CommodityProducer,
59 public cyclus::toolkit::Position {
60#pragma cyclus note { "niche": "reactor", "doc": "Reactor is a simple, general reactor based on static compositional" " transformations to model fuel burnup. The user specifies a set of input" " fuels and corresponding burnt compositions that fuel is transformed to when" " it is discharged from the core. No incremental transmutation takes place." " Rather, at the end of an operational cycle, the batch being discharged from" " the core is instantaneously transmuted from its original fresh fuel" " composition into its spent fuel form." "\n\n" "Each fuel is identified by a specific input commodity and has an associated" " input recipe (nuclide composition), output recipe, output commidity, and" " preference. The preference identifies which input fuels are preferred when" " requesting. Changes in these preferences can be specified as a function of" " time using the pref_change variables. Changes in the input-output recipe" " compositions can also be specified as a function of time using the" " recipe_change variables." "\n\n" "The reactor treats fuel as individual assemblies that are never split," " combined or otherwise treated in any non-discrete way. Fuel is requested" " in full-or-nothing assembly sized quanta. If real-world assembly modeling" " is unnecessary, parameters can be adjusted (e.g. n_assem_core, assem_size," " n_assem_batch). At the end of every cycle, a full batch is discharged from" " the core consisting of n_assem_batch assemblies of assem_size kg. The" " reactor also has a specifiable refueling time period following the end of" " each cycle at the end of which it will resume operation on the next cycle" " *if* it has enough fuel for a full core; otherwise it waits until it has" " enough fresh fuel assemblies." "\n\n" "In addition to its core, the reactor has an on-hand fresh fuel inventory" " and a spent fuel inventory whose capacities are specified by n_assem_fresh" " and n_assem_spent respectively. Each time step the reactor will attempt to" " acquire enough fresh fuel to fill its fresh fuel inventory (and its core if" " the core isn't currently full). If the fresh fuel inventory has zero" " capacity, fuel will be ordered just-in-time after the end of each" " operational cycle before the next begins. If the spent fuel inventory" " becomes full, the reactor will halt operation at the end of the next cycle" " until there is more room. Each time step, the reactor will try to trade" " away as much of its spent fuel inventory as possible." "\n\n" "When the reactor reaches the end of its lifetime, it will discharge all" " material from its core and trade away all its spent fuel as quickly as" " possible. Full decommissioning will be delayed until all spent fuel is" " gone. If the reactor has a full core when it is decommissioned (i.e. is" " mid-cycle) when the reactor is decommissioned, half (rounded up to nearest" " int) of its assemblies are transmuted to their respective burnt" " compositions." "", }
61#line 108 "/cycamore/src/reactor.h"
75 cyclus::Trade<cyclus::Material>, cyclus::Material::Ptr> >& responses);
77 virtual std::set<cyclus::RequestPortfolio<cyclus::Material>::Ptr>
80 virtual std::set<cyclus::BidPortfolio<cyclus::Material>::Ptr>
GetMatlBids(
81 cyclus::CommodMap<cyclus::Material>::type& commod_requests);
84 const std::vector<cyclus::Trade<cyclus::Material> >& trades,
85 std::vector<std::pair<cyclus::Trade<cyclus::Material>,
86 cyclus::Material::Ptr> >& responses);
88#line 133 "/cycamore/src/reactor.h"
90 virtual void InitFrom(cyclus::QueryableBackend* b);
92 virtual void InfileToDb(cyclus::InfileTree* tree, cyclus::DbInit di);
94 virtual cyclus::Agent*
Clone();
96 virtual std::string
schema();
100 virtual void InitInv(cyclus::Inventories& inv);
104 virtual void Snapshot(cyclus::DbInit di);
105#line 135 "/cycamore/src/reactor.h"
109 #include "toolkit/position.cycpp.h"
118 return exit_time() != -1 && context()->time() > exit_time();
122 void index_res(cyclus::Resource::Ptr m, std::string incommod);
143 void Record(std::string name, std::string val);
147 void PushSpent(std::map<std::string, cyclus::toolkit::MatVec> leftover);
151 std::map<std::string, cyclus::toolkit::MatVec>
PopSpent();
155 std::map<std::string, cyclus::toolkit::MatVec>
PeekSpent();
158 #pragma cyclus var { "uitype": ["oneormore", "incommodity"], "uilabel": "Fresh Fuel Commodity List", "doc": "Ordered list of input commodities on which to requesting fuel.", }
159#line 192 "/cycamore/src/reactor.h"
162#line 193 "/cycamore/src/reactor.h"
165 #pragma cyclus var { "uitype": ["oneormore", "inrecipe"], "uilabel": "Fresh Fuel Recipe List", "doc": "Fresh fuel recipes to request for each of the given fuel input " "commodities (same order).", }
166#line 200 "/cycamore/src/reactor.h"
169#line 201 "/cycamore/src/reactor.h"
172 #pragma cyclus var { "default": [], "uilabel": "Fresh Fuel Preference List", "doc": "The preference for each type of fresh fuel requested corresponding" " to each input commodity (same order). If no preferences are " "specified, 1.0 is used for all fuel " "requests (default).", }
173#line 210 "/cycamore/src/reactor.h"
176#line 211 "/cycamore/src/reactor.h"
179 #pragma cyclus var { "uitype": ["oneormore", "outcommodity"], "uilabel": "Spent Fuel Commodity List", "doc": "Output commodities on which to offer spent fuel originally " "received as each particular input commodity (same order)." }
180#line 218 "/cycamore/src/reactor.h"
183#line 219 "/cycamore/src/reactor.h"
186 #pragma cyclus var { "uitype": ["oneormore", "outrecipe"], "uilabel": "Spent Fuel Recipe List", "doc": "Spent fuel recipes corresponding to the given fuel input " "commodities (same order)." " Fuel received via a particular input commodity is transmuted to " "the recipe specified here after being burned during a cycle.", }
187#line 228 "/cycamore/src/reactor.h"
191#line 229 "/cycamore/src/reactor.h"
194 #pragma cyclus var { "default": [], "uilabel": "Time to Change Fresh/Spent Fuel Recipe", "doc": "A time step on which to change the input-output recipe pair for " "a requested fresh fuel.", }
195#line 237 "/cycamore/src/reactor.h"
198#line 238 "/cycamore/src/reactor.h"
201 #pragma cyclus var { "default": [], "uilabel": "Commodity for Changed Fresh/Spent Fuel Recipe", "doc": "The input commodity indicating fresh fuel for which recipes will " "be changed. Same order as and direct correspondence to the " "specified recipe change times.", "uitype": ["oneormore", "incommodity"], }
202#line 247 "/cycamore/src/reactor.h"
205#line 248 "/cycamore/src/reactor.h"
208 #pragma cyclus var { "default": [], "uilabel": "New Recipe for Fresh Fuel", "doc": "The new input recipe to use for this recipe change." " Same order as and direct correspondence to the specified recipe " "change times.", "uitype": ["oneormore", "inrecipe"], }
209#line 257 "/cycamore/src/reactor.h"
212#line 258 "/cycamore/src/reactor.h"
215 #pragma cyclus var { "default": [], "uilabel": "New Recipe for Spent Fuel", "doc": "The new output recipe to use for this recipe change." " Same order as and direct correspondence to the specified recipe " "change times.", "uitype": ["oneormore", "outrecipe"], }
216#line 267 "/cycamore/src/reactor.h"
220#line 268 "/cycamore/src/reactor.h"
223 #pragma cyclus var { "doc": "Mass (kg) of a single assembly.", "uilabel": "Assembly Mass", "uitype": "range", "range": [1.0, 1e5], "units": "kg", }
224#line 277 "/cycamore/src/reactor.h"
227#line 278 "/cycamore/src/reactor.h"
230 #pragma cyclus var { "uilabel": "Number of Assemblies per Batch", "doc": "Number of assemblies that constitute a single batch. " "This is the number of assemblies discharged from the core fully " "burned each cycle." "Batch size is equivalent to ``n_assem_batch / n_assem_core``.", }
231#line 286 "/cycamore/src/reactor.h"
234#line 287 "/cycamore/src/reactor.h"
237 #pragma cyclus var { "default": 3, "uilabel": "Number of Assemblies in Core", "uitype": "range", "range": [1,3], "doc": "Number of assemblies that constitute a full core.", }
238#line 295 "/cycamore/src/reactor.h"
241#line 296 "/cycamore/src/reactor.h"
244 #pragma cyclus var { "default": 0, "uilabel": "Minimum Fresh Fuel Inventory", "uitype": "range", "range": [0,3], "units": "assemblies", "doc": "Number of fresh fuel assemblies to keep on-hand if possible.", }
245#line 305 "/cycamore/src/reactor.h"
248#line 306 "/cycamore/src/reactor.h"
251 #pragma cyclus var { "default": 1000000000, "uilabel": "Maximum Spent Fuel Inventory", "uitype": "range", "range": [0, 1000000000], "units": "assemblies", "doc": "Number of spent fuel assemblies that can be stored on-site before" " reactor operation stalls.", }
252#line 316 "/cycamore/src/reactor.h"
256#line 317 "/cycamore/src/reactor.h"
259 #pragma cyclus var { "default": 18, "doc": "The duration of a full operational cycle (excluding refueling " "time) in time steps.", "uilabel": "Cycle Length", "units": "time steps", }
260#line 326 "/cycamore/src/reactor.h"
263#line 327 "/cycamore/src/reactor.h"
266 #pragma cyclus var { "default": 1, "doc": "The duration of a full refueling period - the minimum time between" " the end of a cycle and the start of the next cycle.", "uilabel": "Refueling Outage Duration", "units": "time steps", }
267#line 335 "/cycamore/src/reactor.h"
270#line 336 "/cycamore/src/reactor.h"
273 #pragma cyclus var { "default": 0, "doc": "Number of time steps since the start of the last cycle." " Only set this if you know what you are doing", "uilabel": "Time Since Start of Last Cycle", "units": "time steps", }
274#line 344 "/cycamore/src/reactor.h"
278#line 345 "/cycamore/src/reactor.h"
281 #pragma cyclus var { "default": 0, "doc": "Amount of electrical power the facility produces when operating " "normally.", "uilabel": "Nominal Reactor Power", "uitype": "range", "range": [0.0, 2000.00], "units": "MWe", }
282#line 356 "/cycamore/src/reactor.h"
285#line 357 "/cycamore/src/reactor.h"
288 #pragma cyclus var { "default": "power", "uilabel": "Power Commodity Name", "doc": "The name of the 'power' commodity used in conjunction with a " "deployment curve.", }
289#line 364 "/cycamore/src/reactor.h"
293#line 365 "/cycamore/src/reactor.h"
297 #pragma cyclus var { "uilabel": "Side Product from Reactor Plant", "default": [], "doc": "Ordered vector of side product the reactor produces with power", }
298#line 373 "/cycamore/src/reactor.h"
301#line 374 "/cycamore/src/reactor.h"
304 #pragma cyclus var { "uilabel": "Quantity of Side Product from Reactor Plant", "default": [], "doc": "Ordered vector of the quantity of side product the reactor produces with power", }
305#line 380 "/cycamore/src/reactor.h"
308#line 381 "/cycamore/src/reactor.h"
311 #pragma cyclus var {"default": 1, "internal": True, "doc": "True if reactor is a hybrid system (produces side products)", }
312#line 386 "/cycamore/src/reactor.h"
316#line 387 "/cycamore/src/reactor.h"
320 #pragma cyclus var {"default": 0, "uilabel": "Boolean for transmutation behavior upon decommissioning.", "doc": "If true, the archetype transmutes all assemblies upon decommissioning " "If false, the archetype only transmutes half.", }
321#line 395 "/cycamore/src/reactor.h"
325#line 396 "/cycamore/src/reactor.h"
329 #pragma cyclus var { "default": [], "uilabel": "Time to Change Fresh Fuel Preference", "doc": "A time step on which to change the request preference for a " "particular fresh fuel type.", }
330#line 405 "/cycamore/src/reactor.h"
333#line 406 "/cycamore/src/reactor.h"
336 #pragma cyclus var { "default": [], "doc": "The input commodity for a particular fuel preference change. " "Same order as and direct correspondence to the specified " "preference change times.", "uilabel": "Commodity for Changed Fresh Fuel Preference", "uitype": ["oneormore", "incommodity"], }
337#line 415 "/cycamore/src/reactor.h"
340#line 416 "/cycamore/src/reactor.h"
343 #pragma cyclus var { "default": [], "uilabel": "Changed Fresh Fuel Preference", "doc": "The new/changed request preference for a particular fresh fuel." " Same order as and direct correspondence to the specified " "preference change times.", }
344#line 424 "/cycamore/src/reactor.h"
347#line 425 "/cycamore/src/reactor.h"
350 #pragma cyclus var { "default": True, "tooltip": "Whether to persist packaging throughout the reactor", "doc": "Boolean value about whether to keep packaging. If true, " "packaging will not be stripped upon acceptance into the " "reactor. If false, package type will be stripped immediately " "upon acceptance. Has no effect if the incoming material is not " "packaged.", "uilabel": "Keep Packaging", "uitype": "bool"}
351#line 436 "/cycamore/src/reactor.h"
355#line 437 "/cycamore/src/reactor.h"
359 #pragma cyclus var {"capacity": "n_assem_fresh * assem_size"}
360 cyclus::toolkit::ResBuf<cyclus::Material>
fresh;
363#line 442 "/cycamore/src/reactor.h"
364 #pragma cyclus var {"capacity": "n_assem_core * assem_size"}
365 cyclus::toolkit::ResBuf<cyclus::Material>
core;
368#line 444 "/cycamore/src/reactor.h"
369 #pragma cyclus var {"capacity": "n_assem_spent * assem_size"}
370 cyclus::toolkit::ResBuf<cyclus::Material>
spent;
373#line 446 "/cycamore/src/reactor.h"
378 #pragma cyclus var {"default": 0, "doc": "This should NEVER be set manually", "internal": True }
379#line 453 "/cycamore/src/reactor.h"
383#line 454 "/cycamore/src/reactor.h"
387 #pragma cyclus var {"default": {}, "doc": "This should NEVER be set manually", "internal": True }
388#line 460 "/cycamore/src/reactor.h"
392#line 461 "/cycamore/src/reactor.h"
Reactor is a simple, general reactor based on static compositional transformations to model fuel burn...
std::string fuel_incommod(cyclus::Material::Ptr m)
std::vector< int > cycpp_shape_discharged
std::vector< int > cycpp_shape_pref_change_times
std::vector< int > cycpp_shape_refuel_time
std::vector< double > side_product_quantity
std::vector< std::string > recipe_change_in
virtual void Snapshot(cyclus::DbInit di)
std::vector< int > recipe_change_times
std::vector< int > cycpp_shape_fuel_prefs
std::vector< int > cycpp_shape_res_indexes
std::vector< int > cycpp_shape_recipe_change_out
void index_res(cyclus::Resource::Ptr m, std::string incommod)
Store fuel info index for the given resource received on incommod.
virtual void InitInv(cyclus::Inventories &inv)
std::vector< std::string > side_products
std::map< std::string, cyclus::toolkit::MatVec > PopSpent()
Returns all spent assemblies indexed by outcommod - removing them from the spent fuel buffer.
virtual void InfileToDb(cyclus::InfileTree *tree, cyclus::DbInit di)
virtual Json::Value annotations()
void RecordSideProduct(bool produce)
Records production of side products from the reactor.
std::vector< int > cycpp_shape_fuel_outrecipes
std::vector< std::string > fuel_outrecipes
std::vector< std::string > pref_change_commods
virtual void GetMatlTrades(const std::vector< cyclus::Trade< cyclus::Material > > &trades, std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
std::vector< int > cycpp_shape_decom_transmute_all
std::vector< int > cycpp_shape_pref_change_commods
bool Discharge()
Discharge a batch from the core if there is room in the spent fuel inventory.
void Transmute()
Transmute the batch that is about to be discharged from the core to its fully burnt state as defined ...
virtual cyclus::Agent * Clone()
cyclus::toolkit::ResBuf< cyclus::Material > spent
std::vector< std::string > recipe_change_out
std::map< int, int > res_indexes
std::vector< int > cycpp_shape_fresh
std::vector< int > cycpp_shape_cycle_step
std::vector< int > cycpp_shape_hybrid_
std::vector< int > cycpp_shape_keep_packaging
std::vector< double > pref_change_values
void Record(std::string name, std::string val)
Records a reactor event to the output db with the given name and note val.
std::vector< int > cycpp_shape_spent
cyclus::toolkit::ResBuf< cyclus::Material > core
double fuel_pref(cyclus::Material::Ptr m)
virtual cyclus::Inventories SnapshotInv()
std::map< std::string, cyclus::toolkit::MatVec > PeekSpent()
Returns all spent assemblies indexed by outcommod without removing them from the spent fuel buffer.
std::string fuel_inrecipe(cyclus::Material::Ptr m)
std::vector< std::string > fuel_outcommods
std::vector< int > cycpp_shape_recipe_change_commods
std::vector< int > cycpp_shape_cycle_time
virtual void EnterNotify()
std::vector< int > cycpp_shape_recipe_change_times
virtual std::string version()
virtual void InitFrom(cycamore::Reactor *m)
std::vector< int > cycpp_shape_recipe_change_in
std::vector< int > cycpp_shape_side_products
virtual void AcceptMatlTrades(const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
std::vector< int > pref_change_times
std::string fuel_outcommod(cyclus::Material::Ptr m)
std::vector< int > cycpp_shape_n_assem_core
virtual std::set< cyclus::BidPortfolio< cyclus::Material >::Ptr > GetMatlBids(cyclus::CommodMap< cyclus::Material >::type &commod_requests)
std::vector< int > cycpp_shape_power_cap
virtual bool CheckDecommissionCondition()
std::vector< int > cycpp_shape_n_assem_fresh
std::vector< int > cycpp_shape_pref_change_values
std::vector< int > cycpp_shape_core
std::vector< int > cycpp_shape_n_assem_spent
std::vector< int > cycpp_shape_n_assem_batch
std::vector< int > cycpp_shape_fuel_outcommods
void Load()
Top up core inventory as much as possible.
std::string fuel_outrecipe(cyclus::Material::Ptr m)
std::vector< int > cycpp_shape_power_name
void PushSpent(std::map< std::string, cyclus::toolkit::MatVec > leftover)
Complement of PopSpent - must be called with all materials passed that were not traded away to other ...
std::vector< double > fuel_prefs
cyclus::toolkit::ResBuf< cyclus::Material > fresh
virtual std::string schema()
std::vector< int > cycpp_shape_fuel_inrecipes
std::set< std::string > uniq_outcommods_
std::vector< std::string > fuel_incommods
std::vector< int > cycpp_shape_assem_size
std::vector< std::string > fuel_inrecipes
virtual std::set< cyclus::RequestPortfolio< cyclus::Material >::Ptr > GetMatlRequests()
Reactor(cyclus::Context *ctx)
std::vector< int > cycpp_shape_fuel_incommods
std::vector< int > cycpp_shape_side_product_quantity
std::vector< std::string > recipe_change_commods