Skip to content

Conversation

magnoxemo
Copy link
Contributor

@magnoxemo magnoxemo commented Aug 27, 2025

Description

This PR implements the mesh tally amalgamation algorithm.

If the user wants to do mesh tally amalgamation from cardinal side they will set the _amalgamation = true. Then It will create a hash map of elements point to the first element of the cluster. If any element isn't part of a cluster it will point to itself.

If a reaction happens in any of the element of a cluster, when OpenMC quires the libMesh mesh for tallying it will send the bin we have at the first element in that cluster(using the hash map) . From cardinal side then, the tally score from the first element will be pulled and stored in the all elements in the cluster.

closes #3552

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) 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)

more about this is here PR

magnoxemo and others added 2 commits August 27, 2025 12:20
* fix constructor issue

* not avoiding code repetation

* addressing suggestion from @gonuke

* addresing suggestions

* fix cluster_element_integer_index_ name

* better variable name

* better variable name

* fix get bin from elem method

* api change

* API change

* allow mesh amalgamation with/without AMR
@magnoxemo magnoxemo force-pushed the mesh_tally_amalgamation branch from 56c91ab to fb663fd Compare August 29, 2025 15:24
@magnoxemo
Copy link
Contributor Author

primary result from Cardinal side:

We will cluster elements together for tallying if the previous OpenMC solution has

  • higher relative error and
  • Almost the same flux (relative error between two adjacent bin 0.001)

OpenMC run 1:

image

amlgamating elements for tallying together:

image

OpenMC solution after mesh tally amalgamation:

image

I think it's ready for review

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.

adding mesh tally amalgamation algorithm
1 participant