Skip to content

Commit

Permalink
updated for new API
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Mar 29, 2023
1 parent 680880e commit 3f55c4f
Showing 1 changed file with 31 additions and 45 deletions.
76 changes: 31 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,29 +160,16 @@ mat1 = openmc.Material()
mat1.add_element('Fe', 0.95)
mat1.add_element('C', 0.05)

odd.just_in_time_library_generator(
libraries='FENDL-3.1d',
materials=mat1
)
```

### Downloading the isotopes present in an OpenMC material from two libraries but with a preference for ENDF/B 7.1 NNDC library over TENDL 2019
mats = openmc.Materials([mat1])

```python
import openmc
import openmc_data_downloader as odd

mat1 = openmc.Material()
mat1.add_element('Fe', 0.95)
mat1.add_element('C', 0.05)

odd.just_in_time_library_generator(
libraries=['ENDFB-7.1-NNDC', 'TENDL-2019'],
materials=mat1
)
mats.download_cross_section_data(
libraries=["FENDL-3.1d"],
set_OPENMC_CROSS_SECTIONS=True,
particles=["neutron"],
)
```

### Downloading the isotopes in several OpenMC materials
### Downloading the isotopes present in an OpenMC material from two libraries but with a preference for ENDF/B 7.1 NNDC library over TENDL 2019

```python
import openmc
Expand All @@ -192,24 +179,16 @@ mat1 = openmc.Material()
mat1.add_element('Fe', 0.95)
mat1.add_element('C', 0.05)

mat2 = openmc.Material()
mat2.add_element('H', 0.66)
mat2.add_element('0', 0.33)

# a list of openmc.Material objects can be used
odd.just_in_time_library_generator(
libraries='ENDFB-7.1-NNDC',
materials=[mat1, mat2]
)
mats = openmc.Materials([mat1])

# alternatively an openmc.Materials() object can be used
mats = openmc.Materials([mat1, mat2])
odd.just_in_time_library_generator(
libraries='ENDFB-7.1-NNDC',
materials=mats
)
mats.download_cross_section_data(
libraries=[ENDFB-7.1-NNDC', 'TENDL-2019'],
set_OPENMC_CROSS_SECTIONS=True,
particles=["neutron"],
)
```


### Downloading neutron cross sections for a material with an SaB

```python
Expand All @@ -221,10 +200,12 @@ my_mat.add_element('Be', 0.5)
my_mat.add_element('O', 0.5)
my_mat.add_s_alpha_beta('Be_in_BeO')

odd.just_in_time_library_generator(
libraries='ENDFB-7.1-NNDC',
materials= my_mat
particles = ['neutron'],
mats = openmc.Materials([my_mat])

odd.download_cross_section_data(
libraries=[ENDFB-7.1-NNDC', 'TENDL-2019'],
set_OPENMC_CROSS_SECTIONS=True,
particles=["neutron"],
)
```

Expand All @@ -234,10 +215,15 @@ odd.just_in_time_library_generator(
import openmc
import openmc_data_downloader as odd

odd.just_in_time_library_generator(
libraries='TENDL-2019',
elements=['Li', 'Be'],
particles = ['photon', 'neutron'],
isotopes=['Fe56', 'U235'],
)
mat1 = openmc.Material()
mat1.add_element('Fe', 0.95)
mat1.add_element('C', 0.05)

mats = openmc.Materials([mat1])

mats.download_cross_section_data(
libraries=[ENDFB-7.1-NNDC', 'TENDL-2019'],
set_OPENMC_CROSS_SECTIONS=True,
particles=["neutron", "photon"],
)
```

0 comments on commit 3f55c4f

Please sign in to comment.