Modeling of a Fuel Fabrication Facility Using Python

Modeling of a Fuel Fabrication Facility Using Python and Sim. Py JD Doak, Safeguards Systems Group (N-4), Los Alamos National Laboratory Presented at LACSI 2004, 10/12/04

Introduction: Fuel Fabrication Facilities • • Powder preparation Pellet fabrication Fuel rod fabrication Assembly

Introduction: Powder Preparation

Introduction: Safeguards • Sigma-ID: essentially the amount of material the operator of the facility is unable to account for • ID (Inventory Difference): difference between outputs and inputs with adjustments for inventory changes • Sigma-ID: more specifically, the measurement error standard deviation of the ID

Introduction: Safeguards (cont. ) • Modeling and analysis used to design: – Measurements – Sub-MBA (Material Balance Area) structure – Frequency of balance closures

Introduction: Gloveboxes • The critical abstraction within the model • Sealed area within a facility where processing occurs • Minimizes contamination from by-products

Implementation Options • Considerations: – Design changes frequent – Clear and transparent models • Tried a commercial modeling tool – Not well-suited for rapidly making extensive changes to highly-detailed models – Difficult to extract model from “blocks” and “connections”

Implementation Options (cont. ) • Python/Sim. Py – Quickly make extensive changes – Implicit documentation on object model – Speed? • Data-driven model – Avoids type explosion – Gloveboxes instantiated from specification files

Python Model: Facility • Initializes the simulation, instantiates and then activates all the gloveboxes, and finally starts the simulation • Triggers cleanings and writings of inventory • Specifies duration of simulation • Naming service for gloveboxes

Python Model: Gloveboxes • Five types of gloveboxes – Generator – Dummy – Sampling – Standard – No. Target

Python Model: Standard Glovebox • Represents processing gloveboxes • Vacuum system for dust recovery • Receives material, processes it, ships it on, and accumulates by-products like scrap and holdup • Performs regular batches in a 24 -hour period • Holdup split into equipment and glovebox • Scrap and holdup largest contributors to sigma-ID

Python Model: Accumulation of By-products in a Glovebox

Python Model: Cleanings • Glovebox cleanings scheduled by Cleanup object • Routine cleanings (IIV), E. g. , changing filters – Scrap gathered by vacuum system removed – A portion of equipment holdup removed, split into scrap and waste streams • Thorough annual cleaning (PIV) – Scrap and all of removable equipment and glovebox holdup extracted

Python Model: Writing Inventory • The Write. Inv object requests that gloveboxes write their inventories • Inventory consists of: – Material in cans waiting to be processed – Material in process – Scrap – Equipment holdup – Glovebox holdup

Sim. Py • Discreet-event simulation framework in Python • Active objects are Processes that access Resources • Gloveboxes, Cleanup, and Write. Inv are Processes

Sample Classes: Facility from Sim. Py. Simulation import * def run(self): initialize() for gb. Name in Facility. _gloveboxes: gb. Ref = Facility. _gloveboxes[gb. Name] activate(gb. Ref, gb. Ref. execute()) activate(self. _cleanup, self. _cleanup. execute()) activate(self. _write. Inv, self. _write. Inv. execute()) simulate(until=self. _duration)

Sample Classes: Facility (cont. ) def get. Glovebox(cls, gb. Name): if not gb. Name in cls. _gloveboxes: raise Facility. Exception(…) return cls. _gloveboxes[gb. Name] get. Glovebox = classmethod(get. Glovebox)

Sample Classes: Cleanup class Cleanup(Process): def __init__(self, cleanup. Times): Process. __init__(self, name="Cleanup Process") self. _cleanup. Times = cleanup. Times def execute(self): last. Cleanup = 0 gloveboxes = Facility. get. Gloveboxes() for time, type in self. _cleanup. Times: yield hold, self, (time - last. Cleanup) for gb. Key in gloveboxes: gloveboxes[gb. Key]. do. Cleanup(type): last. Cleanup = time

Results • Each glovebox records events, e. g. , powder_in 1. 000000 25. 000000 3. 000000 48 20. 000000 • • • powder_in, material received by the glovebox 1. 000000, Pu weight in kgs 25. 000000, total weight of can + material 3. 000000, simulation time in hours 48, unique identifier of can 20. 000000, weight of empty can (i. e. , tare weight)

Results (cont. ) • Other recorded events: powder_out, scrap_out, waste, to_be_processed, in_process, scrap_inv, glovebox_holdup, sample_out, and equipment_holdup • Using a three year-old Linux box and running the model for an entire year, the simulation runs in less than a minute

Statistics • Output is a series of data files, one for each glovebox • Further calculations occur in R (formerly S-PLUS) • Measurements (with both systematic and random errors) added to material flow • Variance from errors propagated to estimate sigma -ID • IAEA uses a variation on sigma-ID, ID-D

Simulation GUI

Conclusions • Python/Sim. Py an excellent implementation choice • Can adjust rapidly to changing designs of facilities • Code provides a clear and transparent specification for the object model • Runs within acceptable time constraints • Easily apply framework to new facilities

Next Steps • Further refine XP practices • Move R calculations to Python or interface to R via RPy • Apply framework to other facilities
- Slides: 24