Skip to content

Feature/radiation vode#1975

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

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

Conversation

@James471

@James471 James471 commented Mar 31, 2026

Copy link
Copy Markdown

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.

@chongchonghe

Copy link
Copy Markdown
Contributor

A description of the physics for the photoionization network is here: quokka-astro/quokka#1800

Meowwish pushed a commit to Meowwish/quokka_metal that referenced this pull request Jun 15, 2026
### Description
Implements photochemistry in quokka and changes the Microphysics hash to
a compatible version. Also adds the one zone test and the stromgren
sphere test problem

### Related issues
Depends on AMReX-Astro/Microphysics#1975 

### Checklist
_Before this pull request can be reviewed, all of these tasks should be
completed. Denote completed tasks with an `x` inside the square brackets
`[ ]` in the Markdown source below:_
- [x] I have added a description (see above).
- [x] I have added a link to any related issues (if applicable; see
above).
- [x] I have read the [Contributing
Guide](https://github.com/quokka-astro/quokka/blob/development/CONTRIBUTING.md).
- [x] I have added tests for any new physics that this PR adds to the
code.
- [ ] *(For quokka-astro org members)* I have manually triggered the GPU
tests with the magic comment `/azp run`.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: ChongChong He <chongchonghe99@gmail.com>
Co-authored-by: Ben Wibking <ben@wibking.com>
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