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.
Sampleshttps://github.com/critcel/penmsh/blob/master/case/04_overlay/ove_z1cm.pnghttps://github.com/critcel/penmsh/blob/master/case/01_hexagon/he3_z1cm.pnghttps://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.penModel (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.mcBasically 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.