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

Improve handling of max_time_step in ReactorNet #731

Merged
merged 1 commit into from
Oct 25, 2019

Conversation

ischoegl
Copy link
Member

@ischoegl ischoegl commented Oct 22, 2019

Enable checks for max_time_step from Python frontend, and clarify default setting in docstring.

Please fill in the issue number this pull request is fixing:

Fixes #730

Changes proposed in this pull request:

  • implement ReactorNet::maxTimeStep to allow for external queries
  • implement getter/setter for property ReactorNet.max_time_step
  • deprecate ReactorNet.set_max_time_step

Changing the default behavior would be simple by restricting m_maxstep here:

m_maxstep(0.0), m_maxErrTestFails(0),

but I am hesitant to do so.

@codecov
Copy link

codecov bot commented Oct 22, 2019

Codecov Report

Merging #731 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #731      +/-   ##
==========================================
- Coverage   70.84%   70.84%   -0.01%     
==========================================
  Files         374      374              
  Lines       43666    43668       +2     
==========================================
+ Hits        30937    30938       +1     
- Misses      12729    12730       +1
Impacted Files Coverage Δ
include/cantera/zeroD/ReactorNet.h 80% <100%> (+1.21%) ⬆️
src/transport/GasTransport.cpp 90.37% <0%> (-0.21%) ⬇️

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 a221c63...cb67182. Read the comment docs.

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.

Thanks @ischoegl. This looks good to me, I didn't even realize you couldn't query this value. One small change, I think.

include/cantera/zeroD/ReactorNet.h Outdated Show resolved Hide resolved
@ischoegl
Copy link
Member Author

ischoegl commented Oct 22, 2019

@bryanwweber ... before making the requested change (which is minor). Do you have any comments on the default behavior (see #730). I believe that limiting the time step may resolve some of the undesirable behavior (very large time step with CVODE interpolation missing some potential changes).

@bryanwweber
Copy link
Member

No, I think we should leave the default as-is. CVODES has a built-in way to determine the appropriate time step. I think it is on the user to determine for their use case if that needs to be limited somehow. I don't think we can pick a value that is both 1) large enough that we don't limit the CVODES unnecessarily and 2) small enough to actually effect any change.

@ischoegl
Copy link
Member Author

ischoegl commented Oct 22, 2019

I think we should leave the default as-is.

OK.

* implement ReactorNet::maxTimeStep to allow for external queries
* implement getter/setter for property ReactorNet.max_time_step
* deprecate ReactorNet.set_max_time_step
@bryanwweber bryanwweber merged commit 76901b7 into Cantera:master Oct 25, 2019
@ischoegl ischoegl deleted the make-max-time-step-property branch December 16, 2019 15:56
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.

Heat flux through the wall is not working for certain conditions
3 participants