calculation of laminar flame speed

1,133 views
Skip to first unread message

Pat

unread,
Apr 1, 2011, 6:23:09 AM4/1/11
to Cantera User's Group
Hello,

Im relatively new to chemical and reaction kinetics so this might be a
stupid question:

I want to calculate the laminar flame speed of methane mixture with
different contents of H2. I installed and started using Cantera (1.7)
and looked through the demos, especially the "flame" ones, but I still
have no idea how to it.
Since this is like a basic application, has someone done that before
and help or could point me in the right direction?

thanks a lot!

Mahdi Salehi

unread,
Apr 1, 2011, 1:46:51 PM4/1/11
to canter...@googlegroups.com
Hi,
You need to change the flamespeed.cpp code. All you have to do is to change your inlet condition. If you need to change the mass fractions at the inlet:

    vector_fp x;
    x.resize(nsp);
    for(int k=0;k<nsp;k++){
      if(k==gas.speciesIndex("CH4"))     {x[k]= Y_CH4_init; }
      else if(k==gas.speciesIndex("O2")) {x[k]= Y_O2_init; }
      else if(k==gas.speciesIndex("CO2")){x[k]= Y_CO2_init; }
      else if(k==gas.speciesIndex("H2O")){x[k]= Y_H2O_init; }
      else if(k==gas.speciesIndex("H2")) {x[k]= Y_H2_init; }
      else if(k==gas.speciesIndex("N2")) {x[k]= Y_N2_init; }
      else{ x[k]=0.0; }
    }
    gas.setState_TPY(temp,pressure,DATA_PTR(x));

where for example Y_H2_init is the mass fraction of H2 that you need to change.
Cheers,


--
You received this message because you are subscribed to the Google Groups "Cantera User's Group" group.
To post to this group, send email to canter...@googlegroups.com.
To unsubscribe from this group, send email to cantera-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cantera-users?hl=en.


Pat

unread,
Apr 4, 2011, 5:20:45 PM4/4/11
to Cantera User's Group
thanks for the reply, sounds just like what I want!
Only problem is, I cant find the flamespeed file in my demos. Is it
only included in the latest version, and does that mean I have to
build it for c++, cause so far Im using a matlab/python version
installed via msi installer....(version 1.7)

thanks




On 1 Apr., 19:46, Mahdi Salehi <smehdi...@gmail.com> wrote:
> Hi,
> You need to change the flamespeed.cpp code. All you have to do is to change
> your inlet condition. If you need to change the mass fractions at the inlet:
>
>     vector_fp x;
>     x.resize(nsp);
>     for(int k=0;k<nsp;k++){
>       if(k==gas.speciesIndex("CH4"))     {x[k]= Y_CH4_init; }
>       else if(k==gas.speciesIndex("O2")) {x[k]= Y_O2_init; }
>       else if(k==gas.speciesIndex("CO2")){x[k]= Y_CO2_init; }
>       else if(k==gas.speciesIndex("H2O")){x[k]= Y_H2O_init; }
>       else if(k==gas.speciesIndex("H2")) {x[k]= Y_H2_init; }
>       else if(k==gas.speciesIndex("N2")) {x[k]= Y_N2_init; }
>       else{ x[k]=0.0; }
>     }
>     gas.setState_TPY(temp,pressure,DATA_PTR(x));
>
> where for example Y_H2_init is the mass fraction of H2 that you need to
> change.
> Cheers,
>

Mahdi Salehi

unread,
Apr 4, 2011, 5:23:41 PM4/4/11
to canter...@googlegroups.com
I am using Version 1.8 and here is the location:
cantera-1.8/cantera-1.8/Cantera/cxx/demos/
Reply all
Reply to author
Forward
Message has been deleted
0 new messages