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"
115 return exit_time() != -1 && context()->time() > exit_time();
119 void index_res(cyclus::Resource::Ptr m, std::string incommod);
140 void Record(std::string name, std::string val);
144 void PushSpent(std::map<std::string, cyclus::toolkit::MatVec> leftover);
148 std::map<std::string, cyclus::toolkit::MatVec>
PopSpent();
152 std::map<std::string, cyclus::toolkit::MatVec>
PeekSpent();
155 #pragma cyclus var { "uitype": ["oneormore", "incommodity"], "uilabel": "Fresh Fuel Commodity List", "doc": "Ordered list of input commodities on which to requesting fuel.", }
156#line 189 "/cycamore/src/reactor.h"
160 #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).", }
161#line 196 "/cycamore/src/reactor.h"
164#line 197 "/cycamore/src/reactor.h"
167 #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).", }
168#line 206 "/cycamore/src/reactor.h"
172 #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)." }
173#line 213 "/cycamore/src/reactor.h"
177 #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.", }
178#line 222 "/cycamore/src/reactor.h"
182#line 223 "/cycamore/src/reactor.h"
185 #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.", }
186#line 231 "/cycamore/src/reactor.h"
190 #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"], }
191#line 240 "/cycamore/src/reactor.h"
195 #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"], }
196#line 249 "/cycamore/src/reactor.h"
200 #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"], }
201#line 258 "/cycamore/src/reactor.h"
205#line 259 "/cycamore/src/reactor.h"
208 #pragma cyclus var { "doc": "Mass (kg) of a single assembly.", "uilabel": "Assembly Mass", "uitype": "range", "range": [1.0, 1e5], "units": "kg", }
209#line 268 "/cycamore/src/reactor.h"
212#line 269 "/cycamore/src/reactor.h"
215 #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``.", }
216#line 277 "/cycamore/src/reactor.h"
220 #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.", }
221#line 285 "/cycamore/src/reactor.h"
225 #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.", }
226#line 294 "/cycamore/src/reactor.h"
230 #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.", }
231#line 304 "/cycamore/src/reactor.h"
235#line 305 "/cycamore/src/reactor.h"
238 #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", }
239#line 314 "/cycamore/src/reactor.h"
243 #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", }
244#line 322 "/cycamore/src/reactor.h"
248 #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", }
249#line 330 "/cycamore/src/reactor.h"
253#line 331 "/cycamore/src/reactor.h"
256 #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", }
257#line 342 "/cycamore/src/reactor.h"
260#line 343 "/cycamore/src/reactor.h"
263 #pragma cyclus var { "default": "power", "uilabel": "Power Commodity Name", "doc": "The name of the 'power' commodity used in conjunction with a " "deployment curve.", }
264#line 350 "/cycamore/src/reactor.h"
268#line 351 "/cycamore/src/reactor.h"
272 #pragma cyclus var { "uilabel": "Side Product from Reactor Plant", "default": [], "doc": "Ordered vector of side product the reactor produces with power", }
273#line 359 "/cycamore/src/reactor.h"
276#line 360 "/cycamore/src/reactor.h"
279 #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", }
280#line 366 "/cycamore/src/reactor.h"
283#line 367 "/cycamore/src/reactor.h"
286 #pragma cyclus var {"default": 1, "internal": True, "doc": "True if reactor is a hybrid system (produces side products)", }
287#line 372 "/cycamore/src/reactor.h"
291#line 373 "/cycamore/src/reactor.h"
295 #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.", }
296#line 381 "/cycamore/src/reactor.h"
300#line 382 "/cycamore/src/reactor.h"
304 #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.", }
305#line 391 "/cycamore/src/reactor.h"
309 #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"], }
310#line 400 "/cycamore/src/reactor.h"
314 #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.", }
315#line 408 "/cycamore/src/reactor.h"
318#line 409 "/cycamore/src/reactor.h"
321 #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"}
322#line 420 "/cycamore/src/reactor.h"
326#line 421 "/cycamore/src/reactor.h"
330 #pragma cyclus var {"capacity": "n_assem_fresh * assem_size"}
331 cyclus::toolkit::ResBuf<cyclus::Material>
fresh;
334#line 426 "/cycamore/src/reactor.h"
335 #pragma cyclus var {"capacity": "n_assem_core * assem_size"}
336 cyclus::toolkit::ResBuf<cyclus::Material>
core;
339#line 428 "/cycamore/src/reactor.h"
340 #pragma cyclus var {"capacity": "n_assem_spent * assem_size"}
341 cyclus::toolkit::ResBuf<cyclus::Material>
spent;
344#line 430 "/cycamore/src/reactor.h"
349 #pragma cyclus var {"default": 0, "doc": "This should NEVER be set manually", "internal": True }
350#line 437 "/cycamore/src/reactor.h"
354#line 438 "/cycamore/src/reactor.h"
358 #pragma cyclus var {"default": {}, "doc": "This should NEVER be set manually", "internal": True }
359#line 444 "/cycamore/src/reactor.h"
363#line 445 "/cycamore/src/reactor.h"
368 #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." }
369#line 455 "/cycamore/src/reactor.h"
372#line 456 "/cycamore/src/reactor.h"
375 #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." }
376#line 463 "/cycamore/src/reactor.h"
380#line 464 "/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::vector< int > cycpp_shape_longitude
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::vector< int > cycpp_shape_latitude
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
void RecordPosition()
Records an agent's latitude and longitude to the output db.
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
cyclus::toolkit::Position coordinates
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