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

Python ReactorNet advance function providing convoluted error message #1195

Closed
chinahg opened this issue Feb 14, 2022 · 0 comments · Fixed by #1570
Closed

Python ReactorNet advance function providing convoluted error message #1195

chinahg opened this issue Feb 14, 2022 · 0 comments · Fixed by #1570

Comments

@chinahg
Copy link
Member

chinahg commented Feb 14, 2022

Problem description

When calling the advance function for a reactor network, the time to advance may be set to a value smaller than the current reactor time. The error message produced is unhelpful to the user for troubleshooting.

Steps to reproduce

gas = ct.Solution("gri30.yaml")
gas.TPX = 5000, 301325, "O2:0.75, CH4:0.25"
reactor = ct.IdealGasReactor(gas)
reactorNet = ct.ReactorNet([reactor])

t_final = 2
t = 0
del_t = 0.5

while t <= t_final:
t = t + del_t
reactorNet.advance(t)

gas.TPX = 2000, 101325, "O2:0.5, CH4:0.5"
reactor.syncState()

t_final = 1
time = 0
del_t = 0.5

while time <= t_final:
time = time + del_t
print(time)
reactorNet.advance(time)

  1. Open '...'
  2. Run '....'
  3. See error '....'

Behavior
Expected an error, but output is not helpful in determining issue.
CanteraError:


CanteraError thrown by CVodesIntegrator::integrate:
CVodes error encountered. Error code: -1
At t = 1.5, mxstep steps taken before reaching tout.

Exceptions caught during RHS evaluation:


CanteraError thrown by checkFinite:
ydot contains non-finite elements:

ydot[2] = -nan
ydot[4] = -nan
ydot[7] = -nan
ydot[17] = -nan
ydot[38] = -nan
ydot[49] = -nan


System information

  • Cantera version: 2.5.0
  • OS: Windows 10
  • Python/MATLAB/other software versions: Python 3.8

Attachments

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants