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

Modify solution strategy for counterflow flames #155

Closed
g3bk47 opened this issue Jul 16, 2022 · 2 comments
Closed

Modify solution strategy for counterflow flames #155

g3bk47 opened this issue Jul 16, 2022 · 2 comments
Labels
work-in-progress An enhancement that someone is currently working on

Comments

@g3bk47
Copy link

g3bk47 commented Jul 16, 2022

Abstract

A common application for counterflow flames is to find the extinction strain. For any type of 1D flame, the following solution strategy is applied:

For a counterflow flame, finding the extinct flame solution counts as a successful solution, so the second step of trying to solve without the energy equation will never be exectuted. There are however cases, where this improves the convergence to the non-extinct flame solution.

Motivation

Consider the attached counterflow flame python script direct.txt (I cannot attach *.py files), where the fuel and oxidizer nozzles have the same velocity U. The counterflow flame is computed for 26 different velocites U from 1 to 20 m/s. For each simulation, a new counterflow flame is created and each simulation begins with the initial guess provided by the auto solution strategy. According to this script, extinction occurs at around U = 8 m/s.

Instead of running the simulations with the initial guess from auto, they are run from the flame solution at the previous velocity in the attached script continuation.txt. With this strategy, extinction occurs at around U = 16 m/s.

By changing the solution strategy slightly, both scripts yield similar results. The required modification has to be made here https://github.com/Cantera/cantera/blob/main/interfaces/cython/cantera/_onedim.pyx#L1241, where the change from

if not solved:

to

if not solved or self.extinct():
    if self.extinct():
        self.set_initial_guess(*self._initial_guess_args,**self._initial_guess_kwargs)

has been made.

After making this change and running the script direct.txt again, a similar extinction strain at U = 16 m/s as from the script continuation.txt is found. The comparison is plotted here: temperatures

Before making a pull request, I wanted to discuss this change here first:

  • Do you see any unintended side-effects from this change?
  • Looking at the temperature plot, the modified code (dashed black line) creates one point at U ~ 7 m/s with max(T)=1300 K. I do not understand how this solution can be found.
  • Even at 16 m/s, the maximum temperature is still relatively high. Should the "real" extinction point be at even higher U? I know there are examples already dedicated to finding the extinction strain (https://github.com/Cantera/cantera/blob/main/interfaces/cython/cantera/examples/onedim/diffusion_flame_extinction.py), but maybe the "general" approach from the attached scripts can still be improved.

The reaction mechanism from the example script is CH4.txt (rename to CH4.yaml).

I ran the scripts with Cantera 3.0.0a1.

@g3bk47 g3bk47 added the work-in-progress An enhancement that someone is currently working on label Jul 16, 2022
@speth
Copy link
Member

speth commented Mar 21, 2023

Hi @g3bk47, thanks for looking into this, and sorry for the delay in responding. I think this change makes a lot of sense. Even if the continuation approach is likely always going to be better at finding the non-extinct solution, it's still worth making it easier to find that solution under a wider range of conditions.

@ischoegl
Copy link
Member

Closed via Cantera/cantera#1463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work-in-progress An enhancement that someone is currently working on
Projects
None yet
Development

No branches or pull requests

3 participants