adding mesh tally amalgamation algorithm
Description
Libmesh only supports isotropic refinement which means if there is a bigger quad element it be eight smaller quad in the next step (for AMR ). But there are cases where we might want to do tally in a complex shape element. This is basically treating a part some of the smaller elements to be treated one bin.
Algorithm
Now let's say I have a mesh that looks like this
+---------------+
| a | c |
|------ |----
| b | d |
+--------------+
But our clustering algorithm wanted to treat a, b, d together as one single element and changed their extra element integer id to 0 ( as a is the first element which' element id = 0 ).
+-----------------+
| a | c |
| |---- |
| b d |
+----------------+
From openmc side, every time a collision happens in a, b or d we can just check
if ( cluster_id != -1 ){
# that means part of a cluster
bin = get_bin_from_element( mesh.elem_ptr( cluster_id ) )
}
That mean all the scores in a, b and d gets accumulated in a (even though b and d will remain zero but we can fill the solution later ). Then open mc transfer the solution to cardinal. where we can do,
if ( cluster_id != -1 ){
# that means part of a cluster
#get the first element in that cluster
first_element_in_that_cluster = get_score_from_element( mesh.elem_ptr( cluster_id ) )
#get score from the first element
tally_score = get_score (first_element_in_that_cluster)
#store the result in the current element
fill_aux_variable( _current_element)
}
But another concern we are reconstructing the raw tally to any meaning full score we need to normalize it and divide it by the volume, in this case $v_a+ v_b + v_d$ so need to adjust that here as well.
This over all design is dependable with cardinal frame work.