Skip to content

XDG Mesh Geometry - #4215

Draft
pshriwise wants to merge 38 commits into
openmc-dev:developfrom
pshriwise:xdg-geom
Draft

pshriwise wants to merge 38 commits into
openmc-dev:developfrom
pshriwise:xdg-geom

Conversation

@pshriwise

@pshriwise pshriwise commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR adds the ability to apply UnstructuredMesh objects using the 'xdg' interface as geometry (for both surface meshes and volumetric meshes).

There is still some work to be done here but I wanted to open the PR sooner rather than later and keep momentum moving after #3889.

Surface Mesh

XDG can support both DAGMC (MOAB .h5m) and libMesh files for surface mesh. This capability effectively behaves like DAGMC with the double-down plugin enabled. That capability comes built-in, however, and does not require building an additional piece of software. As in the case of DAGMC+double-down, the Embree library is still required.
The specification for .h5m files is the same as that of DAGMC to allow DAGMC users to easily transition to the more streamlined software stack that XDG provides.

For libMesh, material assignment metadata relies on mesh block data (subdomain IDs). Boundary conditions are handled somewhat specially. Information on the expected file format can be found here. This file format is new and may be subject to minor changes as it gets exercised by the community.
libMesh meshes in neutronics applications are almost always volumetric meshes. These meshes can be used as surface mesh, similar to that of DAGMC models, where the boundary faces of blocks are treated as geometric boundaries. These internal block interfaces are resolved automatically and sideset boundary conditions applying across sets of faces adjacent to multiple blocks are resolved appropriately.

Significantly, this applies to libMesh meshes composed of either tetrahedra or hexahedral geometry, making this meaningful for many MOOSE reactor geometries to a degree – prism6 element types and support for mixed element types is on its way.

Volumetric Mesh

This PR also introduces the ability to treat volumetric meshes as geometry wherein each element of a mesh is treated as a geometric region with its own properties (i.e. material, density multiplier, temperature, etc.).
This provides an ability to apply OpenMC calculations for geometry representations in workflows like that of Attila4MC and applies to both tetrahedral and hexahedral meshes as well.

Volumetric meshes can also be as hybrid geometry in the same way that surface mesh can be applied where meshes are used to fill CSG cells or are applied in lattices.

Verification

Users are encouraged to execute (and share!) their own verification exercises in comparison to DAGMC geometry using both the MOAB and libMesh formats.

Surface mesh – comparison against DAGMC + double-down

Models

Three well-trusted (i.e. watertight and topologically well-formed) DAGMC models were used for comparison. Results for each model can be examined in the link above by selecting the model from the dropdown menu.

  • Advanced test reactor (ATR): 5900 volumes; 28k surfaces; 5M triangles
    This model has a CSG counterpart was used as verification for the initial implementation of DAGMC in OpenMC (https://www.ans.org/pubs/transactions/article-48262/)

  • Molten Salt Reactor Experiment (MSRE): 106 volumes; 23k surfaces; 13M triangles
    This model has a CSG counterpart, applies hybrid CSG/CAD geometry, and was studied extensively in the following publication: https://doi.org/10.3389/fnuen.2024.1385478

  • Tokamak: 20 volumes; 243 surfaces; 7.1M triangles
    This model has been used in several DAGMC tutorials including our example notebooks and this Coreform DAGMC tutorial: https://www.youtube.com/watch?v=2TzgTQidfwk

Performance and flux results for all of these runs can be examined on the benchmarking site we've been using:

https://xdg-benchmarking-site.onrender.com/?run=20261030_200432&run=20261103_151250&model=atr&exe=dd&exe=xdg&metric=active

Results

Each of these models shows identical flux results when using the CCFE-1024 group structure (not intended for fission spectra, but a fine group structure to perform comparisons). The results between XDG and DAGMC+double-down are identical. This is expected as the implementation of the two are the same, but with double-down now into XDG.
Performance

Threaded performance shows the same characteristics as that of DAGMC+double-down as well for all three models.

Volumetric mesh

I'll add comparison against MCNP 6.2 calculations here soon. I'm still working on a comprehensive analysis of a couple of models.

All results shown below were performed using ENDF/B VIII.0 LANL-based data.

Void Sphere

This model is a simple tet mesh of a sphere centered on the origin with radius 10 cm inside a CSG box with vacuum boundary conditions. The mesh consists of 4516 tets.

image

With 10M particles the results between OpenMC and MCNP are consistent with one another.

image image image

Iron Sphere

The same geometry was applied but using iron in the sphere. Similar agreement is reflected in the comparison of the OpenMC and MCNP results.

image image image

Nested spheres problem

The following test case is a set of nested spheres modeling on octant of a prototypic fusion wall with reflecting boundary conditions applied at the lower x, y, and z planes. The geometry is as shown

um-demo-problem

The mesh is contiguous (no gaps or overlaps) and composed of 61,484 elements.

The following are rough statistical analysis of the results between MCNP 6.2 and OpenMC

  compared 61480 of 61484 elements (4 excluded with a zero mean)
  rel_diff: mean +0.0238, min -0.7481, max +55.7899
  |OpenMC - MCNP| / combined std. dev.:
    within 1 sd :  38210   62.15%  (normal: 68.27%)
    within 2 sd :  55729   90.65%  (normal: 95.45%)
    within 3 sd :  60309   98.10%  (normal: 99.73%)
    outside 3 sd:   1171    1.90%  (normal: 0.27%)
image

Volumetric mesh capabilities apply to hexahedral meshes as well:

image
  • Upcoming work
  • Mixed element types in XDG
  • Arbitrary XDG cell fills (e.g. TRISO regions or other CAD models/components)

AI Assistance

AI was used for debugging a few software engineering/build issues throughout the development of this process.

  • Harness: Codex
  • Model: GPT-6-Sol
  • Reasoning effort: Medium

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 18) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pshriwise pshriwise changed the title Xdg geom XDG Meshes Geometry Nov 4, 2026
@pshriwise pshriwise changed the title XDG Meshes Geometry XDG Mesh Geometry Nov 6, 2026
@pshriwise pshriwise added the cpp-format-suggest Trigger C++ format suggestions label Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Noting here that materials are added to this input file because it was switched from the model using UWUW materials to the DAGMC file (same mesh) sans UWUW material specifications. Expected results for this test did not need to change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cpp-format-suggest Trigger C++ format suggestions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant