Conversation
|
@BangShiuh A couple of small administrative things:
Thanks! |
Codecov Report
@@ Coverage Diff @@
## main #700 +/- ##
==========================================
+ Coverage 71.19% 71.23% +0.04%
==========================================
Files 376 383 +7
Lines 46218 46986 +768
==========================================
+ Hits 32903 33470 +567
- Misses 13315 13516 +201
Continue to review full report at Codecov.
|
bf3645b to
d8a7226
Compare
speth
left a comment
There was a problem hiding this comment.
This is a very substantial and welcome addition to Cantera, so I hope you don't mind the copious number of review comments on the implementation.
First, I have a few questions about names and making sure that they are appropriately descriptive:
- Would it make sense to name the directory with these new files 'plasma' rather than 'electron'?
- Would it make more sense for the
Electronclass to be namedPlasmaElectronto avoid any possible confusion with electrons in condensed phases, e.g. theelectron-cloudmodel represented by theMetalPhaseclass? - Likewise,
plasma_reactioninstead ofelectron_reaction, since there are other reaction types (electrochemical) that involve electrons?
I do wonder whether it is possible to treat the electron-neutral collision processes more like existing "reaction" types.
Please start the processes of requesting permission from the LXCAT to include the data needed for the tests / sample problem. I don't want to run afoul of their terms of use, but we do need to have some data for the tests and sample problems.
Since the CTI and XML formats are destined for retirement, I would like to suggest adding the input parsing code only for the YAML format, and eliminating the code for converting from XML/CTI.
Please add documentation for the appropriate YAML entries in doc/sphinx/yaml.
include/cantera/kinetics/Reaction.h
Outdated
| bool allow_negative_pre_exponential_factor; | ||
| }; | ||
|
|
||
| class ElectronReaction : public Reaction |
There was a problem hiding this comment.
This class needs some documentation -- details should go in the Science section of the cantera-website, but this can at least provide a short overview, and especially explain how this relates to the other classes that are being added in this PR.
src/oneD/IonFlow.cpp
Outdated
| throw CanteraError("IonFlow::setSolvingStage", | ||
| "solution stage must be set to: " | ||
| "1) frozenIonMethod, " | ||
| "2) electricFieldEqnMethod"); | ||
| "2) electricFieldEqnMethod," | ||
| "3) enableBoltzmannEqu"); |
There was a problem hiding this comment.
This is kind of confusing and could be reworded - as written, it seems to imply that the names frozenIonMethod, electricFieldEqnMethod, and enableBoltzmannEqu can be used to set the solver "stage", but in fact it is the numeric constants 1, 2, and 3 that matter.
|
@BangShiuh ... I agree that your proposed functions are a welcome addition to Cantera! While I do not have experience in the field, I have a couple of questions in terms of implementation:
|
|
@speth ... I agree names (plasma) you suggested.
It is possible. I can call it plasmaReaction and include a function call getRateCoefficient to get the reaction rate coefficient from class electron. And maybe I can call ElectronReaction =>ElectronTemperatureReaction? |
ischoegl
left a comment
There was a problem hiding this comment.
Per my previous comments, it would be good to see how this addition fits into existing cantera infrastructure.
| //! electron temperature | ||
| //! If the reduced electric field is set, electron tempeature is calculated | ||
| //! from EEDF. | ||
| virtual double electronTemperature(); |
There was a problem hiding this comment.
Is it correct that electronTemperature is part of the state of the Plasma (or is it an electric field)? If so, wouldn't it make sense to implement Plasma as a new ThermoPhase-derived object, instead of creating a completely separate interface?
There was a problem hiding this comment.
electronTemperature is the calculated parameter from the state EEDF (electron energy distribution function). I think that class PlasmaElectron is very different from thermoPhase.
There was a problem hiding this comment.
I understand that it is different from currently implemented ThermoPhase objects. I believe the question is whether it would make sense to tweak the existing interfaces to accommodate your additions, rather than to bypass the existing infrastructure.
BangShiuh
left a comment
There was a problem hiding this comment.
@BangShiuh ... I agree that your proposed functions are a welcome addition to Cantera! While I do not have experience in the field, I have a couple of questions in terms of implementation:
* how does `Electron` (or `ElectronPlasma`) fit into the existing cantera concept that uses `ThermoPhase`, `Kinetics` and `Transport` to specify `Solution` objects? * There currently is only a 1D example. Does your implementation support simple 0D tests or reactor networks as well? (presumably `ElectronArrhenius` should be suffiently similar to other reactions, which can be evaluated based on the state of an associated substance). Or, to give a different example, surface reactions require a specialized _surface phase_, but otherwise fit into the general framework. * I agree with @speth that it would make sense to introduce a new composite class `Plasma`. As indicated, I am unsure about having to pass an additional object. Could your solution be tweaked to allow for a Python instantiation via `Plasma(ThermoPhase, Kinetics, Transport)`?
PlasmaElectron, ThermoPhase, Kinetics and Transport are combined to form a Plasma object. I will made a new Solution call Plasma.
I do have 0D example, and I will add it to this PR.
@ischoegl Thank you for reviewing my PR!
|
I talked to lxcat, and they were not willing to let me install their data. Therefore, I have created my own cross section data for testing. I am having a problem with the class ElectronCrossSection. It acts very weird when adding or deleting member functions, and this prevent me from working on the PlasmaReaction. |
speth
left a comment
There was a problem hiding this comment.
I talked to lxcat, and they were not willing to let me install their data. Therefore, I have created my own cross section data for testing.
That's unfortunate, but I think your solution sounds fine. In this case, the file data/inputs/lxcat.yaml should be removed, correct?
I think @ischoegl's point about trying to fit this in more with the existing class structure is worth serious consideration. In part, this is because conceptually the state of the electron is part of the thermodynamic state. But furthermore, there would be significant simplifications of the implementation. If you can make PlasmaElectron a child of class ThermoPhase (probably a child of IdealGasPhase), then some of the extra interface methods that are added here, such as Transport.initElectron would be unnecessary, since the Transport class already has a pointer to the ThermoPhase object, and the WeakIonGasTransport class could just cast that pointer to the appropriate type. A similar simplification would apply to the kinetics class, and it would also eliminate the need to introduce a new composite class in the Python interface.
Also, can you rebase this onto the current master? If you have trouble fixing the merge commits, let me know and I can try doing it instead and push the updated branch to this PR.
I am having a problem with the class ElectronCrossSection. It acts very weird when adding or deleting member functions, and this prevent me from working on the PlasmaReaction.
I'm wondering if this is because you have an extra copy of this file in an outdated location in your local copy of the code. I had to change an #include of this header file to get the code to compile (see specifics in comment below).
src/plasma/PlasmaElectron.cpp
Outdated
| writelog("Warning: The mole fraction of species {} is more than 0.01", | ||
| m_thermo->speciesName(k)); | ||
| writelog(" but it has no data of cross section."); | ||
| writelog("\n"); |
There was a problem hiding this comment.
This might be a good candidate for using the new warn_user function.
Just wanted to chime in here: the handling of the electron in general is something on my mind, lately. We currently have a framework to treat it as a species, particularly for the Currently, if I have an electronically-conductive solid which also has variable species, I have to create a separate Anyway, I'm not familiar enough with the work here to know if what I'm proposing is easily incorporated into this work, is already consistent with this work, or is even relevant, and I plan to open an issue over at the enhancements repo, but thought it was at least worth brining the issue up here, in case there is an efficient way to address both issues at one time. |
|
On the general handling of electrons, I think a new issue in the Enhancements repository makes sense. This PR still involves treating electrons as equivalent to other species, at least in most respects, and I don't think we should burden it with a generalization that affects several existing phase types when we haven't yet worked out how that would work. |
|
Sounds good - will do.
Thanks,
Steven
… On Mar 30, 2020, at 7:44 AM, Ray Speth ***@***.***> wrote:
On the general handling of electrons, I think a new issue in the Enhancements repository makes sense. This PR still involves treating electrons as equivalent to other species, at least in most respects, and I don't think we should burden it with a generalization that affects several existing phase types when we haven't yet worked out how that would work.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#700 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABEC7PCN66VIOUZLTR7YD6LRKCO3HANCNFSM4INFHDFA>.
|
|
I got the following issue: It is not clear to me why it happened. class InterfacePhase also has |
You may have to define |
@ischoegl Thank you for the quick reply. I am too rusty. |
046fb17 to
71c961f
Compare
|
The plasma features are now on PlasmaPhase (thank you for the suggestion!). I am going to merge/rebase this PR. Do you recommend using merge or rebase? I found that rebase is a little headache. Generally I get test fail and compiling fail for rebase and merge, respectively. I left out potential oneD and zeroD implementation as the PR is large, and I will be working on that in the future. For now, people can try the 0D plasma reactor in the example folder. |
|
Thanks @BangShiuh! Rebasing is definitely preferred |
|
I got a compiling issue with fmt. Do you know how to solve it? Thank you.
|
|
Looks like there's a version mismatch. Did you run |
339b77d to
41c1df3
Compare
046fb17 to
487f5d5
Compare
|
@speth I noticed that you pushed to my branch. I didn't know you can do that. Is there a specific reason? |
|
@BangShiuh - Sorry for not responding sooner. I think the reason I pushed to your branch was to rebase and resolve a merge conflict that had developed, which prevented running the test suite. If you want to force push your local branch back to your Github remote, I think you will see the issue again. |
|
@BangShiuh … I assume this is superseded by #1190 or others? If I understand correctly, this PR is no longer considered for a merge. Can this be closed? |
Changes proposed in this pull request:
Note:
I included an example and its data in the example folder and data folder respectively. The data is from LXCAT You can download the data in txt and use BOLOS to convert it into yaml. BOLOS now only support python 2. You can find the python 3 version in my repository, BOLOS , and cs_converter.py in folder samples.
We need to contact lxcat for this PR to be included.
Issues:
Sometimes domainTooNarrow can occur for the case with external electric field. I wonder if I can turn it off manually for stage 3 of class IonFlow.
The SparseLU solver of Eigen fails for a grid with high maximum eV. This can be solved by set initial electron temperature.
error.txt
But still I am considering to use SuperLU instead, but it requires some configuration. Eigen