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

OpenMC mat fix #1076

Merged
merged 7 commits into from
Dec 11, 2018
Merged

OpenMC mat fix #1076

merged 7 commits into from
Dec 11, 2018

Conversation

pshriwise
Copy link
Member

This PR updates OpenMC material writing in the following ways:

  • no longer expands elements, but writes them in the GND format
  • ignores compositions with zero weight/atom fractions in the material composition

It adds tests which:

  • ensure that reading/writing of materials is consistent for the OpenMC format
  • verify the correct output for compositions containing natural elements

Copy link
Member

@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.

OpenMC does need you to expand elements before writing XML. The only cases where it accepts elemental data is if the nuclear data library itself uses elemental data. The most common example is carbon which has historically been given as an elemental evaluation (although evaluations for C12 and C13 have now become available in ENDF/B-VIII.0). Other than carbon, everything else should probably be split out into nuclides. The way we handle this in OpenMC's Python API is to look at the user's OPENMC_CROSS_SECTIONS environment variable to figure out what data they actually have available. Not sure you'd really want to have that kind of logic here though...

Copy link
Contributor

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

Looks OK to me, but I don't know anything about OpenMC formats

@pshriwise
Copy link
Member Author

Welp. That was rather silly of me. I ran into that carbon issue when converting a DAGMC model and generalized it without looking more closely.

I'll include a corner case for carbon for now.

Ignoring Carbon for expansion in the OpenMC material writer.
@pshriwise
Copy link
Member Author

I've updated the writer and added the option of passing a set of nucids to ignore in expand_elements. Added a test for that as well.

pyne/material.pyx Outdated Show resolved Hide resolved

Parameters
----------
nucset : set, optional
Copy link
Member

Choose a reason for hiding this comment

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

Indentation looks like it got messed up here (and below as well)

"""expand_elements(self)
Exapnds the elements ('U', 'C', etc) in the material by replacing them
with their natural isotopic distributions. This function returns a copy.
Exapnds the elements ('U', 'C', etc) in the material by
Copy link
Member

Choose a reason for hiding this comment

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

Typo: Exapnds

Copy link
Member

@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.

Looks good to me now!

@pshriwise
Copy link
Member Author

Any further comments @gonuke?

@gonuke
Copy link
Contributor

gonuke commented Dec 10, 2018

Already approved...

@paulromano paulromano merged commit 20d3d16 into pyne:develop Dec 11, 2018
@pshriwise pshriwise deleted the mat_fix branch December 14, 2018 00:41
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.

3 participants