-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
Enable additional states / equations in onedim #624
Conversation
Codecov Report
@@ Coverage Diff @@
## master #624 +/- ##
==========================================
- Coverage 68.54% 68.53% -0.01%
==========================================
Files 363 363
Lines 39978 39978
==========================================
- Hits 27401 27400 -1
- Misses 12577 12578 +1
Continue to review full report at Codecov.
|
Not sure about codecov flagging files that were not changed (GasTransport.cpp?). The push request is limited to 5 lines of code ... PS: a functional (albeit rudimentary) example for code with added equations is posted on ischoegl/ctapp (object |
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.
I can see how the change in Inlet1D
is necessary to be able to add state variables, but I'm kind of surprised that this is sufficient. Certainly, there's a lot more work to be done to make the 1D solver more generically extensible, but this seems fine for what it does.
The coverage failures are confusing but not a problem. The test suite passing is what's important.
include/cantera/oneD/StFlow.h
Outdated
virtual size_t nSpecies() { | ||
return m_nsp; | ||
} | ||
|
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.
Instead of introducing a new method here, you could just access the number of species from Inlet1D
as m_flow->phase().nSpecies()
.
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.
Yes, the simplicity of the fix surprised me also. Thanks for the suggestion: I didn't think of calling m_flow->phase()
; I created the new method as neither m_thermo
nor m_nsp
were accessible.
I'll report back.
@speth per your suggestion I eliminated the |
Fixes # [cantera-users] Additional Equations in StFlow
Changes proposed in this pull request:
nSpecies() { return m_nsp; }
toStFlow.h
m_nsp = m_flow->nComponents() - c_offset_Y;
bym_nsp = m_flow->nSpecies();
inboundaries1D.cpp
Proposed change enables decoupling of number of components from the number of species.