Skip to content

Feature/radiation vode#1975

Open
James471 wants to merge 18 commits into
AMReX-Astro:developmentfrom
James471:feature/radiation-VODE
Open

Feature/radiation vode#1975
James471 wants to merge 18 commits into
AMReX-Astro:developmentfrom
James471:feature/radiation-VODE

Conversation

@James471
Copy link
Copy Markdown

@James471 James471 commented Mar 31, 2026

The PR adds radiation number densities and fluxes and reduced speed of light in burn state. It also makes changes to the VODE integrator to handle photochemical reactions. The PR also fixes a bug that causes the last character of eos file to not be read if the files doesn't end with a newline character.

@James471 James471 force-pushed the feature/radiation-VODE branch from 7701e44 to cc5d137 Compare April 20, 2026 10:14
@James471 James471 force-pushed the feature/radiation-VODE branch from 1f332b0 to 335ac11 Compare May 30, 2026 03:35
James471 and others added 7 commits May 30, 2026 09:18
…ariables

WIP: Add reduced speed of light to burn state and some missing radiation variables

WIP: Add reduced speed of light to burn state and some missing radiation variables
Minor fixes

WIP: Minor fixes

WIP: Minor fixes

Cleanup
Simplify photoionization eos implementation, change species masses

Simplify photoionization eos implementation, change species masses
…n EOS

The EOS was incorrectly normalizing the total heat capacity
sum_ni_fi_over_2 by dividing by the particle count before using it
for internal energy and temperature calculations. This made the
internal energy per unit mass ~1/n_total times too small, causing
the ionized gas temperature to be ~140x too low for the DTypeFront
test (n_H=139.9), giving an expansion speed of ~750 m/s instead of
the expected ~10 km/s.

Fix: separate the unnormalized sum_ni_fi_over_2 (total heat capacity,
used for e, T, dedT) from fi_over_2_avg = sum_ni_fi_over_2 /
sum_Abarinv (per-particle average, used for pressure, cs, G).

Also fix electron mass: spmasses[Electron] was set to proton mass;
now correctly set to C::m_e = 9.109e-28 g.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@James471 James471 force-pushed the feature/radiation-VODE branch from 335ac11 to 068810e Compare May 30, 2026 03:48
@James471 James471 force-pushed the feature/radiation-VODE branch from 870de75 to 208cf1a Compare May 30, 2026 04:26
@James471 James471 marked this pull request as ready for review May 31, 2026 16:01
@BenWibking BenWibking requested a review from zingale May 31, 2026 16:18
Quokka Dev and others added 2 commits June 1, 2026 17:19
The radiation loop had two bugs: the upper bound `NumRadEqs` should be
`net_ienuc + NumRadEqs` (the loop never executed since net_ienuc+1 > NumRadEqs),
and `state.rn[i-1]` / `state.rn[j-1]` should be indexed relative to net_ienuc
to correctly map VODE 1-based indices to the rn[] array.  The inner loop
upper bound was also off by one (`<= i + N` → `<= i + N - 1`).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@BenWibking
Copy link
Copy Markdown
Collaborator

@zingale This is something that is critical for our simulation in the second half of this year. We'd like to merge this in the next week or two if possible. Let us know if there's any additional context or review guidance we can provide.

A follow-up PR will make analogous changes to the Rosenbrock integrator to add support for radiation variables.

fix: correct loop bounds and rn[] indexing in numerical_jacobian.H
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