Skip to content

Conversation

@gonuke
Copy link

@gonuke gonuke commented Sep 16, 2025

Adds an additional parameter to the criticality search base class that allows a user to specify an optional value for the target k_eff used in the search. A default of 1.0 is provided and it is required to be greater than 0 (including a test).

{
auto params = MooseObject::validParams();
params += OpenMCBase::validParams();
params.addParam<Real>(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
params.addParam<Real>(
params.addRangeCheckedParam<Real>(

params.addParam<Real>(
"keff_target",
1.0,
"Target value of k_eff for the criticality search.");
Copy link
Owner

@aprilnovak aprilnovak Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Target value of k_eff for the criticality search.");
"keff_target > 0", "Target value of k_eff for the criticality search.");

_tolerance(getParam<Real>("tolerance")),
_estimator(getParam<MooseEnum>("estimator").getEnum<eigenvalue::EigenvalueEnum>())
{
if (_keff_target <=0 )
Copy link
Owner

@aprilnovak aprilnovak Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the addRangeCheckedParam will automatically enforce the same restriction, so that we wouldn't need a test case to cover the error message.

requirement = 'The system shall error if a criticality search is not paired with the correct problem class.'
capabilities = 'openmc'
[]
[negative_keff_target]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a test case, would you please add one that uses the keff_target feature and confirms the criticality search behaves as expected?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aprilnovak - it's not clear to me how to best get the gold reference results. I created this file with made up data just to get all the plumbing right.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably easiest to use the inputs for the k=1 search tests in neams-th-coe#1184 and run it with Cardinal to de a search locally with your target value, which will create the gold csv below with the correct values

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that using keff=1 quite demonstrates the added capability.

Would it be in scope to change the way the tests are formatted for criticality so that we could include the OpenMC search code as well as the normal model building script? If we did that, it would be simple to change the value of keff that is used in the OpenMC search, using files that were committed to this repo.

In short, I would:

  1. reformat https://github.com/aprilnovak/cardinal/blob/criticality-search/test/tests/criticality/material_density/make_openmc_model.py to be mostly in a function that is called by some main function when use as a stand alone function and produce the XML, just as it does now
  2. add a python script that implements the search for keff by calling this function, and takes a value of keff as a command-line option, defaulting to 1.0
  3. Commit all of those to the repo
  4. Run this for keff!=1 and add a gold result for that output

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if my suggestion was clear but I meant to use the files that already exist at test/tests/criticality/borated_water from neams-th-coe#1184 as a base and add the keff_target variable with some non-one value to the openmc.i's [CriticalitySearch] block (e.g. keff_target = 0.95) and then locally run cardinal-opt -i openmc.i, which should produce the correct csv you need for the gold directory.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I still need to confirm that it's sufficiently similar to what OpenMC would produce under the same circumstances....

@lewisgross1296
Copy link

I should get a chance to test the code from today later this week and confirm the gold file lines up with a local standalone OpenMC search

@aprilnovak aprilnovak force-pushed the criticality-search branch 3 times, most recently from ea3c7c9 to ff0e44e Compare October 27, 2025 01:47
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.

3 participants