Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ncrystal materials #2435

Merged
merged 4 commits into from Apr 13, 2023

Conversation

zoeprieto
Copy link
Contributor

This pull request aims to fix the issue #2422. The changes are simple but one remaining point would be to obtain the maximum NCrystal energy from the C API. @paulromano how can we access the API to obtain NCRYSTAL_MAX_ENERGY?

@zoeprieto
Copy link
Contributor Author

cfg = 'LiquidWaterH2O_T293.6K.ncmat'
m1 = openmc.Material.from_ncrystal(cfg)
m1.name = cfg
openmc.plot_xs(m1, ('scatter',))

image

Here there is a simple example

Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing this @zoeprieto! It looks like there is a conflict in plotter.py due to the recently merged PR #2413, so you'll need to merge in the latest develop branch into your branch and resolve the conflicts.

import NCrystal
nc_scatter = NCrystal.createScatter(ncrystal_cfg)
nc_func = nc_scatter.crossSectionNonOriented
nc_emax = 5 # eV # this should be obtained from NCRYSTAL_MAX_ENERGY
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there was some discussion about having the max energy be configurable, but I forget where we ended up on this. @tkittel Do you recall? In any event, I'm fine with the hard-coded value for now.

zoeprieto and others added 3 commits March 29, 2023 16:53
@zoeprieto
Copy link
Contributor Author

Hey @paulromano , I incorporated the changes to my branch. Can you please review it again?

Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zoeprieto!

@paulromano paulromano merged commit ae615c0 into openmc-dev:develop Apr 13, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants