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

Temperature bounds for flame solver should be set based on inlet conditions #1684

Open
speth opened this issue Mar 29, 2024 · 0 comments
Open

Comments

@speth
Copy link
Member

speth commented Mar 29, 2024

Problem description

Trying to simulate a flame where the inlet temperature is less than 200 K leads to solver errors, unless the solver bounds for the temperature are explicitly set. The error messages provide no indication that this is the problem, and it is usually not necessary to modify the solver bounds, so it's not something that most users will think of trying.

I think it would be more user-friendly if the lower bound was automatically set to just below the lowest temperature of any of the inlet streams.

Steps to reproduce

Run the following Python script:

import cantera as ct

p = ct.one_atm
Tin = 195.0
reactants = 'H2:1.1, O2:1, AR:5'
width = 0.03
loglevel = 1

gas = ct.Solution('h2o2.yaml')
gas.TPX = Tin, p, reactants

f = ct.FreeFlame(gas, width=width)
f.set_refine_criteria(ratio=3, slope=0.06, curve=0.12)
f.transport_model = 'mixture-averaged'
# f.flame.set_bounds(T=(150, 5000))
f.solve(loglevel=1, auto=True)

Behavior

Repeated solver failures, starting with:

************ Solving on 8 point grid with energy equation enabled ************

..............................................................................
Attempt Newton solution of steady-state problem...    failure. 
Take 10 timesteps   
 
*******************************************************************************
CanteraError thrown by OneDim::timeStep:
Time integration failed.
*******************************************************************************

and ending with:

******** Initial solve failed; Retrying with energy equation disabled ********

..............................................................................
Attempt Newton solution of steady-state problem...    failure. 
Take 10 timesteps   
 
*******************************************************************************
CanteraError thrown by OneDim::timeStep:
Time integration failed.
*******************************************************************************
 
Traceback (most recent call last):
  File "/Users/speth/src/cantera/samples/python/onedim/adiabatic_flame.py", line 16, in <module>
    f.solve(loglevel=1, auto=True)
  File "/Users/speth/src/cantera/build/python/cantera/onedim.py", line 684, in solve
    super().solve(loglevel, refine_grid, auto)
  File "build/python/cantera/_onedim.pyx", line 1191, in cantera._onedim.Sim1D.solve
    raise CanteraError('Could not find a solution for the 1D problem')
cantera._utils.CanteraError: Could not find a solution for the 1D problem

System information

  • Cantera version: 3.0.0 or main at b0ba90a

Additional context

See this Users' Group post.

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

No branches or pull requests

1 participant