-
-
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
coverage-dependent surface phase thermodynamics #1135
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1135 +/- ##
==========================================
+ Coverage 69.86% 69.96% +0.10%
==========================================
Files 373 375 +2
Lines 56684 57035 +351
Branches 18883 19053 +170
==========================================
+ Hits 39600 39903 +303
- Misses 14571 14586 +15
- Partials 2513 2546 +33
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. 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.
Hi @jongyoonbae! Nice work here. A few clean up comments for you, before the real work begins 😊
cdb8fcf
to
7d51c66
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.
Hi @jongyoonbae, this is looking very interesting. I think the main structure of this looks pretty good, and most of the changes are self-contained. Besides the specific comments below, I had a few general suggestions / questions:
- Documentation of the input format needs to be added to
doc/sphinx/yaml/phases.rst
anddoc/sphinx/yaml/species.rst
. - Do you have a Python example that could be added? Right now, this feature is pretty much undiscoverable.
- I think it would be good to have some tests that more transparently show that the model is working as expected, for example cases where you can use simple explicit calculations to show that the values are what you expect. Another useful category of tests that you could do would be to calculate some properties at the limits where these coverage-dependent effects are zero, in comparison to a phase created using the
SurfPhase
class. - Please check your code for end-of-line whitespace and remove it. Your IDE probably has an option / plugin that can either highlight it or automatically remove it for you.
- Please fix some of the spelling errors in the comments. If you're using VS Code, it should highlight most of them for you.
- Please do an interactive rebase to eliminate the addition of the compiled file
test_problems/VPsilane_test/VPsilane_test
@jongyoonbae Do you have any updates on this PR? |
I made some changes but not for all the comments. I will push those by the end of this week. Thanks! |
7d51c66
to
f3dea62
Compare
@jongyoonbae is this ready for another round of review? |
f3dea62
to
0140687
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.
Hi @jongyoonbae, thanks for the updates so far. I have some additional suggestions for
this PR based on the updated version. Besides the in-line comments, there are three general comments I would make:
-
Please add a Doxygen docstring for the
CoverageDependentSurfPhase
class, build the Doxygen docs (runscons doxygen
) and take a look at the output so you can fix the issues that should be visible. In particular, there are numerous issues with formatting of mathematical symbols. -
I think we need some additional clarity about the definition of what "standard state" means for this phase (yes, I know, this perpetual headache). In particular, are the following correct:
- The standard state is defined as being at the current vector of coverages
- The difference between the "reference state" and the "standard state" properties is the coverage-dependent term
- The partial molar enthalpies and heat capacities are equal their standard state values
- the partial molar entropy differs from the standard state value only by R*log(θ/θ_ref)
I'd appreciate it if @decaluwe and/or @cfgoldsmith could weigh in here.
-
To correctly enable YAML serialization, you will need to implement the methods
void getSpeciesParameters(const std::string& name, AnyMap& speciesNode)
andvoid getParameters(AnyMap& phaseNode) const
. You should also add a corresponding "roundtrip" test case tothermoToYaml.cpp
.
Furthermore, some of the comments I made previously have not been addressed. Please fix these issues:
- Please enable spellcheck in your editor and take a look at some of its suggestions. There are quite a few typos in the docstrings, such as (for starters) "thermodyanmic", "caclulated", "caculated", "dependece", "logarithimic", "Asumming", "capapcities".
- Please do an interactive rebase to eliminate the addition of the compiled file test_problems/VPsilane_test/VPsilane_test. If you don't know how to do this, I can do it for you and force push to this branch, at which point you will need to fetch this branch again.
From the previous review, the following also still need to be addressed, but you already mentioned that you're still working on these. I'm repeating them just so they don't get lost:
- The YAML input fields for this phase (I guess this is just
reference-state-coverage
?) and thecoverage-dependencies
section of the species entries need to be documented indoc/sphinx/yaml/phases.rst
anddoc/sphinx/yaml/species.rst
, respectively. - Please add a Python example so this feature is more discoverable.
* Nondimensionalized standard state enthalpy is evaluated at T, P and $\theta$: | ||
* | ||
* \f[ | ||
* h^o_k / RT = (h^{ref}_k + h^{cov}_k(T, P, \theta)) / RT | ||
* + \int_{T_{ref}}^{T} cp^{cov}_k(T, P, \theta) dT / RT | ||
* \f] | ||
*/ | ||
virtual void getEnthalpy_RT(double* hrt) const; |
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.
What does it mean for the standard state enthalpy to be dependent on the coverages? Even by Cantera's odd definition of "standard state", I don't understand this. (paging @cfgoldsmith, @decaluwe).
Could you please do this part? "Please do an interactive rebase to eliminate the addition of the compiled file test_problems/VPsilane_test/VPsilane_test." |
@jongyoonbae - I've eliminated the addition of the |
4783da7
to
6b0fde4
Compare
Hi @jongyoonbae, thank you for the updates. There is a small issue with the commit history that would be worth cleaning up. Can you eliminate the unnecessary "merge" commit? I think you can do this by just running
I think this should also eliminate the duplicated commit with the message "Add ThermoYamlRoundtrip test and python example" (where I think the only difference is that you corrected the typo in the commit message). This might also be a good time to rebase onto the current |
65fd3dc
to
e21d788
Compare
Thank you @speth for the great tips! I rebased to clean up the commit history and rebased this branch onto the |
e21d788
to
a231f32
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.
Thanks for the updates, @jongyoonbae. I think this is generally looking very good. I appreciate the consolidation of the different options for specifying the model parameters. Also, the plots produced by the Python example are a very nice and do a good job of showing the effects of this model.
Most of my comments here are pretty minor cleanup issues that should be easy to address.
a231f32
to
8cc8923
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.
Thanks for the quick updates, @jongyoonbae. I think this is good to go. I just pushed an update to squash a couple of commits and clean up a few commit messages. This should be good to merge as soon as the CI tests finish.
Congratulations, @jongyoonbae, on putting Cantera over the milestone of 10,000 commits with this pull request (specifically, 2a8d54e). 🥳 |
Changes proposed in this pull request
CoverageDependentSurfPhase
class allows to incorporate coverage-dependency into theSurfPhase
thermodynamics. Below is the list of new features introduced in theCoverageDependentSurfPhase
.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