Skip to content

[newchem-cpp] Unify/Simplify ln(T) calculations#537

Merged
brittonsmith merged 13 commits into
grackle-project:newchem-cppfrom
mabruzzo:ncc/unify-LnT-calculation
May 20, 2026
Merged

[newchem-cpp] Unify/Simplify ln(T) calculations#537
brittonsmith merged 13 commits into
grackle-project:newchem-cppfrom
mabruzzo:ncc/unify-LnT-calculation

Conversation

@mabruzzo

@mabruzzo mabruzzo commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

This PR is to be reviewed after #544 has been merged


This PR unifies the ln(T) calculations between cool1d_multi_g and lookup_cool_rates1d.

  • Previously we would recompute ln(T) values
  • Prior to this PR1, lookup_cool_rates1d previously used undamped (independent of prior temperature values) values of ln(T). Within the context of solve_rate_cool this was inconsistent with the ln(T) values used by cool1d_multi_g.
  • Consequently, this PR causes a non-negligible change in the output values. We will absolutely need to update the gold-standard.

I also slightly simplified code in cool_multi_time that pertains to the calculation of ln(T)

Footnotes

  1. This was a change that Gen made that we had previously discussed reverting.

mabruzzo added 9 commits May 3, 2026 11:43
It turns out that the value computed on CI and on my personal machine
were -4031685600248.466 and -4031685600261.704. These values had a
relative difference of ~ -3.3e-12, which slightly exceeded our tolerance
(2e-12). Consequently, we just averaged the values
This tweak will help with the next PR in the sequence
@brittonsmith

Copy link
Copy Markdown
Contributor

pre-commit.ci autofix

@brittonsmith brittonsmith left a comment

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.

This is good to me. I'm happy if you want to increase the use of classes here for interpolation.

@brittonsmith brittonsmith merged commit e9e3a53 into grackle-project:newchem-cpp May 20, 2026
4 of 5 checks passed
@mabruzzo mabruzzo deleted the ncc/unify-LnT-calculation branch June 23, 2026 15:52
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.

2 participants