Skip to content

Two-Term Boltzmann Equation solver#1887

Merged
ischoegl merged 29 commits intoCantera:mainfrom
mquiram:EEDFsolvertest
Aug 23, 2025
Merged

Two-Term Boltzmann Equation solver#1887
ischoegl merged 29 commits intoCantera:mainfrom
mquiram:EEDFsolvertest

Conversation

@mquiram
Copy link
Contributor

@mquiram mquiram commented May 19, 2025

Changes proposed in this pull request

Cantera/enhancements#194

Closes #

Included python example of solver comparison with BOLOS: plasmatest.py (by @QuentinMale and @NicolasBarleon), and a time evolving E/N reactor example: nanosecondPulse.py

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
  • The pull request is ready for review

@Gaetanosaure
Copy link

Gaetanosaure commented May 26, 2025

Hi @mquiram and @speth ,

Thank you very much for your interest in our work. The modifications you introduced in this branch are still under active development in our labs (see the latest developments in the second part of this message). To make all of our efforts as efficient as possible, it would be helpful to coordinate our developments. What are the current targets of your branch in terms of features and time of integration in the main version? In particular we are working on a plasma reactor that can reproduce detailed plasma assisted combustion simulations. Are you also interested in that feature? Please see an example of application in this paper:.

In brief, the plasma reactor is solving traditional 0-dimensional reactor equations with an additional energy equation for vibrational species which is important for PAC simulations.
Capture d’écran 2025-05-26 à 17 30 32

You can find first results with the last developments, which is one of the simulations presented in Ignition enhancement and NOx formation of NH3/air mixtures by non-equilibrium plasma discharge. It is compared to one of our previous in-house cantera versions based on cantera 2.3 (see here for code presentation). For now, we capture pretty well the fast-gas heating as well as the resulting partial ammonia oxidation despite minor differences in governing equations between the two implementations. The latest is expected to be more conservative and generic in terms of energy balance.

As a reminder of what has already been published on our original issue, the latest developments made on the PlasmaReactor from @NicolasBarleon, @qumale and @BangShiuh done by @Gaetanosaure (PhD student of Antonio Andreini and of Nicolas Barléon) currently present the features described below. It can be found: here

Temperature

  1. Implementation of the vibrational energy equation inside of the solver. This allows to collapse all the equations of the vibrational levels of a given species into one equation.
    This implementation is available for as many species as the user wishes.

  2. It is fully controlled via the yaml file. Species having their vibrational levels represented by a vibrational energy equation must be declared in the phase with the key vib_species. For example: ‘vib_species = [N2, O2, CH4, H2O]’. For electron-collision reactions that involve those species, one should add the key ‘vib_bool: true’. The code retrieves itself the energy threshold of the reactions and the target species.

  3. There is also the possibility for any other reaction’s energy to be split between vibrational energy and usual energy release. This is specified by a set of three parameters: “vib_bool: true, vib_target: N2, d_u_vib: 2.19” for example.

  4. This vibrational energy can be relaxed in three ways. The way of computing the relaxation time is chosen by the user via the python interface. The three options are the following: a constant relaxation time, a relaxation time based on the article ‘Modelling the impact of non-equilibrium discharges on reactive mixtures for simulations of plasma-assisted ignition in turbulent flows’ of Castela et al. from 2016 and relaxation time based on the article ‘Plasma-assisted ignition and combustion’ of Starikovskiy and Aleksandrov from 2013. For the latter development a .yaml file is included within the source code. It holds the coefficients used by the formula computing the relaxation time of a species into another. It is based on the article of Starikovskiy and Aleksandrov. This data file is used by default, but the experimented user thinking that the coefficients should be modified can provide a .yaml file containing customized coefficients for vibrational species relaxation time via the pythoninterface without the need to recompile everything.

  5. Development of a constant pressure version of the plasma reactor. Both are of interest since a discharge is initially constant volume and rapidly evolves towards constant pressure.

