openmc-data-storage / openmc_data_downloader Goto Github PK
View Code? Open in Web Editor NEWA Python package for downloading h5 cross section files for use in OpenMC.
License: MIT License
A Python package for downloading h5 cross section files for use in OpenMC.
License: MIT License
When using the just in time library generator the and with WMP as the preferred choice the downloader should also download additional libraries for the unresolved resonance region as explained by Paul in this issue https://openmc.discourse.group/t/minimal-wmp-simulation-with-minimal-cross-section-xml/1100/9
The utils python file has several functions but is missing docstrings, these are on the todo list
Neutrons for the JEFF 3.2 distribution have been processed in this repo https://github.com/openmc-data-storage/JEFF-3.2
However they need adding to the cross_sections_directory.py file like the other h5 file available.
This can be done with a large pull request or several smaller ones to the develop branch:
the introduction of a new variable called jeff_32_neutron_isotopes
in the cross_sections_directory.py file . The varible should contains all the isotope names in this folder
then a small section that builds up the dictionary of information on the cross section like I've done for other neutron libraries for example
then the add the new collection to the existing collections on this line
then change the README.md file so that it has a few JEFF-3.2 examples
As discussed briefly in #14 it would be great to have some of the h5 files that are currently found on openmc.org
To do this then there are a few stages, another base repository to template that would take a different approach to the existing template repository.
The new template would download from https://openmc.org/official-data-libraries/ then extract the contents and self commit to the repo using a GitHub action.
Currently the just_in_time_library_generator accepts openmc.Material
objects
It would be great if these were acceptabed as well
openmc.Materials
neutronics_material_maker.Material()
neutronics_material_maker.MultMaterial()
error caused when expanding a element without a cross section file set
import openmc
import openmc_data_downloader
openmc.config['cross_sections']=''
mat1 = openmc.Material()
mat1.add_element('Li', 1)
mat1.set_density('g/cm3',1)
materials=openmc.Materials([mat1])
materials.download_cross_section_data(
libraries=["FENDL-3.1d"],
set_OPENMC_CROSS_SECTIONS=True,
particles=["neutron"],
)
surf1 = openmc.Sphere(r=10, boundary_type='vacuum')
region1 = -surf1
cell1=openmc.Cell(region=region1,fill=mat1)
geometry=openmc.Geometry([cell1])
point = openmc.stats.Point((0, 0, 0))
energy = openmc.stats.Discrete([14.1e6], [1.0])
source = openmc.Source(space=point, energy=energy)
settings = openmc.Settings()
settings.source = source
settings.run_mode = 'fixed source'
settings.particles = 10000
settings.batches = 10
model = openmc.Model(geometry, materials, settings)
model.run()
ile ~/venv/openmc_env/lib/python3.8/site-packages/openmc/material.py:744, in Material.add_element(self, element, percent, percent_type, enrichment, enrichment_target, enrichment_type)
742 # Add naturally-occuring isotopes
743 element = openmc.Element(element)
--> 744 for nuclide in element.expand(percent,
745 percent_type,
746 enrichment,
747 enrichment_target,
748 enrichment_type):
749 self.add_nuclide(*nuclide)
File ~/venv/openmc_env/lib/python3.8/site-packages/openmc/element.py:138, in Element.expand(self, percent, percent_type, enrichment, enrichment_target, enrichment_type, cross_sections)
136 if cross_sections is not None:
137 library_nuclides = set()
--> 138 tree = ET.parse(cross_sections)
139 root = tree.getroot()
140 for child in root.findall('library'):
File /usr/lib/python3.8/xml/etree/ElementTree.py:1202, in parse(source, parser)
1193 """Parse XML document into element tree.
@shimwell It's really amazing I ❤️ this.
One question, How to install thermal scattering data?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.