Skip to content

Extended PCT capabilities to low pressure for YHx - #292

Open
Anthony-Bowers08 wants to merge 30 commits into
idaholab:develfrom
Anthony-Bowers08:yttrium_hydride_lowpressure
Open

Extended PCT capabilities to low pressure for YHx#292
Anthony-Bowers08 wants to merge 30 commits into
idaholab:develfrom
Anthony-Bowers08:yttrium_hydride_lowpressure

Conversation

@Anthony-Bowers08

Copy link
Copy Markdown
Contributor

(Ref. #261)

@simopier simopier self-assigned this Sep 11, 2025
@moosebuild

Copy link
Copy Markdown

Job Coverage, step Generate coverage on f0140fa wanted to post the following:

Coverage

f80c7c #292 f0140f
Total Total +/- New
Rate 91.30% 88.08% -3.22% 100.00%
Hits 1049 1049 - 42
Misses 100 142 +42 0

Diff coverage report

Full coverage report

This comment will be updated on new commits.

@moosebuild

Copy link
Copy Markdown

Job Coverage, step Verify coverage on f0140fa wanted to post the following:

The following coverage requirement(s) failed:

  • Coverage rate 88.08% is less than the required 90.0%

@moosebuild

moosebuild commented Oct 29, 2025

Copy link
Copy Markdown

Job Documentation, step Sync to remote on b916521 wanted to post the following:

View the site here

This comment will be updated on new commits.

@moosebuild

Copy link
Copy Markdown

Job Coverage, step Verify coverage on f0140fa wanted to post the following:

The following coverage requirement(s) failed:

  • Coverage rate 88.08% is less than the required 90.0%

@simopier simopier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for this @Anthony-Bowers08!

I have several high level requests/suggestions:

  1. Instead of adding a new material class, you should instead apply this in the existing ADMatInterfaceReactionYHxPCT class. There, you will see this if statement:
if (!_silence_warnings && ((neighbor_pressure < limit_pressure) || (neighbor_pressure > 1.e6)))

You should edit this if statement so that if the neighbor_pressure is above 1.e6 or lower than ~2.e2 (the lower pressure at which we have data if I remember properly), then an error is provided, if it is between 1.e6 and limit_pressure, then the current calculations for the high pressure regime is applied, and if it is between 2.e2 and limit_pressure, then it calculates the atomic fraction at the surface following the new equation you are proposing.
I think that should do it, and capture the plateau region. My concern is that we might see some oscillations around the plateau region, but we can test that and deploy a solution once we observe that.

  1. I see that you have created an input file and submitted gold file, which is great. However, you need to also edit the test file related to this capability and add tests for all the configurations in the if statement above, with a particular focus on the new cases you are creating. The reason why the coverage currently fails is because despite adding a new input file, no additional test is being run.
    Note also that rather than create a brand new input file, you should instead use the cli_args option in the test file to utilize the existing file, but in the regime of interest to you. You will find example of that in the test file.

  2. You will also need to update the documentation page (format in .md) to detail your new contribution to the existing capabilities.

  3. Your python script should be merged with the existing one for ADMatInterfaceReactionYHxPCT. Do it all in there.

Let me know if you have any questions.

@Anthony-Bowers08
Anthony-Bowers08 force-pushed the yttrium_hydride_lowpressure branch from f0140fa to 05b1c7c Compare February 9, 2026 16:43
@simopier

simopier commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator

The prechecks are failing due to the white spaces:

##########################################################################
ERROR: The following files contain trailing whitespace after applying your patch:
	src/interfacekernels/ADMatInterfaceReactionYHxPCT.C

Run the "delete_trailing_whitespace.sh" script in your $MOOSE_DIR/scripts directory.

ERROR: The following files do not contain a newline character before EOF:
	doc/content/source/interfacekernels/figures/comparison_YHx_PCT.py
	test/tests/yttrium_hydrogen_system/comparison_YHx_PCT.py

Run the "delete_trailing_whitespace.sh" script in your $MOOSE_DIR/scripts directory.
##########################################################################

I thought you had applied the changes I had suggested to get rid of those. Did it not work?

Anthony-Bowers08 pushed a commit to Anthony-Bowers08/TMAP8 that referenced this pull request Feb 9, 2026
@Anthony-Bowers08
Anthony-Bowers08 force-pushed the yttrium_hydride_lowpressure branch 2 times, most recently from 8dad514 to 6a315c7 Compare February 11, 2026 18:08
@simopier

Copy link
Copy Markdown
Collaborator

@Anthony-Bowers08, you will need to fix the conflict with the python script.
Let me know if you don't know how to do it and I can guide you.

@Anthony-Bowers08

Copy link
Copy Markdown
Contributor Author

@simopier , think python script is an updated one from your prior .py yttrium script. I essentially added the low pressure plotting and made into a function based filed. I can revert to your prior .py file and just add the low pressure plotting there.

@simopier

Copy link
Copy Markdown
Collaborator

@simopier , think python script is an updated one from your prior .py yttrium script. I essentially added the low pressure plotting and made into a function based filed. I can revert to your prior .py file and just add the low pressure plotting there.

Please do.

Also, the conflicts means that the files have been updated in your branch and in a recent merge of TMAP8. So it's less about the nature of the change, and more about the fact that several changes from different origins are in conflict. We have recently deployed a formatting script for TMAP8, which affected many of the python scripts. That is probably the culprit.

@Anthony-Bowers08
Anthony-Bowers08 force-pushed the yttrium_hydride_lowpressure branch from 502a728 to b70b205 Compare March 12, 2026 14:27

@simopier simopier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You need an issue number in your commit message:

#########################################################################
ERROR: Your patch does not contain a valid ticket reference! (i.e. #1234)
Merge branch 'yttrium_hydride_lowpressure' of https://github.com/Anthony-Bowers08/TMAP8 into test
Modifications, reformatting, and cleaning YHX #Ref 262
##########################################################################

@simopier simopier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for this extension!
I added comments for you to incorporate.
Let me know if you have any questions.

Comment thread doc/content/source/interfacekernels/ADMatInterfaceReactionYHxPCT.md Outdated
Comment thread doc/content/source/interfacekernels/ADMatInterfaceReactionYHxPCT.md Outdated
Comment thread doc/content/source/interfacekernels/ADMatInterfaceReactionYHxPCT.md Outdated
Comment thread doc/content/source/interfacekernels/ADMatInterfaceReactionYHxPCT.md
[YHx_PCT_Data] shows the data used in this interface kernel. The experimental data originates from [!cite](Lundin_1962).
The [YHx_PCT_fit_2D] shows high and low pressure fit with the high pressure fit from [!cite](Matthews2021SWIFT) and the low-pressure is a newly fitted curve.

!media comparison_YHx_PCT.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please use the same colors as for the following figure. You use the same type of color palette, but it would be easier for the reader if you used the same color for the same temperature in both figures.

Comment thread test/tests/yttrium_hydrogen_system/tests Outdated
Comment thread test/tests/yttrium_hydrogen_system/tests Outdated
Comment thread test/tests/yttrium_hydrogen_system/tests Outdated
Comment on lines +311 to +312
nl_rel_tol = 1e-4
nl_abs_tol = 4e-9

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lin is making changes to these cases, and you should be ready to use his options, which will be merged soon. See #382

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am surprised that you have to change the tolerances so much. Did you try reducing them back down?

Comment thread test/tests/yttrium_hydrogen_system/comparison_YHx_PCT.py
@moosebuild

Copy link
Copy Markdown

Job Precheck, step Python: black format on fdf51b4 wanted to post the following:

Python black formatting

Your code requires style changes.

A patch was generated and copied here.

You can directly apply the patch by running the following at the top level of your repository:

curl -s https://mooseframework.inl.gov/tmap8/docs/PRs/292/black/black.patch | git apply -v

Alternatively, you can run the following at the top level of your repository:

black --config pyproject.toml --workers 1 .

@simopier simopier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This test diffs:

DIFF test:yttrium_hydrogen_system.YHx_PCT_T1273_P3e2_csv FAILED (CSVDIFF)

Things are really taking shape otherwise!

Comment thread doc/content/source/interfacekernels/figures/comparison_YHx_PCT.py
Comment thread src/interfacekernels/ADMatInterfaceReactionYHxPCT.C Outdated
if (neighbor_pressure > limit_pressure && abs(neighbor_pressure - limit_pressure) < tolerance)
{
// High pressure region, near limit
atomic_fraction = 0.5;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This comment still holds.

Comment thread src/interfacekernels/ADMatInterfaceReactionYHxPCT.C Outdated
Comment on lines +84 to +86
// If near the start of the high pressure , jump to low pressure maximum atomic ratio
Ar_Max_LP_fit = 1.01e-6 * Utility::pow<2>(_neighbor_temperature[_qp]) -
2.55e-3 * _neighbor_temperature[_qp] + 2.156;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's set up a meeting to chat about this. My calendar is up to date.

@moosebuild

Copy link
Copy Markdown

Job Build test summary, step Build test summary on 4d11a94 wanted to post the following:

Test summary

Compared against 7d1a0b5 in job civet.inl.gov/job/3675371.

Added tests

Test Time (s) Memory (MB)
test:yttrium_hydrogen_system.YHx_PCT_T1273_P1e3_csv 3.72 78.09
test:yttrium_hydrogen_system.YHx_PCT_T1473_P3e3_csv 3.28 95.09
test:yttrium_hydrogen_system.YHx_PCT_T1573_P6e2_csv 3.26 131.73
test:yttrium_hydrogen_system.YHx_PCT_T1573_P5e3_csv 3.18 101.39
test:yttrium_hydrogen_system.YHx_PCT_T1273_P3e2_csv 3.12 87.78

@simopier

simopier commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

This PR needs to be properly rebased.

@Anthony-Bowers08
Anthony-Bowers08 force-pushed the yttrium_hydride_lowpressure branch from aa036a6 to 576b451 Compare July 30, 2026 22:00

@simopier simopier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm adding a few suggestions, but I'll need to see the full documentation to provide the full review. The precheck are currently filing due to clang format. The solve is provided in the comment above.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do not add the png files directly, create them with the python script.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will remove, thanks for pointing this out

Comment thread doc/content/source/interfacekernels/ADMatInterfaceReactionYHxPCT.md Outdated
Comment thread doc/content/source/interfacekernels/ADMatInterfaceReactionYHxPCT.md Outdated
Comment thread doc/content/source/interfacekernels/ADMatInterfaceReactionYHxPCT.md Outdated
Comment thread doc/content/source/interfacekernels/ADMatInterfaceReactionYHxPCT.md Outdated
ax.set_ylabel("Partial Pressure (Pa)")
ax.grid(True, which="both", linestyle=":", alpha=0.6)

ncols_temp = min(len(temp_handles), 5)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please replace temp with temperature everywhere.


# diffusivity from Majer et al., Journal of Alloys and Compounds 330-332 (2002) 438-442.
diffusivity_Do = '${units 1.e-8 m^2/s}'
diffusivity_Do = '${units 1 m^2/s}'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is changed to reduce the time needed to reach steady-state converged solution.

[function_BC_concentration_H_enclosure_1]
type = ParsedFunction
expression = 'exp(-${tau_constant_BC}/t)* ${initial_concentration_H_enclosure_1}'
expression = 'exp(-${dt_init}*2e-2/t)* ${initial_concentration_H_enclosure_1}'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please put back tau_constant_BC. Why did you remove it?

Comment thread test/tests/yttrium_hydrogen_system/YHx_PCT.i
Comment on lines +311 to +312
nl_rel_tol = 1e-4
nl_abs_tol = 4e-9

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am surprised that you have to change the tolerances so much. Did you try reducing them back down?

Co-authored-by: Pierre-Clement Simon <pierreclement.simon@gmail.com>
@moosebuild

Copy link
Copy Markdown

Job Precheck, step Format Check Clang on 51542d0 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/tmap8/docs/PRs/292/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 e0b788f03eee4a0821496733c419b1cb7823b221

@simopier simopier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some small comments, and also note that you have some failing tests:

[3.180s] [ 196MB]     DIFF test:yttrium_hydrogen_system.YHx_PCT_T1273_P3e3_csv FAILED (CSVDIFF)
[15.75s] [ 234MB]     DIFF test:yttrium_hydrogen_system.YHx_PCT_T1273_P3e2_csv FAILED (CSVDIFF)
[2.835s] [ 259MB]     DIFF test:yttrium_hydrogen_system.YHx_PCT_T1473_P3e3_csv FAILED (CSVDIFF)
[9.379s] [ 300MB]     DIFF test:yttrium_hydrogen_system.YHx_PCT_T1573_P5e3_csv FAILED (CSVDIFF)

Comment thread test/tests/yttrium_hydrogen_system/comparison_YHx_PCT.py Outdated
Comment thread test/tests/yttrium_hydrogen_system/comparison_YHx_PCT.py Outdated
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