Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
624 stars 350 forks source link

Enhance the PlasmaPhase to use the cross section data with an example of calculating the elastic collision energy loss rate #1731

Open BangShiuh opened 4 months ago

BangShiuh commented 4 months ago

Changes proposed in this pull request This PR change the initiation of the PlasmaPhase. The PlasmaPhase after this change takes the ElectronCollisionPlasmaRate cross-section data to calculate the plasma thermal properties (specifically the elastic collision energy loss rate). The elastic collision energy loss is the energy transfer from electron to molecule when a fast electron (higher electron temperature) collides to a slower molecule (lower gas temperature). This is useful for modelling a non-equilibrium plasma in which the electron temperature is much higher than the gas temperature. The elastic collision power loss includes the energy transfer via elastic collision and via the recoil effect of an inelastic collision. The equation can be found in the manual of bolsig, https://www.bolsig.laplace.univ-tlse.fr/download.html. I have compared the value of elastic power loss to bolsig, and it is reasonably close (around 1% different).

Data download: The collision cross section can be downloaded from https://nl.lxcat.net/data/download.php. However, the zip file is currently broken. Fortunately, I have saved a previous version. Please email me if you want to use it.

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

Checklist

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 77.19298% with 39 lines in your changes missing coverage. Please review.

Project coverage is 73.29%. Comparing base (93ef1c1) to head (9f4a423). Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/thermo/PlasmaPhase.cpp 83.73% 8 Missing and 12 partials :warning:
include/cantera/kinetics/ReactionRate.h 0.00% 12 Missing :warning:
src/kinetics/Kinetics.cpp 40.00% 2 Missing and 1 partial :warning:
include/cantera/kinetics/Kinetics.h 50.00% 2 Missing :warning:
src/kinetics/Reaction.cpp 66.66% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1731 +/- ## ========================================== + Coverage 73.26% 73.29% +0.02% ========================================== Files 383 383 Lines 54621 54768 +147 Branches 9099 9123 +24 ========================================== + Hits 40020 40140 +120 - Misses 11599 11614 +15 - Partials 3002 3014 +12 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

speth commented 2 weeks ago

@BangShiuh, I saw that you have marked all the comments from my previous review as "resolved", but I think the corresponding changes have not been pushed to this branch. Are they all in your collision-new branch that you mentioned in Cantera/enhancements#194? Could you push them to this branch?

BangShiuh commented 2 weeks ago

Hi Ray,

Yes, I am mostly done. I am working on a small issue right now for updating the interpolating the cross section. I will push it once I finished!

Bang

On Tue, Nov 12, 2024 at 10:22 PM Ray Speth @.***> wrote:

@BangShiuh https://github.com/BangShiuh, I saw that you have marked all the comments from my previous review as "resolved", but I think the corresponding changes have not been pushed to this branch. Are they all in your collision-new branch that you mentioned in Cantera/enhancements#194 https://github.com/Cantera/enhancements/issues/194? Could you push them to this branch?

— Reply to this email directly, view it on GitHub https://github.com/Cantera/cantera/pull/1731#issuecomment-2472290234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZZJBQ5JNPC2LX7E6SMOID2ALAXFAVCNFSM6AAAAABKQ3OMM6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZSGI4TAMRTGQ . You are receiving this because you were mentioned.Message ID: @.***>

BangShiuh commented 1 week ago

@speth I have made updating rate or adding reaction triggers updating the interpolated cross sections. I also have tried to reduce the number of interpolating the cross-sections, but not successful. The rate object in PlasmaPhase is different to the one in m_bulk_rates, which is used by updateROP.

I will check the Linters checks failure. How do I run that on my computer?

speth commented 1 week ago

I will check the Linters checks failure. How do I run that on my computer?

The easiest thing to do is just look at the logs here on GitHub. The problem that it is finding is with the docstring for class PlasmaPhase, which starts with:

/*!
 * Base class for handling plasma properties, specifically focusing on the
 * electron energy distribution. This class provides functionality
 * to manage the the electron energy distribution using two primary methods
 * for defining the electron distribution and electron temperature.
 *

There is a subtle difference between starting a Doxygen comment block with /** and /*!. In the former case, the first sentence of the comment block (that is, up to the first period or blank line) will be used as the brief description. In the latter case, it will not. Since we often rely on this feature for providing the brief description, the comment block should start with /** instead. The other way to write this with the brief description more explicitly provided is:

//! Base class for handling plasma properties, specifically focusing on the
//! electron energy distribution. 
/*!
 * This class provides functionality to manage the the electron energy distribution
 * using two primary methods for defining the electron distribution and electron
 * temperature.
 *