Skip to content

correct tmax and tmin in temp_given_ey,hy based on mechanisms bounds#589

Merged
baperry2 merged 7 commits intoAMReX-Combustion:developmentfrom
PlaFCo:fix_Tbounds
Jun 30, 2025
Merged

correct tmax and tmin in temp_given_ey,hy based on mechanisms bounds#589
baperry2 merged 7 commits intoAMReX-Combustion:developmentfrom
PlaFCo:fix_Tbounds

Conversation

@EnnaDelfen
Copy link
Copy Markdown
Contributor

With this commit, the functions GET_T_GIVEN_EY and GET_T_GIVEN_HY will effectively use the most stringent prescribed thermo bounds for the loop over the temperature, and extrapolate outside these bounds. It's basically restoring what the comments are saying "max lower bound for thermo def" and "min upper bound for thermo def" .
It may change results quite significantly however, particularly the lower bound at 90 was quite low and will most likely always be overwritten. Is it best to extrapolate or to fetch a value with a polynomial that isn't supposed to be used over this range? Not sure.
The reason for the proposed modif in my case concerns the higher bound: we sometimes have poly fits that run higher than 4000, so a conservative change could be to change that upper bound only if we have a mechanism that allows it

@baperry2
Copy link
Copy Markdown
Contributor

This change sounds good to me. Can you regenerate the mechanisms based on these changes?

@EnnaDelfen
Copy link
Copy Markdown
Contributor Author

EnnaDelfen commented Jun 27, 2025

I'm changing the regular mechs, I've tried the QSS ones but they give me very different results in the Jacobian and I'm not sure if that's completely normal? Maybe someone with better understanding of these ceptr routines could have a second look at it (alternatively, if there's a specific test I can try I could do that to make sure it's all OK)

@baperry2 baperry2 requested review from malihass and marchdf June 27, 2025 21:29
@baperry2
Copy link
Copy Markdown
Contributor

@malihass or @marchdf could one of you take a look?

@marchdf
Copy link
Copy Markdown
Contributor

marchdf commented Jun 30, 2025

Yup, looking now.

@marchdf
Copy link
Copy Markdown
Contributor

marchdf commented Jun 30, 2025

The diffs in QSS are not due to any changes in this PR. Rerunning the code generation on the development branch generates the same diffs. I pushed the updated QSS to this branch.

I think this is just due to how the sympy is simplifying the expressions. I tried tracking the difference through but quickly got lost.

@baperry2 baperry2 enabled auto-merge (squash) June 30, 2025 16:33
@baperry2 baperry2 merged commit 4dd8745 into AMReX-Combustion:development Jun 30, 2025
9 checks passed
@EnnaDelfen EnnaDelfen deleted the fix_Tbounds branch July 1, 2025 10:40
@baperry2
Copy link
Copy Markdown
Contributor

baperry2 commented Jul 1, 2025

@EnnaDelfen
Copy link
Copy Markdown
Contributor Author

Yes, it should change results. As I mentioned in my first message, many mechanisms had poly fits valid for a smaller range than the one that was hard coded (90-4000), so you're now effectively directly interpolating instead of fetching a polynomial value... Both options are "wrong", but which one is the most wrong remains to be investigated

@baperry2
Copy link
Copy Markdown
Contributor

baperry2 commented Jul 2, 2025

Yep, the cases that have small diffs appear to be when the temperature is slightly out of the bounds (e.g. a minimum of 298 when the lower bound is 300). Things are working as expected.

BLeMoal1 pushed a commit to BLeMoal1/PelePhysics that referenced this pull request Jul 2, 2025
…MReX-Combustion#589)

* correct tmax and tmin in temp_given_ey,hy based on mechanisms bounds

* update list of mechanisms

* typo in list_mech

* simplify python code

* missed one

* update qss

* format

---------

Co-authored-by: Marc Henry de Frahan <[email protected]>
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