Skip to content

fix: correct energy normalization and electron mass in photoionizatio…#1

Merged
James471 merged 1 commit into
James471:feature/radiation-VODEfrom
chongchonghe:chong/photo-fix
May 18, 2026
Merged

fix: correct energy normalization and electron mass in photoionizatio…#1
James471 merged 1 commit into
James471:feature/radiation-VODEfrom
chongchonghe:chong/photo-fix

Conversation

@James471
Copy link
Copy Markdown
Owner

…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.

…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 merged commit 779d3a8 into James471:feature/radiation-VODE May 18, 2026
5 of 28 checks passed
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.

1 participant