-
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
Tally and Domain Filter Editor UOs #923
Open
pshriwise
wants to merge
60
commits into
neams-th-coe:devel
Choose a base branch
from
pshriwise:tally_uos
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 55 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
56d86f6
A start to creating tallies with UOs
pshriwise ba4f527
Initial cut at at UserObject for tally generation
pshriwise 1ca6ee9
Adding tally generator uo in a new spot
pshriwise 4a1cf4f
Moving to reliance on a tally generator user object
pshriwise e260d8c
Moving to rely on tally generator user object
pshriwise 003e4a9
push for logan
pshriwise 31fe02f
Updating tally generator UOs to handle updates as well.
pshriwise e81626b
Name change. QOL funcs
pshriwise 54d5181
One more name change
pshriwise 8ef4c2e
Adding a domain filter editor
pshriwise e2f571c
Updating openmc_xml test files for now
pshriwise 6512da4
Including a parameter for multiplication by atom density
pshriwise 19c8ced
Removing tally generator action
pshriwise a283225
Reverting changes to the openmc_xml test
pshriwise 9305b5e
Updating copywrite year.
pshriwise 2c2d322
Added error checking. Changing timing of tally ID check.
pshriwise 371440c
Updates to tests to use the tally editor instead of tally nuclides
pshriwise 996544c
Some quick self-review
pshriwise f041ba8
Renaming test dir for tally editor
pshriwise 5c73d9a
Removing OpenMCTallyNuclidesUO
pshriwise 207c6b9
Missed some changes
pshriwise 62f10d9
Applying style guide patch
pshriwise fe8630b
Start of docs
pshriwise 6460bd1
Adding new test and reorganizing inputs
pshriwise b0307b5
Use the filter_index method
pshriwise 85cc7b2
More tests for filters
pshriwise ddb6224
Adding filter tests
pshriwise 22f52e0
Adding new tests and correcting filter editor constructor code
pshriwise a366788
Creating a base class for OpenMC user objects
pshriwise 2ecf25d
Formatting test input files
pshriwise 47db4a7
OpenMC user object source file formatting
pshriwise 7618cbb
Applying style guide
pshriwise 2f6a120
Updating documentation for object editor UOs
pshriwise cb8b75c
Updates to control, checks, and execution of OpenMC editor UOs
pshriwise d41464c
Adding tests for clashing editor IDs
pshriwise 04cca8f
Adding test for invalid tally score
pshriwise 58e83db
Adding an XML tally to test clashes with existing filter types.
pshriwise 3747b05
New test for clashing type with existing filter.
pshriwise 37513d7
CI trigger
pshriwise adf7948
Test input file formatting
pshriwise ced4b2a
Source formatting
pshriwise cd6a8f7
Correcting filter editor UO class name in docs
pshriwise cd6904c
Updating comment on allowed filter types
pshriwise 06c9caa
Moving _first_execution into base class
pshriwise 3a1fe15
Factoring out first_execution method into base object
pshriwise 89daf68
Use UO console
pshriwise bcdf830
Changing filter type attribute to an enumerator
pshriwise 9ede8c3
EOL for cardinal enums src file
pshriwise b5533af
CI trigger
pshriwise 2a37b87
CI trigger
pshriwise 7f3a512
Updating expected behavior and test files
pshriwise 9e7b3b6
Breaking up the current tallies section a bit. Adding a section on ta…
pshriwise 9646b61
Remove commented section
pshriwise 6f16ad3
Style guide fix
pshriwise 8ea3dbc
Style fix
pshriwise 50715ec
Clarifying use case for Tally/Filter editors.
pshriwise c578788
Removing unused OpenMCDomainFilter::_allowed_types attribute
pshriwise b25c149
Ensuring that TallyEditor IDs don't overlap with Cardinal-mapped tallies
pshriwise c0d8a83
Formatting
pshriwise 107d06f
Adding new test input file
pshriwise 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
20 changes: 20 additions & 0 deletions
20
doc/content/source/userobjects/OpenMCDomainFilterEditor.md
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,20 @@ | ||
# OpenMCDomainFilterEditor | ||
|
||
!syntax description /UserObjects/OpenMCDomainFilterEditor | ||
|
||
## Description | ||
|
||
This user object can be used to create or control new domain filter in OpenMC. | ||
Currently suppored filter types are specified under the "filter_type" parameter. | ||
The filter bins are set using domain ID(s) in the OpenMC model. | ||
|
||
## Example Input Syntax | ||
|
||
!listing test/tests/userobjects/openmc_tally_editor/add_filter.i | ||
block=UserObjects | ||
|
||
!syntax parameters /UserObjects/OpenMCDomainFilterEditor | ||
|
||
!syntax inputs /UserObjects/OpenMCDomainFilterEditor | ||
|
||
!syntax children /UserObjects/OpenMCDomainFilterEditor |
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,25 @@ | ||
# OpenMCTallyEditor | ||
|
||
!syntax description /UserObjects/OpenMCTallyEditor | ||
|
||
## Description | ||
|
||
This user object can be used to change the nuclides, filters, and scores on a | ||
given OpenMC tally. This object is primarily used for facilitating depletion | ||
coupling of OpenMC to MOOSE, where we need to register new tallies with | ||
controllable parameters to account for changing compositions during depletion. | ||
|
||
## Example Input Syntax | ||
|
||
Below is an example which will create an OpenMC tally with controllable parameters | ||
tally to only obtain the fission heating from U-238 (ignoring the | ||
portion from U-235 in this particular tally). | ||
|
||
!listing test/tests/userobjects/openmc_tally_editor/nuclide_absorption.i | ||
block=UserObjects | ||
|
||
!syntax parameters /UserObjects/OpenMCTallyEditor | ||
|
||
!syntax inputs /UserObjects/OpenMCTallyEditor | ||
|
||
!syntax children /UserObjects/OpenMCTallyEditor |
This file was deleted.
Oops, something went wrong.
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,70 @@ | ||
/********************************************************************/ | ||
/* SOFTWARE COPYRIGHT NOTIFICATION */ | ||
/* Cardinal */ | ||
/* */ | ||
/* (c) 2024 UChicago Argonne, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/* */ | ||
/* Prepared by UChicago Argonne, LLC */ | ||
/* Under Contract No. DE-AC02-06CH11357 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* Prepared by Battelle Energy Alliance, LLC */ | ||
/* Under Contract No. DE-AC07-05ID14517 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* See LICENSE for full restrictions */ | ||
/********************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include "OpenMCUserObject.h" | ||
|
||
#include "CardinalEnums.h" | ||
|
||
// forward declarations | ||
class OpenMCProblemBase; | ||
|
||
/** | ||
* User object to create and/or modify an OpenMC tally filter for a limited set of domain types. | ||
*/ | ||
class OpenMCDomainFilterEditor : public OpenMCUserObject | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
OpenMCDomainFilterEditor(const InputParameters & parameters); | ||
|
||
/// Virtual method overrides | ||
virtual void execute() override; | ||
virtual void initialize() override; | ||
virtual void finalize() override {} | ||
|
||
/** | ||
* Get the index of the filter in OpenMC's data space | ||
*/ | ||
bool filter_exists() const; | ||
|
||
/** | ||
* Return the index of the filter in the OpenMC data space | ||
*/ | ||
int32_t filter_index() const; | ||
|
||
/** | ||
* Check that this object's filter type is valid and matches the type in the OpenMC data space | ||
*/ | ||
void check_filter_type_match() const; | ||
|
||
std::string filterTypeEnumToString(OpenMCFilterType t) const; | ||
OpenMCFilterType stringToFilterTypeEnum(const std::string & s) const; | ||
|
||
std::string long_name() const { return "OpenMCDomainFilterEditor \"" + this->name() + "\""; } | ||
|
||
// Accessors | ||
int32_t filter_id() const { return _filter_id; } | ||
|
||
protected: | ||
int32_t _filter_id; | ||
OpenMCFilterType _filter_type; | ||
const std::set<std::string> _allowed_types{"cell", "universe", "material", "mesh"}; | ||
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. Convention is to use a MooseEnum if possible |
||
}; |
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,54 @@ | ||
/********************************************************************/ | ||
/* SOFTWARE COPYRIGHT NOTIFICATION */ | ||
/* Cardinal */ | ||
/* */ | ||
/* (c) 2024 UChicago Argonne, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/* */ | ||
/* Prepared by UChicago Argonne, LLC */ | ||
/* Under Contract No. DE-AC02-06CH11357 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* Prepared by Battelle Energy Alliance, LLC */ | ||
/* Under Contract No. DE-AC07-05ID14517 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* See LICENSE for full restrictions */ | ||
/********************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include "OpenMCUserObject.h" | ||
|
||
// forward declarations | ||
class OpenMCProblemBase; | ||
|
||
/** | ||
* User object to modify an OpenMC tally | ||
*/ | ||
class OpenMCTallyEditor : public OpenMCUserObject | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
OpenMCTallyEditor(const InputParameters & parameters); | ||
|
||
bool tally_exists() const; | ||
|
||
// get the index of the tally in OpenMC's data space, creating it if necessary according to the | ||
// input parameters | ||
int32_t tally_index() const; | ||
|
||
/// We don't want this user object to execute in MOOSE's control | ||
virtual void execute() override; | ||
virtual void initialize() override; | ||
virtual void finalize() override {} | ||
|
||
std::string long_name() const { return "OpenMCTallyEditor \"" + this->name() + "\""; } | ||
|
||
// Accessors | ||
int32_t tally_id() const { return _tally_id; } | ||
|
||
protected: | ||
int32_t _tally_id; | ||
}; |
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
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
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.
I would recommend revising this section of the documentation to make it clear to the user that mapped tallies cannot be modified by either
OpenMCTallyEditor
orOpenMCDomainFilterEditor
.