Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First Collision Source Method (FCS) #3114

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from

Conversation

tpaganin
Copy link

@tpaganin tpaganin commented Aug 9, 2024

Description

This PR introduces the First Collision Source method (FCS) as a preprocessing stage for the Random Ray solver (TRRM) that will allow full usage of the user-defined source capabilities for fixed-source calculations already existent in OpenMC. FCS works as a preconditioner of the source, distributing the source contribution throughout the domain. This PR implements feature request #3011 as part of the Random Ray FW-CADIS project. This method is not new (Alcouffe) and has already been widely implemented in several recent other codes (Ragusa, Falabino).

The FCS works by generating uncollided neutron angular fluxes at the user-defined source that travel through the domain interacting with the media, being naturally attenuated in the process. Neutrons that experience any collision are treated as first collided neutrons and will be used to estimate the volumetric neutron fixed source at that cell. Once the FCS preprocess stage is complete, the fixed volumetric source will be added to each iteration of the random ray solver. The remaining uncollided flux that has not interacted at any point of the preprocessing stage is added to the final solution at the end of the neutron transport code.

Complexities

This simulation step executes two ray tracing methods: one for uncollided and first-collided fluxes calculation and another for initial volume estimation. Both algorithms are added inside of the function: first_collision_source_simulation();.

Uncollided and first collided fluxes

The ray tracing for flux calculation is executed differently than the current Random Ray solver as it doesn't have active and inactive lengths. The rays in FCS will travel through the system until they reach a vacuum BC or have their angular flux reduced below a certain negligible threshold value. The storing and calculation of first-collided rays into fixed-source is conducted similarly to regular angular flux in the original Random Ray solver.

  • The amount of rays has a significant impact on the accuracy of the end solution, but a certain threshold can be reached where the solution becomes insensitive to additional rays.
  • An automatic method to set the number of uncollided rays used was developed and provided as the default option. This automatic method is guided by the increase of cells hit by additional rays. Users can bypass the automatic method by determining the amount of rays they want to use.

The volumetric source obtained from these calculations is normalized by the number of rays used and scaled by its respective source strength.

Initial Volume Estimation

The volumetric source is required to be scaled by the cell volume. This requires an estimation of the volume of each cell with a source. Therefore, there is an initial ray tracing stage (same transport mode in Random Ray solver) to estimate the cell volume using tracklengths.

  • This estimation cannot be done during the FCS calculation due to spatial bias in the ray generation.
  • To improve performance, the fixed-source contribution is re-scaled by an updated volume estimation in each batch of the Random Ray solver (online volume estimation).
  • Linear source requires calculating angular flux moments that depend on the estimated cell's spatial moments and centroids. If a poor initial estimation is made, inaccurate gradients will be carried throughout the calculation and impact the accuracy of the method.

Prob_actual()

Unlike the Monte Carlo method, FCS and Random Ray solver are required to generate rays with multiple energy groups simultaneously. The generation of each ray will call the normalized user-provided distribution for the energy groups of the source as prob_actual_() from the external_sample_source().
The prob_actual_ variable had to be added so the user-provided energy distribution would be preserved and easily accessed before being altered by Vose's method. This has no impact on previous eigenvalue calculations but could cause errors in the previous fixed-source Random Ray solver and FCS.

Validation

The first test conducted was the simulation of the Kobayashi dog leg problem. The neutron flux was evaluated in each tally for the FCS-TRRM solution in comparison to OpenMC's Multi Group Monte Carlo (MGMC) solution. The domain is discretized in 1 [cm] side cubic cells. One can see in Figure 1 that there is general agreement between the two methods.

table_1

Figure 2 provides another look into the Kobayashi dog leg problem, focusing on the relative error and variance from different TRRM simulations in relationship to a TRRM reference solution for the neutron flux. The simulations were: TRRM and FCS-TRRM with flat and linear sources. For the case of FCS-TRRM, it was used 128,000 uncollided rays and 30,000 rays for initial volume estimation. These solutions used 1000 inactive batches, 200 active batches, 15000 rays/batch, 100 [cm] inactive ray length, and 400 [cm] active ray length. The domain is discretized in 1 [cm] side cubic cells. The reference solution was provided using the Monte Carlo existent in OpenMC. The average values for the relative error and variance are also provided at the bottom of Figure 2.

It is visible that FCS-TRRM provided overall smaller error and variance for both flat ($0.845%$ and $0.279 %$) and linear sources ($0.695%$ and $0.281 %$), compared to TRRM, which had flat ($1.022%$ and $0.757 %$) and linear source ($1.025%$ and $0.757 %$). The source type (flat and linear) had no impact on the variance, but the addition of the first collision source mode caused a 3x reduction factor.

table_1

It was evaluated how many rays the FCS-TRRM method would require in the Kobayashi Dog Leg problem (with 1 [cm] side cubic cells, 100 inactive and 100 active batches) to provide an accurate solution. Figure 3 presents the average relative error between the FCS-TRRM and the MGMC solution and the percentage of cells hit by the uncollided rays. As the amount of uncollided rays increases, the average error of the tallies reduces to a certain level slightly below the TRRM error. This region is reached as the percentage of cells hit approaches 100%.

table_1

An automatic method using the number of cells hit by uncollided rays was developed. Firstly the method generates some rays, checks for amount of cells hit, and accumulates the contributions on each cell's fluxes. If newer cells were discovered, the algorithm generates more rays until it reaches a maximum value or no newer cells were discovered.

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)

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.

1 participant