Singular Jacobian error in premixed flame

578 views
Skip to first unread message

Lee

unread,
Feb 18, 2013, 11:42:13 PM2/18/13
to canter...@googlegroups.com
I modified the example python script "adiabatic_flame.py" to run a series of premixed flames with parametrically prescribed temperature profiles. This is a methane flame using GRI 3.0. I set the temperature profile with "f.flame.setFixedTempProfile(zfix,tfix)" and run through a loop of all the conditions that I want to cover using the previous solution as the starting guess. This works well most of the time, and the solver converges fairly rapidly. For some conditions, however, it would be more efficient to resize the domain (i.e. make it larger or smaller than the original) because of changes to the flame structure. I tried a few different approaches to do this, but they all fail with the same error message stating that the Jacobian in singular (see below).

First, I tried to resize the domain at every pass through the loop using something like:

fac = 1.1
for n in range(f.flame.nPoints()):
   z[n] = z[n]*fac
f.flame.setupGrid(z) ## alternately use: f.flame.set(grid=z)


When this didn't work, I tried starting with a large domain and "pruning" the grid when needed:

f.setRefineCriteria(ratio = 3.0, slope = 0.1, curve = 0.2, prune = 0.05)


When both of these failed I tried reinitializing the flame object every time through the loop and restoring the solution from a saved profile:

f.restore(file='flame.xml',id='flame0')


Each of these attempts failed with the same error:

..............................................................................

Traceback (most recent call last):
  File "flameTest.py", line 65, in <module>
    f.solve(loglevel, refine_grid)
  File "/Library/Python/2.7/site-packages/Cantera/OneD/FreeFlame.py", line 73, in solve
    Stack.solve(self, loglevel = loglevel, refine_grid = refine_grid)
  File "/Library/Python/2.7/site-packages/Cantera/OneD/onedim.py", line 581, in solve
    return _cantera.sim1D_solve(self._hndl, loglevel, refine_grid)
cantera.error: 

************************************************
                Cantera Error!                  
************************************************


Procedure: MultiNewton::step
Error:   Jacobian is singular for domain flame, component CH3CHO at point 105
(Matrix row 6043) 
see file bandmatrix.csv

..............................................................................

Has anyone had experience with this error before? Is it because the solver fixes a temperature at a location in the domain so that it can compute the flame speed? Maybe I'm screwing up the anchor location when I monkey with the grid (either by stretching or pruning it)? Perhaps I'd have better luck trying to prescribe the mass flux like in a burner flame? I was hoping to avoid this so that I don't have to come up with a relationship between the flame speed and the prescribed temperature profile.

I'd appreciate any suggestions that you have.

Thanks
-Lee

Ray Speth

unread,
Feb 21, 2013, 10:48:27 PM2/21/13
to canter...@googlegroups.com
Hi Lee,

You're correct that the solver relies on fixing the temperature at a specific grid point in order to compute the flame speed, and I've seen issues in the past where problems with that result in 'singular Jacobian' errors. My guess is that the temperature fixed point isn't protected from removal during the pruning stage, and that's the cause of the error in that case. I'm not sure why rescaling the grid would generate this error, though.

If you can provide scripts that demonstrate each of these bugs (as all of these approaches ought to work), it would be helpful if you could post them to a bug report on the Cantera bug tracker (http://code.google.com/p/cantera/issues/list).

Regards,
Ray
Reply all
Reply to author
Forward
0 new messages