Should you have any questions on those new developments, please contact @NicolasBarleon or @Gaetanosaure. We are very much looking forward to working with you on our plasma module development. It would most likely be useful to set up a meeting so that we can understand our respective goals. We could send you a poll to check our respective availabilities (@mquiram you can get in touch by email with barleon@cerfacs.fr and bizot@cerfacs.fr). If that makes integration easier, we could be willing to continue our development on the current issue that you recently created.

Kind regards,

Nicolas Barléon and Gaétan Bizot

@codecov
Copy link

codecov bot commented May 30, 2025

Codecov Report

❌ Patch coverage is 80.55556% with 105 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.97%. Comparing base (726dabc) to head (9d4dc00).
⚠️ Report is 48 commits behind head on main.

Files with missing lines Patch % Lines
src/thermo/EEDFTwoTermApproximation.cpp 83.47% 36 Missing and 22 partials ⚠️
src/thermo/PlasmaPhase.cpp 74.69% 7 Missing and 14 partials ⚠️
interfaces/cython/cantera/thermo.pyx 52.94% 8 Missing ⚠️
src/kinetics/ElectronCollisionPlasmaRate.cpp 80.00% 0 Missing and 8 partials ⚠️
include/cantera/thermo/PlasmaPhase.h 77.77% 4 Missing ⚠️
src/zeroD/Reactor.cpp 33.33% 4 Missing ⚠️
include/cantera/zeroD/ReactorBase.h 0.00% 1 Missing ⚠️
src/kinetics/Reaction.cpp 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1887      +/-   ##
==========================================
+ Coverage   74.87%   74.97%   +0.09%     
==========================================
  Files         448      450       +2     
  Lines       55740    56248     +508     
  Branches     9195     9301     +106     
==========================================
+ Hits        41736    42172     +436     
- Misses      10901    10940      +39     
- Partials     3103     3136      +33     

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

Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mquiram ... thank you for the PR. I have a minor suggestion:

This change incorporates a Two-Term Boltzmann Equation solver primarily written by @QuentinMale and @NicolasBarleon from the branch https://github.com/QuentinMale/canteraBS/tree/canteraPlasma

Included python example of solver comparison with BOLOS: plasmatest.py (by @QuentinMale and @NicolasBarleon), and a time evolving E/N reactor example: nanosecondPulse.py

Could you please move those comments into the corresponding git commit messages?

@speth
Copy link
Member

speth commented May 30, 2025

@ischoegl - My plan is to do a little bit of history rewriting on this so that the code written by other authors is separated into commits attributed to them.

@speth speth self-assigned this May 30, 2025
@mquiram mquiram marked this pull request as ready for review June 1, 2025 21:29
@speth speth force-pushed the EEDFsolvertest branch 4 times, most recently from a14fdb5 to 953d866 Compare June 6, 2025 14:25
Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this PR contains several large YAML input files. @speth ... should these go into https://github.com/Cantera/cantera-example-data?

@speth
Copy link
Member

speth commented Jul 14, 2025

I see that this PR contains several large YAML input files. @speth ... should these go into https://github.com/Cantera/cantera-example-data?

Yes. I'm trying to refactor several aspects of this PR to fit better with existing capabilities and conventions. I will request a review when this is actually ready.

@speth speth force-pushed the EEDFsolvertest branch 11 times, most recently from 2d877e3 to b43e7b9 Compare July 19, 2025 22:51
mquiram added 2 commits August 4, 2025 09:51
…mple, reversed changes to pfr example, and addressed CI build docs and LLVM errors
@speth speth requested a review from ischoegl August 21, 2025 16:09
Copy link
Member

@speth speth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @mquiram, I think all of my suggestions have been addressed. I've requested an additional review from @ischoegl since there are a few changes in here that I authored.

Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks everyone for this PR! I had a look over this and only have one trivial suggestion. Using the C++ Gaussian1 would make this run a little faster as it doesn't require Python callbacks.

@ischoegl ischoegl merged commit bdb3274 into Cantera:main Aug 23, 2025
92 of 96 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants