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

added ability to load stp files into a shape #833

Merged
merged 6 commits into from
May 8, 2021

Conversation

shimwell
Copy link
Collaborator

@shimwell shimwell commented May 5, 2021

Proposed changes

This adds Shape().from_stp_file to the Shape class and makes use of this method in the Reactor.export_h5m_with_pymoab method.

This allows pymoab to be used as a method when making a reactor from a manifest.json file.

Previously this was only possible with the "trelis" method.

This means one can take a stp file(s) and run a neutronics simulation in the following manner ...

assuming you have a manifest.json like this

[
    {
        "stp_filename":"geometry.step",
        "material_tag":"my_material"
    }
]
import paramak, openmc

my_reactor = paramak.Reactor(
    shapes_and_components='manifest.json'
)

my_reactor.method = 'pymoab'

coords = openmc.stats.Point((0, 0, 0))
energy = openmc.stats.Discrete([1.41E7], [1.0])
source = openmc.Source(space=coords, energy=energy)

my_model = paramak.NeutronicsModel(
    geometry=my_reactor,
    source=source,
    materials={'my_material': 'eurofer'},
    mesh_tally_3d=['flux', 'heating'],
    mesh_3d_corners=[(-1, -1, -1), (1, 1, 1)]  # needed for now as the dimensions are not yet found automatically using this method
)

my_model.simulate()

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation Update (if none of the other choices apply)
  • New tests

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • Pep8 applied
  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@shimwell
Copy link
Collaborator Author

shimwell commented May 6, 2021

Failing tests are unrelated and are being fixed in #830

@shimwell shimwell merged commit 1390da3 into develop May 8, 2021
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.

1 participant