# Depletion execution

**URL:** <https://openmc.discourse.group/t/depletion-execution/2357>\
**Category:** User Support\
**Created:** [October 12, 2022, 2:14pm UTC](https://openmc.discourse.group/t/depletion-execution/2357 "2022-10-12T14:14:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian729](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@Brian729](https://openmc.discourse.group/u/Brian729)\
**Post date:** [October 12, 2022, 2:14pm UTC](https://openmc.discourse.group/t/depletion-execution/2357/1 "2022-10-12T14:14:24Z")

</div>

Running OpenMC Version 0.13.1 under Ubuntu 20.04.

I would like to be able to run a depletion, adjust the material file to “sweeten” the fuel, and then run another depletion on that revised material file. The issue I am running into can be shown as follows (Sorry for the length, but want to provide enough detail for someone to actually be able to help…):

#Generate Geometry, materials, settings (note external calls exports to xml files)

settings = DefineSetting()  
Mats, materials = DefineMaterials()  
geometry = DefineVesselGeometry(VesselRad,Cyl\_H,VesselWall,HemiModThickness,CoolPipeRad,HexPitch,FuelBox,RodRadius,RodHeight)

import openmc.deplete

#using simple chain until I can get the system to respond properly

chain = openmc.deplete.Chain.from\_xml(“/home/brian/OpenMC\_data/chain\_simple.xml”)

model = openmc.Model(geometry=geometry,materials=materials, settings=settings)  
operator = openmc.deplete.Operator(model,“/home/brian/OpenMC\_data/chain\_simple.xml”)  
#power is in watts - 1e6 = 1 MW - try 200 Megawatts  
power = 200e6  
time\_steps = [60 \* 60] \* 5 #deplete for 5 hours  
integrator = openmc.deplete.PredictorIntegrator(operator, time\_steps, power)  
integrator.integrate()

#This all works… I get everything I expect for the 5 hour depletion

results = openmc.deplete.ResultsList.from\_hdf5(“./depletion\_results.h5”)  
#Save the intermediate materials files for review  
for i in range(5):  
mf=results.export\_to\_materials(i)  
fn=“./materials”+str(i)+“.xml”  
mf.export\_to\_xml(fn)  
print(mf[0].get\_mass(“U235”))

#Output of above is:  
6587.592943820452  
6578.547441670925  
6569.501987610248  
6560.456546983021  
6551.411128389608

#showing expected depletion of U235. All good.  
#Now take that last “materials4.xml” file and make it the default  
#materials.xml file and run openmc.run() to get Keff:

import shutil  
fn=“./materials4.xml”  
shutil.copyfile(fn,‘./materials.xml’)  
openmc.run()

#results from this show greatly depleted fuel:

k-effective (Collision) = 0.45918 +/- 0.00118  
k-effective (Track-length) = 0.45920 +/- 0.00118  
k-effective (Absorption) = 0.45804 +/- 0.00205  
Combined k-effective = 0.45900 +/- 0.00114  
Leakage Fraction = 0.01333 +/- 0.00047

#My expectation is that this Keff should be the same as the last iteration of keff:

time, k = results.get\_eigenvalue()  
time /= (60 \* 60) # convert back to hours from seconds  
k

array([[1.11036474, 0.00243176],  
[1.11429175, 0.00236096],  
[1.10776158, 0.00240418],  
[1.10337545, 0.00222762],  
[1.10350493, 0.00225666],  
[1.10449178, 0.00228493]])

Can someone explain where I am going wrong here? Thank you.

---

<div class="post-metadata">

**Author:** ![Brian729](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@Brian729](https://openmc.discourse.group/u/Brian729)\
**Post date:** [October 13, 2022, 5:39pm UTC](https://openmc.discourse.group/t/depletion-execution/2357/2 "2022-10-13T17:39:39Z")

</div>

OK, some additional information. It appears to me the “materials.xml” file is setup differently when the depletion models are used. Here is FuelSalt xml listing for a Keff determination (matches initiating code exactly):

cross\_sections.xml\</cross\_sections\>

Here is material file from the “zero” index of a depletion run. Note addition of the chain file isotopes, and the change in the U235/U238 values. Those were the ONLY concentrations that were changed:

So I guess my answer is, unless someone can tell me otherwise, is that the material files are not compatible between Keff determination and a depletion run.

---

<div class="post-metadata">

**Author:** ![Brian729](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@Brian729](https://openmc.discourse.group/u/Brian729)\
**Post date:** [October 13, 2022, 5:42pm UTC](https://openmc.discourse.group/t/depletion-execution/2357/3 "2022-10-13T17:42:06Z")

</div>

- 
- 

```
<density units="g/cm3" value="2.3" />

```

- 

```
<nuclide ao="0.65" name="Li7" />

```

- 

```
<nuclide ao="0.29" name="Be9" />

```

- 

```
<nuclide ao="0.05" name="Zr91" />

```

- 

```
<nuclide ao="0.002" name="U235" />

```

- 

```
<nuclide ao="0.008" name="U238" />

```

- 

```
<nuclide ao="1.51" name="F19" />

```

- 
- 
- 

```
<density units="sum" />

```

- 

```
<nuclide ao="0.29" name="Be9" />

```

- 

```
<nuclide ao="1.51" name="F19" />

```

- 

```
<nuclide ao="0.65" name="Li7" />

```

- 

```
<nuclide ao="0.05" name="Zr91" />

```

- 

```
<nuclide ao="1e-21" name="Cs135" />

```

- 

```
<nuclide ao="1e-21" name="Gd156" />

```

- 

```
<nuclide ao="1e-21" name="Gd157" />

```

- 

```
<nuclide ao="1e-21" name="I135" />

```

- 

```
<nuclide ao="1e-21" name="U234" />

```

- 

```
<nuclide ao="6.475223363030086e-05" name="U235" />

```

- 

```
<nuclide ao="0.00025900893452120345" name="U238" />

```

- 

```
<nuclide ao="1e-21" name="Xe135" />

```

- 

```
<nuclide ao="1e-21" name="Xe136" />

```

- 

For some reason, xml didn’t paste properly in my email.
