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 |
speth
left a comment
There was a problem hiding this comment.
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.
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.
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.hm_nsp = m_flow->nComponents() - c_offset_Y;bym_nsp = m_flow->nSpecies();inboundaries1D.cppProposed change enables decoupling of number of components from the number of species.