1 #ifndef CYCAMORE_SRC_ENRICHMENT_H_ 2 #define CYCAMORE_SRC_ENRICHMENT_H_ 15 class SWUConverter :
public cyclus::Converter<cyclus::Material> {
23 cyclus::Material::Ptr m,
24 cyclus::Arc
const * a = NULL,
25 cyclus::ExchangeTranslationContext<cyclus::Material>
26 const * ctx = NULL)
const {
27 cyclus::toolkit::Assays assays(
feed_, cyclus::toolkit::UraniumAssayMass(m),
29 return cyclus::toolkit::SwuRequired(m->quantity(), assays);
35 return cast != NULL &&
36 feed_ == cast->feed_ &&
49 class NatUConverter :
public cyclus::Converter<cyclus::Material> {
59 cyclus::Material::Ptr m,
60 cyclus::Arc
const * a = NULL,
61 cyclus::ExchangeTranslationContext<cyclus::Material>
62 const * ctx = NULL)
const {
63 cyclus::toolkit::Assays assays(
feed_, cyclus::toolkit::UraniumAssayMass(m),
65 cyclus::toolkit::MatQuery mq(m);
66 std::set<cyclus::Nuc> nucs;
67 nucs.insert(922350000);
68 nucs.insert(922380000);
70 double natu_frac = mq.mass_frac(nucs);
71 double natu_req = cyclus::toolkit::FeedQty(m->quantity(), assays);
72 return natu_req / natu_frac;
78 return cast != NULL &&
119 :
public cyclus::Facility,
120 public cyclus::toolkit::Position {
121 #pragma cyclus note { \ 122 "niche": "enrichment facility", \ 124 "The Enrichment facility is a simple agent that enriches natural " \ 125 "uranium in a Cyclus simulation. It does not explicitly compute " \ 126 "the physical enrichment process, rather it calculates the SWU " \ 127 "required to convert an source uranium recipe (i.e. natural uranium) " \ 128 "into a requested enriched recipe (i.e. 4% enriched uranium), given " \ 129 "the natural uranium inventory constraint and its SWU capacity " \ 132 "The Enrichment facility requests an input commodity and associated " \ 133 "recipe whose quantity is its remaining inventory capacity. All " \ 134 "facilities trading the same input commodity (even with different " \ 135 "recipes) will offer materials for trade. The Enrichment facility " \ 136 "accepts any input materials with enrichments less than its tails assay, "\ 137 "as long as some U235 is present, and preference increases with U235 " \ 138 "content. If no U235 is present in the offered material, the trade " \ 139 "preference is set to -1 and the material is not accepted. Any material " \ 140 "components other than U235 and U238 are sent directly to the tails buffer."\ 142 "The Enrichment facility will bid on any request for its output commodity "\ 143 "up to the maximum allowed enrichment (if not specified, default is 100%) "\ 144 "It bids on either the request quantity, or the maximum quanity allowed " \ 145 "by its SWU constraint or natural uranium inventory, whichever is lower. " \ 146 "If multiple output commodities with different enrichment levels are " \ 147 "requested and the facility does not have the SWU or quantity capacity " \ 148 "to meet all requests, the requests are fully, then partially filled " \ 149 "in unspecified but repeatable order." \ 151 "Accumulated tails inventory is offered for trading as a specifiable " \ 152 "output commodity.", \ 173 virtual void Build(cyclus::Agent* parent);
191 virtual std::set<cyclus::RequestPortfolio<cyclus::Material>::Ptr>
197 virtual void AdjustMatlPrefs(cyclus::PrefMap<cyclus::Material>::type& prefs);
201 virtual void AcceptMatlTrades(
202 const std::vector< std::pair<cyclus::Trade<cyclus::Material>,
203 cyclus::Material::Ptr> >& responses);
208 virtual std::set<cyclus::BidPortfolio<cyclus::Material>::Ptr>
209 GetMatlBids(cyclus::CommodMap<cyclus::Material>::type&
217 virtual void GetMatlTrades(
218 const std::vector< cyclus::Trade<cyclus::Material> >& trades,
219 std::vector<std::pair<cyclus::Trade<cyclus::Material>,
220 cyclus::Material::Ptr> >& responses);
227 bool ValidReq(
const cyclus::Material::Ptr mat);
230 max_feed_inventory = size;
231 inventory.capacity(size);
235 swu_capacity = capacity;
236 current_swu_capacity = swu_capacity;
241 inline const cyclus::toolkit::ResBuf<cyclus::Material>&
Tails()
const {
248 void AddMat_(cyclus::Material::Ptr mat);
252 cyclus::Material::Ptr Request_();
260 cyclus::Material::Ptr Offer_(cyclus::Material::Ptr req);
262 cyclus::Material::Ptr Enrich_(cyclus::Material::Ptr mat,
double qty);
268 void RecordEnrichment_(
double natural_u,
double swu);
273 #pragma cyclus var { \ 274 "tooltip": "feed commodity", \ 275 "doc": "feed commodity that the enrichment facility accepts", \ 276 "uilabel": "Feed Commodity", \ 277 "uitype": "incommodity" \ 281 #pragma cyclus var { \ 282 "tooltip": "feed recipe", \ 283 "doc": "recipe for enrichment facility feed commodity", \ 284 "uilabel": "Feed Recipe", \ 285 "uitype": "inrecipe" \ 289 #pragma cyclus var { \ 290 "tooltip": "product commodity", \ 291 "doc": "product commodity that the enrichment facility generates", \ 292 "uilabel": "Product Commodity", \ 293 "uitype": "outcommodity" \ 297 #pragma cyclus var { \ 298 "tooltip": "tails commodity", \ 299 "doc": "tails commodity supplied by enrichment facility", \ 300 "uilabel": "Tails Commodity", \ 301 "uitype": "outcommodity" \ 305 #pragma cyclus var { \ 306 "default": 0.003, "tooltip": "tails assay", \ 307 "uilabel": "Tails Assay", \ 309 "range": [0.0, 0.003], \ 310 "doc": "tails assay from the enrichment process", \ 314 #pragma cyclus var { \ 315 "default": 0, "tooltip": "initial uranium reserves (kg)", \ 316 "uilabel": "Initial Feed Inventory", \ 317 "doc": "amount of natural uranium stored at the enrichment " \ 318 "facility at the beginning of the simulation (kg)" \ 322 #pragma cyclus var { \ 323 "default": 1e299, "tooltip": "max inventory of feed material (kg)", \ 324 "uilabel": "Maximum Feed Inventory", \ 326 "range": [0.0, 1e299], \ 327 "doc": "maximum total inventory of natural uranium in " \ 328 "the enrichment facility (kg)" \ 330 double max_feed_inventory;
332 #pragma cyclus var { \ 334 "tooltip": "maximum allowed enrichment fraction", \ 335 "doc": "maximum allowed weight fraction of U235 in product", \ 336 "uilabel": "Maximum Allowed Enrichment", \ 338 "range": [0.0,1.0], \ 339 "schema": '<optional>' \ 340 ' <element name="max_enrich">' \ 341 ' <data type="double">' \ 342 ' <param name="minInclusive">0</param>' \ 343 ' <param name="maxInclusive">1</param>' \ 350 #pragma cyclus var { \ 353 "tooltip": "Rank Material Requests by U235 Content", \ 354 "uilabel": "Prefer feed with higher U235 content", \ 355 "doc": "turn on preference ordering for input material " \ 356 "so that EF chooses higher U235 content first" \ 360 #pragma cyclus var { \ 362 "tooltip": "SWU capacity (kgSWU/month)", \ 363 "uilabel": "SWU Capacity", \ 365 "range": [0.0, 1e299], \ 366 "doc": "separative work unit (SWU) capacity of enrichment " \ 367 "facility (kgSWU/timestep) " \ 371 double current_swu_capacity;
373 #pragma cyclus var { 'capacity': 'max_feed_inventory' } 374 cyclus::toolkit::ResBuf<cyclus::Material> inventory;
375 #pragma cyclus var {} 376 cyclus::toolkit::ResBuf<cyclus::Material> tails;
380 double intra_timestep_swu_;
381 double intra_timestep_feed_;
386 #pragma cyclus var { \ 388 "uilabel": "Geographical latitude in degrees as a double", \ 389 "doc": "Latitude of the agent's geographical position. The value should " \ 390 "be expressed in degrees as a double." \ 394 #pragma cyclus var { \ 396 "uilabel": "Geographical longitude in degrees as a double", \ 397 "doc": "Longitude of the agent's geographical position. The value should " \ 398 "be expressed in degrees as a double." \ 407 #endif // CYCAMORE_SRC_ENRICHMENT_FACILITY_H_
virtual bool operator==(Converter &other) const
void SetMaxInventorySize(double size)
SWUConverter(double feed_commod, double tails)
The NatUConverter is a simple Converter class for material to determine the amount of natural uranium...
const cyclus::toolkit::ResBuf< cyclus::Material > & Tails() const
cycamore::GrowthRegion string
void SwuCapacity(double capacity)
virtual double convert(cyclus::Material::Ptr m, cyclus::Arc const *a=NULL, cyclus::ExchangeTranslationContext< cyclus::Material > const *ctx=NULL) const
provides a conversion for the amount of natural Uranium required
virtual double convert(cyclus::Material::Ptr m, cyclus::Arc const *a=NULL, cyclus::ExchangeTranslationContext< cyclus::Material > const *ctx=NULL) const
provides a conversion for the SWU required
virtual bool operator==(Converter &other) const
NatUConverter(double feed_commod, double tails)
cyclus::toolkit::Position coordinates
virtual std::string version()
virtual std::string version()
The Enrichment facility is a simple Agent that enriches natural uranium in a Cyclus simulation...
void RecordPosition()
Records an agent's latitude and longitude to the output db.
double SwuCapacity() const
The SWUConverter is a simple Converter class for material to determine the amount of SWU required for...