Skip to content

Support setting the energy levels with yaml input file for electron-energy-distribution type: Boltzmann-two-term#2080

Open
BangShiuh wants to merge 2 commits intoCantera:mainfrom
BangShiuh:fixBoltz
Open

Support setting the energy levels with yaml input file for electron-energy-distribution type: Boltzmann-two-term#2080
BangShiuh wants to merge 2 commits intoCantera:mainfrom
BangShiuh:fixBoltz

Conversation

@BangShiuh
Copy link
Contributor

@BangShiuh BangShiuh commented Feb 1, 2026

As the title, the energy levels can be set with the yaml file for type Boltzmann-two-term. Setting the energy levels had no effect before in yaml file, and PlasmaPhase used only the default energy-levels. (The EEDF solver still use the default energy levels regardless.). One issue was that the initiation of the EEDF solver was not completed (it requires the collision cross-sections) at setting the energy levels. The update energy distribution function was triggered by setting the energy levels, and the EEDF solver failed. Therefore, the update energy distribution function cannot run when EEDF solver is not ready. One way is to check the number of collisions to know if the collisions have been loaded. Alternative is to add a function in EEDF solver to signal if it is ready.

Note that the example data is also being updated accordingly, Cantera/cantera-example-data#7. We can first merge this and the example nanosecond_pulse_discharge.py should pass. (The example should also pass without the source code change as the energy-levels data is not used at all.)

@speth @mquiram

  • Add code to setParameters to read the energy levels.
  • Add the guard to prevent update energy distribution for Boltzmann-two-term wihtout collision data.
  • Update the test file.

If applicable, fill in the issue number this pull request is fixing

Closes #

If applicable, provide an example illustrating new features this pull request is introducing

AI Statement (required)
Limited use of generative AI
Mostly on the test data and comments.

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • AI Statement is included
  • The pull request is ready for review

…updateElectronEnergyDistribution() to prevent error using the EEDF solver without a collision
@BangShiuh BangShiuh marked this pull request as draft February 1, 2026 13:53
@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.34%. Comparing base (bd8f886) to head (97f9765).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
src/thermo/PlasmaPhase.cpp 66.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2080      +/-   ##
==========================================
+ Coverage   77.21%   77.34%   +0.13%     
==========================================
  Files         456      451       -5     
  Lines       52952    52500     -452     
  Branches     8966     8850     -116     
==========================================
- Hits        40885    40606     -279     
+ Misses       9041     8917     -124     
+ Partials     3026     2977      -49     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@BangShiuh BangShiuh marked this pull request as ready for review February 6, 2026 04:50
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