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

Fix reactor mass flow rate #886

Merged
merged 3 commits into from
Jul 1, 2020
Merged

Conversation

speth
Copy link
Member

@speth speth commented Jun 29, 2020

Changes proposed in this pull request

This PR comes from my attempts to get repeatable output from the combustor.cpp sample in #883. I separated these changes out to avoid bloating that PR.

  • Ensure that the mass flow rate returned by FlowDevice objects is correct after a call to ReactorNet::advance, and not the value at some later time that the integrator reached.
  • Deprecate the time argument to FlowDevice::massFlowRate (and equivalent methods in the various language interfaces), since getting the value at any time other than the current integrator time may not be correct.
  • Remove a few variables / functions that are no longer necessary as a result of the above changes.

Checklist

  • There is a clear use-case for this code change
  • The commit message has a short title & references relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • The pull request is ready for review

Since the mass flow rate can depend on both a function of time and the
state of the connected reactors, the only time for which the mass flow
rate can be reliably returned is the current time of the reactor
network.
Eliminate unnecessary variables m_mdot_in and m_mdot_out, and remove
the need to update the mass flow rates in both updateState and evalEqs
by using the current (trial) time when updating them in updateState.
@codecov
Copy link

codecov bot commented Jun 29, 2020

Codecov Report

Merging #886 into master will decrease coverage by 0.07%.
The diff coverage is 85.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #886      +/-   ##
==========================================
- Coverage   70.49%   70.42%   -0.08%     
==========================================
  Files         375      375              
  Lines       45649    45652       +3     
==========================================
- Hits        32182    32152      -30     
- Misses      13467    13500      +33     
Impacted Files Coverage Δ
include/cantera/zeroD/Reactor.h 72.00% <ø> (ø)
include/cantera/zeroD/ReactorBase.h 56.81% <ø> (ø)
include/cantera/zeroD/flowControllers.h 86.20% <ø> (-0.89%) ⬇️
src/clib/ctreactor.cpp 6.47% <0.00%> (-0.10%) ⬇️
src/zeroD/ReactorBase.cpp 71.42% <ø> (-1.13%) ⬇️
src/zeroD/ConstPressureReactor.cpp 64.93% <72.72%> (-1.74%) ⬇️
include/cantera/zeroD/FlowDevice.h 37.50% <75.00%> (-0.44%) ⬇️
src/zeroD/IdealGasConstPressureReactor.cpp 81.42% <88.88%> (-0.52%) ⬇️
src/zeroD/FlowDevice.cpp 94.44% <100.00%> (ø)
src/zeroD/IdealGasReactor.cpp 88.31% <100.00%> (-0.30%) ⬇️
... and 7 more

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 df37795...d58fdc3. Read the comment docs.

@speth speth requested a review from bryanwweber June 30, 2020 01:51
@speth speth changed the base branch from master to main June 30, 2020 23:15
Copy link
Member

@bryanwweber bryanwweber left a comment

Choose a reason for hiding this comment

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

This looks good to me. One small point for discussion is whether this would be a good time to change the references to the master flow devices, or whether that would be better in another PR. I'm fine either way.

@paulblum these changes will affect what you're working on.

@speth
Copy link
Member Author

speth commented Jul 1, 2020

I was going to save that for another PR. I'm trying to keep my PRs to a manageable size. 😂

@speth speth merged commit e922c54 into Cantera:main Jul 1, 2020
@bryanwweber
Copy link
Member

The foreberance is appreciated 🤣

speth added a commit to speth/cantera that referenced this pull request Jul 1, 2020
Changes to the blessed output file are a result of updates to atomic weights,
and to fixes for how flow devices are updated (Cantera#886)
bryanwweber pushed a commit that referenced this pull request Jul 3, 2020
Changes to the blessed output file are a result of updates to atomic weights,
and to fixes for how flow devices are updated (#886)
@speth speth deleted the fix-reactor-mass-flow-rate branch July 23, 2024 15:38
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