Skip to content

Relax reaction progress tolerance by default (1e20) - #7319

Open
buchanankerswell wants to merge 1 commit into
geodynamics:mainfrom
buchanankerswell:reaction-chain-core
Open

buchanankerswell wants to merge 1 commit into
geodynamics:mainfrom
buchanankerswell:reaction-chain-core

Conversation

@buchanankerswell

@buchanankerswell buchanankerswell commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request Checklist. Please read and check each box with an X. Delete any part not applicable. Ask on the forum if you need help with any step.

Describe what you did in this PR and why you did it.

Before your first pull request:

For all pull requests:

If yes, please describe your usage of AI models in the creation of this pull request

I used a coding agent (mainly DeepSeek V4 Flash) to explore and test possible solutions to this issue. I ran initial tests to generate output, described the issue, and guided the agent as it isolated the root cause. I asked for possible fixes and chose the recommended solution, which it presented as the "cleanest" fix.

Summary

This PR relaxes the constraint on the reaction progress field in material_model/reaction_model/reaction_chain.{h,cc}. The previous constraint was too strict, causing models to immediately crash during initialization or after a few timesteps. Unit tests are revised/added to test expected behavior.

The underlying problem of numerical overshoots/undershoots of reaction progress fields is documented in issue #7287. This PR combined with PR buchanankerswell#1 should close issue #7287.

@buchanankerswell

Copy link
Copy Markdown
Contributor Author

Hi @gassmoeller and @tjhei,

I have circled back to this now. This PR has been rebased onto main and is ready for review.

Once it is merged, I will rebase buchanankerswell#1 onto main. Once buchanankerswell#1 is merged, I will finally rebase #7119 onto main.

This PR + buchanankerswell#1 will solve #7287, and will allow @lhy11009 to make progress on #7331.

Thanks for the support.

@coveralls

Copy link
Copy Markdown

Coverage Status

No base build to compare — buchanankerswell:reaction-chain-core into geodynamics:main

@buchanankerswell
buchanankerswell force-pushed the reaction-chain-core branch 2 times, most recently from cda5d1f to 8f1c2da Compare November 20, 2026 11:19
@buchanankerswell buchanankerswell mentioned this pull request Nov 20, 2026
5 tasks done

prm.declare_entry("Tolerance in reaction progress",
"0.1",
"1e20",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As for the problem you described: "Model immediately crashes during initialization or after a few timesteps". Is that because the model can start off with a very large reaction rate and it gets to a large value, so it requires the tolerance to be large?

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.

That is basically what we observed during testing.

However, the issue actually related to the over/undershoot problem that we are addressing in separate PRs (buchanankerswell#1 and #7482). If the operator splitting integration maintains strict [0, 1] bounds, then you don't get the same blow-up even if ASPECT is initialized with very large reaction rates.

This PR is more of a safeguard that sets a large reaction progress tolerance by default until those other kinks are worked out.

This branch has not been deployed

No deployments
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