neams-th-coe / cardinal

High-Fidelity Multiphysics
https://cardinal.cels.anl.gov/
Other
84 stars 39 forks source link

Tally and Domain Filter Editor UOs #923

Open pshriwise opened 1 week ago

pshriwise commented 1 week ago

This adds a UserObject for editing OpenMC Tally and some Filter objects. The order of execution in OpenMCProblemBase should ensure they can be used in conjunction to create custom, controllable tallies in a Cardinal input file (for the set of filters supported, see below).

OpenMCTallyEditor

This UO can be used to either edit an existing tally object or create a new one via the Cardinal input file. A tally's scores, nuclides, filters (set by ID) can all be specified in the input file. These parameters can also be controlled using the MOOSE control system. The tally's multiply_density attribute, governing whether or not tally results are multiplied by atom density, can be set as well, but as this is used less often it is set to false by default. multiply_density can also be controlled via the MOOSE control system. Other parameters are required.

If the create_tally parameter of an OpenMCTallyEditor object is true and a tally already exists with the specified ID, a warning is shown. If create_tally is false and a tally with the specified ID doesn't exist, an error is raised.

The tally UO provides functionality that can replace the OpenMCTallyNuclides and I've done so in this PR. I'm not sure that deprecation of the existing OpenMCTallyNuclides object is necessary given its short lifetime, but I'm happy to provide that here.

OpenMCDomainFilterEditor

The domain filter editor allows for the creation of tally filters and modification of their associated bins (by cell/material/universe/mesh ID). Like the tally properties above, filter bins can be set in the input file and modified between OpenMC executions as part of the MOOSE control system.

The supported filter types for this UO include: CellFilter, MaterialFilter, UniverseFilter, and MeshFilter. These are all spatial/domain filters that have the same generic bin structure and are important for depletion/activation workflows that may be attached to Cardinal multiphysics problems.

The filter editor UO is complicated by the necessity of a filter type. Additional checks have been added that ensure:

TODO:

moosebuild commented 1 week ago

Job Documentation on 1abc503 wanted to post the following:

View the site here

This comment will be updated on new commits.

moosebuild commented 1 week ago

Job Coverage on 1abc503 wanted to post the following:

Coverage

5bbda6 #923 1abc50
Total Total +/- New
Rate 93.55% 93.43% -0.12% 89.57%
Hits 7265 7413 +148 189
Misses 501 521 +20 22

Diff coverage report

Full coverage report

Warnings

This comment will be updated on new commits.

moosebuild commented 1 week ago

Job Precheck on 608b6eb wanted to post the following:

Your code requires style changes.

A patch was auto generated and copied here
You can directly apply the patch by running, in the top level of your repository:

curl -s https://mooseframework.inl.gov/cardinal/docs/PRs/923/clang_format/style.patch | git apply -v

Alternatively, with your repository up to date and in the top level of your repository:

git clang-format 0ba4efdc6ff4b54ffb7af359678410e93dd0c75e