Feature/radiation vode#1975
Open
James471 wants to merge 18 commits into
Open
Conversation
7701e44 to
cc5d137
Compare
1f332b0 to
335ac11
Compare
…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>
335ac11 to
068810e
Compare
870de75 to
208cf1a
Compare
5 tasks
5 tasks
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>
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.