Skip to content
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

Use normal sign convention for reactor heat transfer #1156

Merged
merged 1 commit into from
Dec 9, 2021

Conversation

speth
Copy link
Member

@speth speth commented Dec 8, 2021

Heat transfer into a system is normally considered positive, and the internal variables used within Reactor should reflect this convention.

This does not change the sign convention from the perspective of a wall between two reactors is unchanged, where a positive value indicates heat transfer from the left to the right, which I think is consistent.

Changes proposed in this pull request

  • Calculate Reactor::m_Qdot using the updated sign convention, and use this to set Reactor::m_Q following the existing convention
  • Use Reactor::m_Qdot in calculations for all reactor models instead of m_Q
  • Deprecate Reactor::m_Q

The Reactor::m_Q variable is a protected member of the Reactor class, with no accessor, so this can only affect user-generated classes derived from Reactor. However, fixing this is important for #1003, which does introduce a getter/setter pair for this net heat transfer, and using the normal sign convention would prevent some surprising behavior.

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

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

Heat transfer into a system is normally considered positive. The sign
convention from the perspective of a wall between two reactors is
unchanged, with a positive value indicating heat transfer from the
left to the right.
@codecov
Copy link

codecov bot commented Dec 8, 2021

Codecov Report

Merging #1156 (8c4e167) into main (7fc5a2d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1156   +/-   ##
=======================================
  Coverage   73.76%   73.76%           
=======================================
  Files         370      370           
  Lines       48983    48984    +1     
=======================================
+ Hits        36133    36134    +1     
  Misses      12850    12850           
Impacted Files Coverage Δ
include/cantera/zeroD/Reactor.h 63.15% <ø> (ø)
include/cantera/zeroD/ReactorBase.h 50.00% <ø> (ø)
src/zeroD/ConstPressureReactor.cpp 64.47% <100.00%> (ø)
src/zeroD/IdealGasConstPressureReactor.cpp 81.15% <100.00%> (ø)
src/zeroD/IdealGasReactor.cpp 83.11% <100.00%> (ø)
src/zeroD/Reactor.cpp 84.87% <100.00%> (+0.05%) ⬆️
test/thermo/cubicSolver_Test.cpp 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7fc5a2d...8c4e167. Read the comment docs.

Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@ischoegl ischoegl merged commit 208a89c into Cantera:main Dec 9, 2021
@speth speth deleted the fix-q-sign-convention branch December 9, 2021 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants