unstructured mesh from dagm with openmc

72 views
Skip to first unread message

Lorenzo Chierici

unread,
Nov 4, 2021, 8:44:13 AM11/4/21
to DAGMC Users and Collaborators
Dear all,

I apologize in advance for the very basics questions, but I'm new here and learning this new tools almost from zero.. I Would like to set a workflow to run complex cad files with openmc and for this reason I'm looking into the unstructured mesh tally object in openmc inputting from a dagmc surface mesh file (.h5m).

In my script, I've imported the openmc.lib, asserted that dagmc is enabled and set the settings.dagmc to true before creating the xml files, but still when I run, openmc complains that no geometry xml files are provided.

Does anyone have ever experienced similar problems?

Thank you in advance.

Best Regards,
Lorenzo

Jonathan Shimwell

unread,
Nov 4, 2021, 9:22:54 AM11/4/21
to dagmc...@googlegroups.com
Hi Lorenzo

I don't have an example handy but one thing I notice from your email was the use of settings.dagmc

The "settings.dagmc to true" has recently been changed to "openmc.DAGMCUniverse(h5m_filename)" in the latest version of OpenMC (on development branch) so might want to change that in the future depending on which version of OpenMC you are using

Does the unstructured mesh example on openmc work for you?

Best

Jon



--
You received this message because you are subscribed to the Google Groups "DAGMC Users and Collaborators" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dagmc-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dagmc-users/1d2dbc5a-15d7-4f6c-a1fd-0a17e459cb4cn%40googlegroups.com.

Lorenzo Chierici

unread,
Nov 4, 2021, 10:01:53 AM11/4/21
to dagmc...@googlegroups.com
Hi John,

Thank you for your answer!

I was more trying to reproduce this example, where there the geometry.xml file should be replaced by the dagmc one:

I've tried "openmc.DAGMCUniverse(h5m_filename)" instead of "settings.dagmc to true", but it has the same problem.

Best regards,
Lorenzo





Jonathan Shimwell

unread,
Nov 4, 2021, 1:44:32 PM11/4/21
to dagmc...@googlegroups.com
Hi Lorenzo

Are you able to share the code or a git repository so I can take a look. 

Best

Jon

Lorenzo Chierici

unread,
Nov 5, 2021, 4:03:31 AM11/5/21
to dagmc...@googlegroups.com
Hi John,
I think I found out what the error was: I wasn't exporting any geometry after calling the DAGMCUniverse method, thanks for the input though.
Best Regards,
Lorenzo

Jonathan Shimwell

unread,
Nov 5, 2021, 5:10:13 AM11/5/21
to dagmc...@googlegroups.com
Nice that you got it working, congrats

geometry.export_to_xml() is one way to make the geometry.xml file

Another way is to combine materials, geometry, tallies and settings into a model object and do a model.run which exports all of them in one go.

This has the advantage of saving a few lines and returning the statepoint filename

model = openmc.model.Model(geom, mats, sett, tallies) sp_filename = model.run()

All the best

Jon



Reply all
Reply to author
Forward
0 new messages