-
Notifications
You must be signed in to change notification settings - Fork 47
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
Addition of a tally system and [Tallies]
block
#931
Merged
Merged
Changes from 43 commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
56fab08
Added new tally objects
nuclearkevin 6983e46
Fixed a bug when adding tallies
nuclearkevin e23b23f
Fix CellTally errors
nuclearkevin ec7886b
Partially integrated the new Tallies with OpenMCCellAverageProblem
nuclearkevin 347084a
Completed integration with OpenMCCellAverageProblem
nuclearkevin d30a641
Updated in-source documentation
nuclearkevin 7584839
Fixed additional bugs and added missed errors back in
nuclearkevin b5e9993
Updated test input file syntax to use the [Tallies] block
nuclearkevin a708059
Updated documentation to add the tally system
nuclearkevin 8369b25
Removed prefixing parameter
nuclearkevin 03c0523
Remove duplicated functions
nuclearkevin b7cef49
Missed test syntax
nuclearkevin bda4d3c
Tally system errors and warnings
nuclearkevin a9ead38
Added the tally score to variable mapping console output back in
nuclearkevin 9632a78
Added tally system tests
nuclearkevin 9e32946
Fixed one test failing
nuclearkevin 349842f
Added missing test xml files
nuclearkevin f880b7a
Updated tutorials
nuclearkevin 17e495a
Removed unnecessary virtual function in TallyBase
nuclearkevin 75cf9b7
Merge branch 'neams-th-coe:devel' into tally_system
nuclearkevin 290f86f
Style changes
nuclearkevin c400557
Fixed a failing test
nuclearkevin a1c2ca7
Trigger tests
nuclearkevin 3f37075
Changed global normalization to work on a per tally basis
nuclearkevin 5b03db3
Removed outdated tests
nuclearkevin 2d7c1f4
Updated docs to remove mentions of 'global_tally_estimator'
nuclearkevin 073899d
Updated tests to account for the removal of global_tally_estimator
nuclearkevin 343f8d3
Added news article for July 2024
nuclearkevin 1211c1c
Style changes
nuclearkevin 166ce32
Merge branch 'neams-th-coe:devel' into tally_system
nuclearkevin 7958848
Changed outputs to work on a per-tally basis
nuclearkevin 29a4aa4
Updated tests to account for moving outputs to TallyBase
nuclearkevin 3c4478d
Updated tutorials to account for moving outputs to TallyBase
nuclearkevin b7abc9a
Updated docs to account for moving outputs to TallyBase
nuclearkevin 100bde3
Added a new test for multiple tallies with different outputs
nuclearkevin b5a6bed
Style changes
nuclearkevin 7b70425
Changed syntax to Problems/Tallies/...
nuclearkevin 360013a
Updated tests to the Problems/Tallies/.. syntax
nuclearkevin 6c86c17
Updated tutorials to the Problems/Tallies/.. syntax
nuclearkevin 01f6d06
Updated docs to the Problem/Tallies/.. syntax
nuclearkevin 4990835
Removed the last mentions of '_tally_type'.
nuclearkevin 75f9c9e
Fixed formatting in the July 2024 news entry
nuclearkevin 6f9fca2
Merge branch 'neams-th-coe:devel' into tally_system
nuclearkevin 640b0fd
Removed remnants of the old tally system
nuclearkevin 7cb6ed6
Fix documentation errors
nuclearkevin 517ddf8
Added extra tally system tests
nuclearkevin b8aaae2
Fixed MeshTally test errors
nuclearkevin 3b0b861
Fix MeshTally tests when using a distributed mesh mirror
nuclearkevin 7b17dde
Merge branch 'neams-th-coe:devel' into tally_system
nuclearkevin e9696f6
Shortened tally parameter names to decrease input file verbosity
nuclearkevin b7ecd31
Fixed new syntax errors
nuclearkevin 65b6e38
Updated tests to shortened tally syntax
nuclearkevin 6fd69bc
Updated tutorials to shortened tally input syntax
nuclearkevin 2e58831
Updated documentation to shortened tally input syntax
nuclearkevin f7c3bd9
Style changes
nuclearkevin 3cb5900
Added mapped volume checking to the multiple CellTally test
nuclearkevin ba68587
Decreased test gold file size.
nuclearkevin e748da0
Merge branch 'neams-th-coe:devel' into tally_system
nuclearkevin e30a38b
Changed pure CellTally tests to CSVDiffs
nuclearkevin 3885d41
Remove skinner outputs
nuclearkevin 73fae49
Update .gitignore to ignore .gz files (skinner outputs)
nuclearkevin 1b7792c
Merge branch 'devel' into tally_system
nuclearkevin f437846
Updated the tokamak tutorial to use the new [Tallies] syntax.
nuclearkevin 72072c6
Reduce code duplication in tally classes.
nuclearkevin d276d1c
Style changes
nuclearkevin db0d7aa
Merge branch 'neams-th-coe:devel' into tally_system
nuclearkevin 112309d
Removed mention of tally_type from warnings
nuclearkevin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# July 2022 News | ||
|
||
- A new [tally system](/actions/AddTallyAction.md) and an accompanying input syntax | ||
block have been added to Cardinal | ||
- The tally parameters found in [OpenMCCellAverageProblem](/problems/OpenMCCellAverageProblem.md) | ||
have been deprecated in favor of this new tally system. | ||
|
||
- Existing input files written with the previous tally syntax will no longer run | ||
|
||
The main advantages of the new tally system is the ability to add multiple tallies with different | ||
spatial binning schemes for different scores. As an example, you can add a [CellTally](/tallies/CellTally.md) | ||
with a heating score and a [MeshTally](/tallies/MeshTally.md) with a flux score: | ||
|
||
!listing actions/multi_tally_example.i | ||
block=Problem | ||
|
||
Other advantages include: | ||
|
||
- Being able to specify tally triggers on a per-tally basis; | ||
- The option to apply block restrictions to different [CellTally](/tallies/CellTally.md) | ||
scores; | ||
- Additional flexibility when it comes to adding new tally filters in the future. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# AddTallyAction | ||
|
||
!alert note | ||
`AddTallyAction` can only add tallies to problems which contain a [OpenMCCellAverageProblem](OpenMCCellAverageProblem.md) | ||
in the `[Problem]` block. Otherwise, attempting to add a tally will result in an error. | ||
|
||
## Overview | ||
|
||
The `AddTallyAction` action is responsible for adding local tallies to a simulation through the | ||
`[Tallies]` block in a Cardinal input file. | ||
|
||
For all requested tallies other than unstructured mesh tallies, a single tally object is added | ||
per sub-block in `[Tallies]`. When an unstructured mesh tally is requested `N` tally objects | ||
will be added, where `N` is the number of positions in `mesh_translations` / the number of positions | ||
in the file named `mesh_translations_file`. These translated mesh tallies store their scores in the | ||
same auxvariable(s), and the tally scores are normalized by the sum over all bins in the associated | ||
[OpenMCCellAverageProblem](OpenMCCellAverageProblem.md). `mesh_translations` and | ||
`mesh_translations_file` are only applicable to [MeshTally](MeshTally.md) objects. | ||
|
||
## Example Input File Syntax | ||
|
||
An example where multiple unstructured mesh tallies are added can be found below. `AddTallyAction`adds | ||
three mesh tallies, where each tally has one of the positions listed in the file named `mesh_translations_file`. | ||
|
||
!listing /tutorials/pebbles/openmc_um.i | ||
block=Problem | ||
|
||
An example of adding non-translated tallies can be found below, where both a [CellTally](CellTally.md) | ||
and [MeshTally](MeshTally.md) are added to the problem. | ||
|
||
!listing /multi_tally_example.i | ||
block=Problem | ||
|
||
!syntax list /Problem/Tallies actions=false subsystems=false heading=Available Tally Objects | ||
|
||
!syntax parameters /Problem/Tallies/AddTallyAction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[Mesh] | ||
[sphere] | ||
type = FileMeshGenerator | ||
file = mesh_in.e | ||
[] | ||
[] | ||
|
||
[Problem] | ||
type = OpenMCCellAverageProblem | ||
particles = 10000 | ||
inactive_batches = 100 | ||
batches = 1000 | ||
initial_properties = xml | ||
verbose = true | ||
cell_level = 0 | ||
|
||
normalize_by_global_tally = true | ||
check_tally_sum = true | ||
|
||
power = 100.0 | ||
|
||
source_rate_normalization = 'heating_local' | ||
|
||
[Tallies] | ||
[Mesh_Tally] | ||
type = MeshTally | ||
tally_score = 'flux' | ||
[] | ||
[Cell_Tally] | ||
type = CellTally | ||
tally_score = 'heating_local' | ||
[] | ||
[] | ||
[] | ||
|
||
[Executioner] | ||
type = Steady | ||
[] | ||
|
||
[Outputs] | ||
execute_on = final | ||
exodus = true | ||
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# CellTally | ||
|
||
!alert note | ||
`CellTally` can only be added to problems when the input files contains a [OpenMCCellAverageProblem](OpenMCCellAverageProblem.md) | ||
in the `[Problem]` block. Otherwise, attempting to add this tally will result in an error. | ||
|
||
## Description | ||
|
||
The `CellTally` class wraps an OpenMC tally with a distributed cell filter to enable data transfer | ||
from CSG cells to a [MOOSEMesh](https://mooseframework.inl.gov/source/mesh/MooseMesh.html) mirror | ||
of the OpenMC geometry. The cell to element mapping established by the [OpenMCCellAverageProblem](OpenMCCellAverageProblem.md) | ||
is used to facilitate this data transfer to the mesh mirror. When using a `CellTally`, `tally_blocks` | ||
specifies which blocks in the `[Mesh]` should be tallied. Then, any OpenMC cells that map to those | ||
blocks are added to a cell tally, with one bin for each unique cell ID/instance combination. | ||
`check_equal_mapped_tally_volumes` is used to confirm whether the elements mapped to a specific cell | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This explanation isn't quite correct - this parameter doesn't check if the mapped element volume matches the CSG cell volume. Instead, it checks that if we find 99 CSG cells to tally, that they all map to the same volume on the MOOSE side. |
||
have the same volume (to a tolerance specified in `equal_tally_volume_abs_tol`) as the associated cell. | ||
|
||
!include scores_triggers.md | ||
|
||
## Example Input File Syntax | ||
|
||
As an example, this `CellTally` scores `kappa_fission` (the default tally score) on block `0` and stores | ||
the result in a variable named `heat_source`. This corresponds to tallying the heating for three different | ||
fuel pebbles. | ||
|
||
!listing /tutorials/pebbles/openmc.i | ||
block=Problem | ||
|
||
!syntax parameters /Problem/Tallies/CellTally | ||
|
||
!syntax inputs /Problem/Tallies/CellTally | ||
|
||
!syntax children /Problem/Tallies/CellTally |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# MeshTally | ||
id=um | ||
|
||
!alert note | ||
`MeshTally` can only be added to problems when the input files contains a [OpenMCCellAverageProblem](OpenMCCellAverageProblem.md) | ||
in the `[Problem]` block. Otherwise, attempting to add this tally will result in an error. | ||
|
||
## Description | ||
|
||
The `MeshTally` class wraps an OpenMC tally with an unstructured libMesh filter to directly enable tallying on an unstructured mesh. | ||
There are two options when using a `MeshTally`: | ||
|
||
- Do nothing, in which case OpenMC will tally on the `[Mesh]` | ||
- Specify a `mesh_template`, which provides a path to a mesh file | ||
|
||
For the `mesh_template` option, it is possible | ||
to translate the same mesh to multiple locations in the OpenMC geometry | ||
(while only taking up the memory needed to store a single mesh) using | ||
the `mesh_translations` or `mesh_translations_file` parameters provided by | ||
the [tallies block](AddTallyAction.md). This is a useful feature for | ||
geometries that consist of many repeated geometry units, such as pebble bed and pin fuel | ||
systems. | ||
|
||
!alert note | ||
At present, unstructured mesh tallies are copied directly to the `[Mesh]` (without | ||
doing any type of nearest-node lookup). | ||
Suppose the mesh template consists of a mesh for a pincell with $N$ elements | ||
that you have translated to 3 different locations, giving a total of $3N$ tally | ||
bins. Because a direct copy is used to transfer the mesh tally results to the `[Mesh]`, | ||
the first $3N$ elements in the `[Mesh]` must exactly match the $3N$ elements in | ||
the mesh tally (except for a possible mesh scaling, as described in [OpenMCCellAverageProblem.md#scaling]). | ||
This equivalence is required for the direct copy to be accurate - otherwise, the | ||
mesh tally results would be transferred to incorrect regions of space. | ||
|
||
!include scores_triggers.md | ||
|
||
!alert note | ||
At present time, libMesh unstructured mesh tallies only support `collision` and `analog` estimators. Attempting to set `tally_estimator` | ||
to `tracklength` will result in a warning; the `MeshTally` will then manually reset the estimator to `collision` to prevent OpenMC from | ||
throwing an error. | ||
|
||
## Example Input File Syntax | ||
|
||
As an example, this `MeshTally` scores `kappa_fission` (the default tally score) on the unstructured mesh | ||
found in `mesh_in.e` and stores it in a variable called `heat_source`. The `[Tallies]` block adds three | ||
`MeshTally` classes, each one located at a different point specified in `mesh_translations` which corresponds | ||
to the centroid of a fuel pebble. | ||
|
||
!listing /tutorials/pebbles/openmc_um.i | ||
block=Problem | ||
|
||
!syntax parameters /Problem/Tallies/MeshTally | ||
|
||
!syntax inputs /Problem/Tallies/MeshTally | ||
|
||
!syntax children /Problem/Tallies/MeshTally |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest to replace
MOOSEMesh
byMooseMesh
to match the class name