MCNP Geometry from Mesh

321 views
Skip to first unread message

Anthony Scopatz

unread,
Feb 2, 2014, 1:45:15 PM2/2/14
to PyNE Dev
Hello All, but mostly Andy,

Say that we have a pyne Mesh in memory and we want to write the geometry out to an MCNP input file format, what is the best way to do this?  For the moment, let's limit ourselves to structured meshes.  Is this what DAGMC is for?  Or would it be easier to go directly to MCNP cards from the mesh itself, composing a bunch of rectangular pipette blocks together?

We are looking for a path-of-least-resistance here.  Thanks for any advice!

Be Well
Anthony

Andrew Davis

unread,
Feb 2, 2014, 4:35:04 PM2/2/14
to pyne...@googlegroups.com
Hi Anthony

In my opinion I think it would be much simpler (conceptually) to go to a MCNP input deck since you know that each mesh plane corresponds to a px/py/pz in MCNP and each mesh element is composed of 6 of these planes. I think it would make for a shorter script (but conceptually harder) to go via the DAGMC route. 

To do the MCNP route, be aware to ensure you do no duplicate planes, keep a record/be aware of plane indicies when building cells, otherwise mcnp will spend a lot of input time removing duplicate planes. 

For DAGMC you would have to create the vertices that bound each cell, create a facets which belong to each surface, and then associate those surfaces with some volume, also ensuring the sense of the surfaces is correct.

So for me, +1 for MCNP

Andy


--
 
---
You received this message because you are subscribed to the Google Groups "PyNE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyne-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Anthony Scopatz

unread,
Feb 2, 2014, 5:06:44 PM2/2/14
to PyNE Dev
Thanks for the advice, Andy!

This is exactly what we needed to know.

Be Well
Anthony
Message has been deleted

Kevin Manalo

unread,
Feb 20, 2014, 12:30:59 AM2/20/14
to pyne...@googlegroups.com
Probably very late to the discussion here, but much of my thesis work was dedicated to writing structured mesh to MCNP, as I wanted to convert 3d structured hexahedral mesh for use in Monte Carlo MCNP5/X/6. But none of that is really possible without Dr. Ce Yi's work on PENMSH.  I hope this presents a path of least resistance. 

There are 2 codes that allow for this generation:

Dr. Ce Yi over at Georgia Tech is the main author of PENMSH (research scientist in Prof. Glenn Sjoden's Critcel Group at Georgia Tech), which is a Fortran code that generates 3d structured hexahedral mesh (adaptive fine mesh per coarse mesh).  This code has been used for several years now and is robust in generating 3d full core mesh models.  We also use the code to generate matching flux plots. 3d plots are available with Tecplot if you have that license.

Samples
https://github.com/critcel/penmsh/blob/master/case/04_overlay/ove_z1cm.png
https://github.com/critcel/penmsh/blob/master/case/01_hexagon/he3_z1cm.png
https://github.com/critcel/penmsh/blob/master/case/07_pfbr/pfb_z1cm.png

Manual

https://github.com/critcel/penmsh/tree/master/docs/

The pictures/plots are generated with a supported DISLIN library & license, there are also matching 3d Tecplot files that allow for generation in 3d.

I have had the opportunity to discuss with Ce Yi about making this tool available via github and has graciously allowed for that.  Dr. Yi is currently working on h5 outputs (with potential for parallel mesh generation).  I wrote the converter mesh2mcnp, here which generates files based on 3d mesh generated for PENTRAN/TITAN input decks (TITAN is available through RSICC currently)

and the related 3d mesh input in MCNP.

I think this tool would be excellent for use/coupling in or within PyNE, at least potentially co-aligning the structured mesh portions. 

To get MCNP mesh, I convert on the basis provided by this input:
https://github.com/critcel/penmsh/blob/master/case/03_drcc/drcc_out.pen

Model (just a repeat of before)
https://github.com/critcel/mesh2mcnp/blob/master/case3-drcc/drc_z1cm.png

Resulting MCNP mesh output
(input to MCNP):
https://github.com/critcel/mesh2mcnp/blob/master/case3-drcc/drcc_out_continuous.mc

Basically we drive a two-level coarse mesh fine mesh scheme with universes, can detail this later.
Note that it's still on the user to generate their own sdef or kcode cards, but most everything else is handled.

As we are newly discovering how to write h5 output, this may be a great time to collaborate with PyNE if there is interest (either by leveraging the Fortran tool) or by making a better understanding of making compatible the structured mesh that is designed/set by PyNE.  Unstructured mesh is obviously another beast, but when it comes to structured mesh the PENMSH concept is straightforward - basically driven by casting overlays (partial extrusions in z can be handled also) within each 3d coarse mesh.

I have a related PHYSOR paper (me and Prof. Glenn Sjoden) for MESH2MCNP where I examine the mesh fidelity issue for curved geometries in PWR pins, if interested.

If PyNErs are interested in this, please let me know and we can engage more directly with Ce regarding PENMSH (especially in how the h5 files are written) and you can interface with me directly on MESH2MCNP (Ce is cc'd on this).  I may not have time for this one, but I would propose that MESH2MCNP should operate on the design of the corresponding h5 mesh structure that could 'mesh' with what is currently being done in PyNE. Work for another day... 

MESH2MCNP was done before I knew about PyNE, so it needs some code review etc. but it covers what you need to do to have a successful, robust structured mesh in MCNP. 

Anthony Scopatz

unread,
Feb 20, 2014, 9:53:51 AM2/20/14
to PyNE Dev
Hey Kevin, 

I'll reply on the dedicated thread.  No need to send out multiple times :)

Be Well
Anthony


Reply all
Reply to author
Forward
0 new messages