Skip to content

Commit

Permalink
Add FDTallyGradAux docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearkevin committed Jan 26, 2025
1 parent 9179c3e commit 916c031
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doc/content/bib/cardinal.bib
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,13 @@ @inproceedings{eltawila
booktitle = {Proceedings of Physor},
year = 2024
}

@article{stolte,
title = {{χ-MeRA}: Computationally efficient adaptive mesh refinement of Monte Carlo mesh based tallies},
journal = {Annals of Nuclear Energy},
volume = {182},
pages = {109617},
year = {2023},
doi = {https://doi.org/10.1016/j.anucene.2022.109617},
author = {K. N. Stolte and P. V. Tsvetkov}
}
27 changes: 27 additions & 0 deletions doc/content/source/auxkernels/FDTallyGradAux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# FDTallyGradAux

## Description

`FDTallyGradAux` approximates tally gradients using forward finite differences between the current element and it's neighbors.
The approach used is based on the derivative approximation presented in [!cite](stolte):

\begin{equation}
\label{tally_grad}
\vec{\nabla}u(\vec{x}_{i}) \approx Y_{i}^{-1}\sum_{i'} \frac{\vec{x}_{i'} - \vec{x}_{i}}{||\vec{x}_{i'} - \vec{x}_{i}||}\frac{u(\vec{x}_{i'}) - u(\vec{x}_{i})}{||\vec{x}_{i'} - \vec{x}_{i}||}\text{,}
\end{equation}
\begin{equation}
\label{tally_grad_Y}
Y_{i} = \sum_{i'} (\vec{x}_{i'} - \vec{x}_{i})\otimes (\vec{x}_{i'} - \vec{x}_{i}) \text{,}
\end{equation}
where $i$ indicates the current element, $i'$ is a neighboring element, $\vec{x}$ is an element's centroid, and $u$ is the tally field. A tally `score` must be specified, and if any external filter bins have been added through the use of the [filter system](AddFilterAction.md) `ext_filter_bin` index should be provided.

## Example Input Syntax

This example showcases how `FDTallyGradAux` can be used to approximate the gradient of `kappa_fission`:

!listing test/tests/neutronics/tally_grad/finite_diff/openmc.i
block=AuxKernels

!syntax parameters /AuxKernels/FDTallyGradAux

!syntax inputs /AuxKernels/FDTallyGradAux

0 comments on commit 916c031

Please sign in to comment.