-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plasma phase #1190
Plasma phase #1190
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1190 +/- ##
==========================================
+ Coverage 65.47% 65.50% +0.02%
==========================================
Files 327 329 +2
Lines 46350 46664 +314
Branches 19688 19853 +165
==========================================
+ Hits 30349 30566 +217
- Misses 13476 13538 +62
- Partials 2525 2560 +35
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @BangShiuh Just a couple of small questions here
2b48741
to
aa07361
Compare
This PR is mostly done. One thing that I am not sure about is valuecache implementation. I hope I did it correctly. Another thing that might be a little confusing is the implementation of setElectronTemperature and setElectronEnergyDistrb. What I would like is that you can choose to use electron temperature to calculate electron energy distribution or you can use electron energy distribution to calculate electron temperature. Maybe there is a better to implement the mutually dependent relationship. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @BangShiuh ... for starters, I have a very high-level comment: based on how things are implemented, Plasma
really is just a specialization of Phase
, correct? Insofar, I think it would make sense to group the new classes with other specializations (and treat PlasmaPhase
the same as any other ThermoPhase
), rather than to create an entirely new parallel structure?
Yes, I think we had some discussion in #700 and decided to put plasma in a separate folder so that thermo is not getting more crowded. But if you think that is not a problem, I can definitely move it back. |
I think these should be kept in the same folder, as having headers for a derived class in a separate folder is somewhat confusing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other thing I recalled from #1099 is this: #1099 (comment)
Could you include a mechanism here that makes Te
track T
for a regular IdealGasPhase
?
4ab42db
to
e7e79e8
Compare
0a59f68
to
170228d
Compare
@ischoegl I have made Te = T for IdealGasPhase. I made the setElectronTemperature throw NotImplementedError. For now, m_electronTemp is private of Phase. Do you think I should change it to protected so that I can use it directly or I should keep it private and use Phase::setElectronTemperature? |
I believe this approach makes sense (for anything not outside of |
@ischoegl Ultimately |
@BangShiuh … at the moment, this PR is still in draft status? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @BangShiuh ... thank you for responding to the first round of review comments. The current round is mostly about formatting (there are some choices that are different from those commonly found in Cantera source code).
Beyond, I still am not sure about the introduction of the Plasma
class in Python; from my viewpoint, it is not sufficiently distinct from other bulk phases. It probably needs to be integrated into Solution
one way or another before this is ready to be merged.
b5e60b4
to
77a1c14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BangShiuh ... thanks for making the Plasma
Python API consistent with other thermo phases!
The solution was to cast the child class to the parent class after initiation and cast back to the child class when using its member functions. It is a little tedious. Maybe we can figure out better ways to do this.
This is pretty much what is done elsewhere across the board (even the underlying C++) ... see ReactionRate
, various Reactor
implementations, etc. . So I think there's nothing wrong with using the same approach here.
975f534
to
0f06d40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BangShiuh ... Although I still have a couple of minor comments, this looks mostly good to me.
Use properties such as standard_enthalpies_RT
Use mean electron energy instead of electron temperature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @BangShiuh. This looks good to me. I did a little bit of cleanup of the history and commit messages and pushed that to your branch.
Changes proposed in this pull request
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
scons build
&scons test
) and unit tests address code coverage