# Missing thermal scattering data after installing OpenMC

**URL:** <https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341>\
**Category:** User Support\
**Created:** [July 28, 2021, 1:51pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341 "2021-07-28T13:51:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![fruitfly](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fruitfly](https://openmc.discourse.group/u/fruitfly)\
**Post date:** [July 28, 2021, 1:51pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/1 "2021-07-28T13:51:39Z")

</div>

Hello,  
Thank you for your time reading this post. I am new to openmc and new to Linux.

My problem is during the ‘Modelling a Pin-Cell’ tutorial I get an error saying ‘RuntimeError: Could not find thermal scattering data c\_H\_in\_H2O in cross\_sections.xml file.’

How can I fix this?

I can also see that I don’t have the same amount of isotopes in my cross\_sections.xml file.

To further expand on the problem, I think the reason this may be happening is because I followed an unusual installation video meant for fusion modelling. I followed a fusion installation example here [openmc workshop ubuntu - YouTube](https://www.youtube.com/watch?v=PqIb5MZKyGA) with openmc being downloaded with bundle from a github page.

I theorize I need to overwrite my cross\_sections.xml file with a new library. How do I run the JEFF 3.3 library here [data/convert\_jeff33.py at master · openmc-dev/data · GitHub](https://github.com/openmc-dev/data/blob/master/convert_jeff33.py) which I will assume has thermal scattering?

I am new to Linux and installing anaconda was the peak of my abilities.

---

<div class="post-metadata">

**Author:** ![fsabab](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/fsabab/32/1374_2.png) [@fsabab](https://openmc.discourse.group/u/fsabab)\
**Post date:** [July 28, 2021, 2:19pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/2 "2021-07-28T14:19:23Z")

</div>

> [@fruitfly](#):
>
> My problem is during the ‘Modelling a Pin-Cell’ tutorial I get an error saying ‘RuntimeError: Could not find thermal scattering data c\_H\_in\_H2O in cross\_sections.xml file.’

Download the LANL ENDF/B-VIII.0 cross-section file from [here](https://openmc.org/lanl-data-libraries/). Your problem should be solved.

---

<div class="post-metadata">

**Author:** ![fruitfly](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fruitfly](https://openmc.discourse.group/u/fruitfly)\
**Post date:** [July 28, 2021, 2:34pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/3 "2021-07-28T14:34:52Z")

</div>

Thanks fsabab for the solution.  
I am new to this. I clicked the [Download .tar.xz] link and clicked ‘save’.  
Once it has downloaded do I need to do anything more, like extract the file into a specific folder somewhere?

---

<div class="post-metadata">

**Author:** ![fsabab](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/fsabab/32/1374_2.png) [@fsabab](https://openmc.discourse.group/u/fsabab)\
**Post date:** [July 28, 2021, 2:46pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/4 "2021-07-28T14:46:38Z")

</div>

You mentioned that you don’t know how to set up the new cross-section which I missed in my previous reply. Follow the steps below.

1. Download the cross-section from the previous link and extract it.
2. Go to the extracted folder. Find the `cross_sections.xml` file. Go to its properties and copy the parent directory for it.
3. Open the `cross_sections.xml` file using any text editor and go to the 2nd line of the script and write

> `<directory>paste_the_path_you_copied</directory>`

and save that

1. Now if you want to use the same cross-section data every time, you can set up an environment variable. To do that follow this

> export OPENMC\_CROSS\_SECTIONS=‘the\_path\_you\_copied/cross\_sections.xml’

```
    Do not change anything else on the `.bashrc` file. Save that. 

```

1. Now if you don’t wanna do this i.e., setting up the environment variable, you can simply omit the previous step. Just copy the `cross_sections.xml` file and paste it to your working directory.

I hope that it helps.

---

<div class="post-metadata">

**Author:** ![fruitfly](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fruitfly](https://openmc.discourse.group/u/fruitfly)\
**Post date:** [July 28, 2021, 2:51pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/5 "2021-07-28T14:51:16Z")

</div>

I searched for the `cross_sections.xml` file but couldn’t find it. I searched the whole of my Home folder. Where do I find it?

---

<div class="post-metadata">

**Author:** ![fsabab](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/fsabab/32/1374_2.png) [@fsabab](https://openmc.discourse.group/u/fsabab)\
**Post date:** [July 28, 2021, 2:53pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/6 "2021-07-28T14:53:54Z")

</div>

You will find that after extracting the downloaded cross-section file.

---

<div class="post-metadata">

**Author:** ![fruitfly](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fruitfly](https://openmc.discourse.group/u/fruitfly)\
**Post date:** [July 28, 2021, 2:54pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/7 "2021-07-28T14:54:44Z")

</div>

Ok, thanks. I am extracting it now. 🙂

---

<div class="post-metadata">

**Author:** ![fruitfly](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fruitfly](https://openmc.discourse.group/u/fruitfly)\
**Post date:** [July 28, 2021, 3:12pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/8 "2021-07-28T15:12:15Z")

</div>

Hi fsabab,  
I followed steps 1 to 4, and reran the code in Jupyter Notebooks but unfortunately it did not work. My exact input, with the error message at the end is this:  
%matplotlib inline

#ln 30 has a comment for N13

import openmc

uo2 = openmc.Material(1, “uo2”)

print(uo2)

Material  
ID = 1  
Name = uo2  
Temperature = None  
Density = None [sum]  
S(a,b) Tables  
Nuclides

mat = openmc.Material()

print(mat)

Material  
ID = 2  
Name =   
Temperature = None  
Density = None [sum]  
S(a,b) Tables  
Nuclides

help(uo2.add\_nuclide)

Help on method add\_nuclide in module openmc.material:

add\_nuclide(nuclide, percent, percent\_type=‘ao’) method of openmc.material.Material instance  
Add a nuclide to the material

```
Parameters
----------
nuclide : str
    Nuclide to add, e.g., 'Mo95'
percent : float
    Atom or weight percent
percent_type : {'ao', 'wo'}
    'ao' for atom percent and 'wo' for weight percent

```

#Add nuclides to uo2

uo2.add\_nuclide(‘U235’, 0.03)

uo2.add\_nuclide(‘U238’, 0.97)

uo2.add\_nuclide(‘O16’, 2.0)

uo2.set\_density(‘g/cm3’, 10.0)

zirconium = openmc.Material(name=“zirconium”)

zirconium.add\_element(‘Zr’, 1.0)

zirconium.set\_density(‘g/cm3’, 6.6)

​

water = openmc.Material(name=“h2o”)

water.add\_nuclide(‘H1’, 2.0)

water.add\_nuclide(‘O16’, 1.0)

water.set\_density(‘g/cm3’, 1.0)

water.add\_s\_alpha\_beta(‘c\_H\_in\_H2O’)

materials = openmc.Materials([uo2, zirconium, water])

materials = openmc.Materials()

materials.append(uo2)

materials += [zirconium, water]

isinstance(materials, list)

True

materials.export\_to\_xml()

!cat materials.xml

\<?xml version='1.0' encoding='utf-8'?\> 

water.remove\_nuclide(‘O16’)

water.add\_element(‘O’, 1.0)

​

materials.export\_to\_xml()

!cat materials.xml

\<?xml version='1.0' encoding='utf-8'?\> 

!cat $OPENMC\_CROSS\_SECTIONS | head -n 10

print(’ …')

!cat $OPENMC\_CROSS\_SECTIONS | tail -n 10

\<?xml version='1.0' encoding='utf-8'?\>

\<cross\_sections\>  
  
  
  
  
  
  
  
  
…  
  
  
  
  
  
  
  
  
  
\</cross\_sections\>

uo2\_three = openmc.Material()

uo2\_three.add\_element(‘U’, 1.0, enrichment=3.0)

uo2\_three.add\_element(‘O’, 2.0)

uo2\_three.set\_density(‘g/cc’, 10.0)

# Create PuO2 material

puo2 = openmc.Material()

puo2.add\_nuclide(‘Pu239’, 0.94)

puo2.add\_nuclide(‘Pu240’, 0.06)

puo2.add\_nuclide(‘O16’, 2.0)

puo2.set\_density(‘g/cm3’, 11.5)

​

# Create the mixture

mox = openmc.Material.mix\_materials([uo2, puo2], [0.97, 0.03], ‘wo’)

sphere = openmc.Sphere(r=1.0)

inside\_sphere = -sphere

outside\_sphere = +sphere

print((0,0,0) in inside\_sphere, (0,0,2) in inside\_sphere)

print((0,0,0) in outside\_sphere, (0,0,2) in outside\_sphere)

True False  
False True

z\_plane = openmc.ZPlane(z0=0)

northern\_hemisphere = -sphere & +z\_plane

northern\_hemisphere.bounding\_box

(array([-1., -1., 0.]), array([1., 1., 1.]))

cell = openmc.Cell()

cell.region = northern\_hemisphere

​

# or…

cell = openmc.Cell(region=northern\_hemisphere)

cell.fill = water

universe = openmc.Universe()

universe.add\_cell(cell)

​

# this also works

universe = openmc.Universe(cells=[cell])

universe.plot(width=(2.0, 2.0))

\<matplotlib.image.AxesImage at 0x7f4fabb865d0\>

universe.plot(width=(2.0, 2,0), basis=‘xz’)

\<matplotlib.image.AxesImage at 0x7f4faba1b7d0\>

#skipped color

fuel\_outer\_radius = openmc.ZCylinder(r=0.39)

clad\_inner\_radius = openmc.ZCylinder(r=0.40) #delete later

clad\_outer\_radius = openmc.ZCylinder(r=0.46) #delete later

fuel\_region = -fuel\_outer\_radius

gap\_region = +fuel\_outer\_radius & -clad\_inner\_radius

clad\_region = +clad\_inner\_radius & -clad\_outer\_radius

fuel = openmc.Cell(name=‘fuel’)

fuel.fill = uo2

fuel.region = fuel\_region

​

gap = openmc.Cell(name=‘clad’)

gap.region = gap\_region

​

clad = openmc.Cell(name=‘clad’)

clad.fill = zirconium

clad.region = clad\_region

pitch = 1.26

left = openmc.XPlane(x0=-pitch/2, boundary\_type=‘reflective’)

right = openmc.XPlane(x0=pitch/2, boundary\_type=‘reflective’)

bottom = openmc.YPlane(y0=-pitch/2, boundary\_type=‘reflective’) #change to black body for N13

top = openmc.YPlane(y0=pitch/2, boundary\_type=‘reflective’) #change to black body for N13

water\_region = +left & -right & +bottom & -top & +clad\_outer\_radius

​

moderator = openmc.Cell(name=‘moderator’)

moderator.fill = water

moderator.region = water\_region

box = openmc.rectangular\_prism(width=pitch, height=pitch,

```
                           boundary_type='reflective')

```

type(box)

openmc.region.Intersection

water\_region = box & +clad\_outer\_radius

root\_universe = openmc.Universe(cells=(fuel, gap, clad, moderator))

​

geometry = openmc.Geometry()

geometry.root\_universe = root\_universe

​

# or…

geometry = openmc.Geometry(root\_universe)

geometry.export\_to\_xml()

!cat geometry.xml

\<?xml version='1.0' encoding='utf-8'?\> 
# Create a point source

point = openmc.stats.Point((0, 0, 0))

source = openmc.Source(space=point)

settings = openmc.Settings()

settings.source = source

settings.batches = 100

settings.inactive = 10

settings.particles = 1000

settings.export\_to\_xml()

!cat settings.xml

\<?xml version='1.0' encoding='utf-8'?\> eigenvalue 1000 100 10 0 0 0 

cell\_filter = openmc.CellFilter(fuel)

​

tally = openmc.Tally(1)

tally.filters = [cell\_filter]

tally.nuclides = [‘U235’]

tally.scores = [‘total’, ‘fission’, ‘absorption’, ‘(n,gamma)’]

tallies = openmc.Tallies([tally])

tallies.export\_to\_xml()

!cat tallies.xml

\<?xml version='1.0' encoding='utf-8'?\> 3 1 U235 total fission absorption (n,gamma) 

openmc.run()

```
                            %%%%%%%%%%%%%%%
                       %%%%%%%%%%%%%%%%%%%%%%%%
                    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                %%%%%%%%%%%%%%%%%%%%%%%%
                                 %%%%%%%%%%%%%%%%%%%%%%%%
             ############### %%%%%%%%%%%%%%%%%%%%%%%%
            ################## %%%%%%%%%%%%%%%%%%%%%%%
            ################### %%%%%%%%%%%%%%%%%%%%%%%
            #################### %%%%%%%%%%%%%%%%%%%%%%
            ##################### %%%%%%%%%%%%%%%%%%%%%
            ###################### %%%%%%%%%%%%%%%%%%%%
            ####################### %%%%%%%%%%%%%%%%%%
             ####################### %%%%%%%%%%%%%%%%%
             ###################### %%%%%%%%%%%%%%%%%
              #################### %%%%%%%%%%%%%%%%%
                ################# %%%%%%%%%%%%%%%%%
                 ############### %%%%%%%%%%%%%%%%
                   ############ %%%%%%%%%%%%%%%
                      ######## %%%%%%%%%%%%%%
                                  %%%%%%%%%%%

               | The OpenMC Monte Carlo Code
     Copyright | 2011-2021 MIT and OpenMC contributors
       License | https://docs.openmc.org/en/latest/license.html
       Version | 0.12.1
      Git SHA1 | 36913589c4f43b7f843332181645241f0f10ae9e
     Date/Time | 2021-07-28 15:07:40
OpenMP Threads | 8

```

Reading settings XML file…  
Reading cross sections XML file…  
Reading materials XML file…  
ERROR: Could not find thermal scattering data c\_H\_in\_H2O in cross\_sections.xml  
file.

* * *

RuntimeError Traceback (most recent call last)  
 in   
----\> 1 openmc.run()

/opt/conda/lib/python3.7/site-packages/openmc/executor.py in run(particles, threads, geometry\_debug, restart\_file, tracks, output, cwd, openmc\_exec, mpi\_args, event\_based)  
225 args = mpi\_args + args  
226  
 → 227 \_run(args, output, cwd)

/opt/conda/lib/python3.7/site-packages/openmc/executor.py in \_run(args, output, cwd)  
36 error\_msg = ’ '.join(error\_msg.split())  
37  
—\> 38 raise RuntimeError(error\_msg)  
39  
40

RuntimeError: Could not find thermal scattering data c\_H\_in\_H2O in cross\_sections.xml file.

---

<div class="post-metadata">

**Author:** ![fsabab](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/fsabab/32/1374_2.png) [@fsabab](https://openmc.discourse.group/u/fsabab)\
**Post date:** [July 28, 2021, 3:32pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/9 "2021-07-28T15:32:46Z")

</div>

Did you restart your pc? If not, then restart that and run again.

---

<div class="post-metadata">

**Author:** ![fruitfly](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fruitfly](https://openmc.discourse.group/u/fruitfly)\
**Post date:** [July 28, 2021, 5:36pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/10 "2021-07-28T17:36:10Z")

</div>

I restarted my computer, but now when I run it in Jupyter Notebook it says ’  
ModuleNotFoundError: No module named ‘openmc’’

---

<div class="post-metadata">

**Author:** ![fsabab](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/fsabab/32/1374_2.png) [@fsabab](https://openmc.discourse.group/u/fsabab)\
**Post date:** [July 28, 2021, 5:51pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/11 "2021-07-28T17:51:26Z")

</div>

I think you messed something up in your bashrc file.  
Please check again. Do remember that you need to put the export OPENMC\_CROSS\_SECTION command in a new line.

---

<div class="post-metadata">

**Author:** ![fruitfly](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fruitfly](https://openmc.discourse.group/u/fruitfly)\
**Post date:** [July 28, 2021, 6:15pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/12 "2021-07-28T18:15:51Z")

</div>

I checked the .bashrc file and the export command is on a new line. I don’t know what is wrong. I am very new at this. It was a struggle to get anything running on it in the first place. I installed it via someones github and when that wasn’t working with the cross section reinstalled it with the conda command. It was still running the code but missing cross sections. It displaying that ‘no module named openmc’ error message when I run it now

---

<div class="post-metadata">

**Author:** ![fruitfly](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fruitfly](https://openmc.discourse.group/u/fruitfly)\
**Post date:** [July 28, 2021, 10:22pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/13 "2021-07-28T22:22:44Z")

</div>

When I type ‘openmc’ in terminal, nothing comes up. I was using Jupyter Notebooks before

---

<div class="post-metadata">

**Author:** ![fsabab](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/fsabab/32/1374_2.png) [@fsabab](https://openmc.discourse.group/u/fsabab)\
**Post date:** [July 29, 2021, 3:11am UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/14 "2021-07-29T03:11:50Z")

</div>

I’m assuming this happened because of installing OpenMC from the source that mainly focused on fusion.  
Please follow the link below and install OpenMC again.  
[https://docs.openmc.org/en/stable/usersguide/install.html#installation-and-configuration](https://docs.openmc.org/en/stable/usersguide/install.html#installation-and-configuration)

---

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [July 29, 2021, 6:22am UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/15 "2021-07-29T06:22:56Z")

</div>

@fruitfly You’re using Docker and to fix this problem you can use either [openmc-data-downloader](https://pypi.org/project/openmc-data-downloader/) or install full data library inside docker. I’d go with the second option

```bash
docker run -it ukaea/openmcworkshop /bin/bash
cd $HOME
wget -c https://anl.box.com/shared/static/uhbxlrx7hvxqw27psymfbhi7bx7s6u6a.xz -O endfb8
 tar -xvf endfb8 -C /opt
rm -rf endfb8
echo "export OPENMC_CROSS_SECTIONS= '/opt/endfb80_hdf5/cross_sections.xml'" >> ~/.bashrc

```

But I would recommend using anaconda/miniconda to install openmc. Open terminal and type the following command one by one

```auto
cd $HOME/Downloads
wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh
bash Miniconda3-py39_4.10.3-Linux-x86_64.sh -b -p ~/miniconda3
conda config --set auto_activate_base false
conda config --add channels conda-forge
conda create -n openmc-env openmc jupyterlab vtk -y

```

Best  
pranto

---

<div class="post-metadata">

**Author:** ![fruitfly](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fruitfly](https://openmc.discourse.group/u/fruitfly)\
**Post date:** [July 29, 2021, 10:37am UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/16 "2021-07-29T10:37:32Z")

</div>

> [@Pranto](#):
>
> ```auto
> conda create -n openmc-env openmc jupyterlab vtk -y
> 
> ```

I tried using anaconda/miniconda to install openmc but now when I type “impost openmc” in Jupyter Notebook it comes back with an error message saying “ModuleNotFoundError: No module named ‘openmc’” , and when I type “openmc” in terminal it says “Command ‘openmc’ not found”.

I’m going to try restarting my PC.

---

<div class="post-metadata">

**Author:** ![fruitfly](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fruitfly](https://openmc.discourse.group/u/fruitfly)\
**Post date:** [July 29, 2021, 10:47am UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/17 "2021-07-29T10:47:47Z")

</div>

Restarting did nothing.

I am new to Linux and openmc so it could be that I am making some big beginner mistake.

---

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [July 29, 2021, 11:44am UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/18 "2021-07-29T11:44:55Z")

</div>

To fix this, Can we talk in private? Email: [ariful.prantestain55@yahoo.com](mailto:ariful.prantestain55@yahoo.com)

---

<div class="post-metadata">

**Author:** ![fruitfly](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fruitfly](https://openmc.discourse.group/u/fruitfly)\
**Post date:** [July 29, 2021, 12:16pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/19 "2021-07-29T12:16:36Z")

</div>

Ok, I sent you an email.

---

<div class="post-metadata">

**Author:** ![fruitfly](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fruitfly](https://openmc.discourse.group/u/fruitfly)\
**Post date:** [July 31, 2021, 8:02pm UTC](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341/20 "2021-07-31T20:02:30Z")

</div>

It turns out my problem was more than just downloading a new data library and couldn’t be solved in this thread. Therefor I have chosen fsabab’s answer for the solution as it worked to at least download the data library.

[Next page](https://openmc.discourse.group/t/missing-thermal-scattering-data-after-installing-openmc/1341.md?page=2)
