CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Combustion Modeling-Using chemFoam in reactive flow (http://www.cfd-online.com/Forums/openfoam-solving/108468-combustion-modeling-using-chemfoam-reactive-flow.html)

mhsn October 24, 2012 10:41

Combustion Modeling-Using chemFoam in reactive flow
 
Dear Foamers,

I like to model premixed combustion in a narrow channel using detailed chemistry. I know that chemFoam is a solver that can implement detailed reaction mechanisms; however, it is only for one cell :( Does anyone know how I can use the capability of this solver in other combustion solvers, for instance in XiFoam?

Any help would be appreciated!
Thanks

Hanzo October 31, 2012 04:18

Hi mhsn,

I think chemFoam is just a validation solver for the chemistry provided in OpenFoam. One can use it to analyse reactions and compare with other solvers like chemkin etc:

http://www.openfoam.org/version2.0.0/chemistry.php

I think, the detailed chemistry can be used by the other solvers as well (e.g. you can set up a reactingFoam case using the same chemistry functionality like in the chemFoam case).

Or is there some functionality I am not considering?

mhsn October 31, 2012 13:11

Quote:

Originally Posted by Hanzo (Post 389410)
Hi mhsn,

I think, the detailed chemistry can be used by the other solvers as well (e.g. you can set up a reactingFoam case using the same chemistry functionality like in the chemFoam case).

Hanzo, Thanks for your reply. Actually, what you're saying about using the same chemistry functionality like in the chemFoam case is my question. I'm very new to OF and not sure how I can do it! Can you be more specific or link me to something that has been done like that so that I can get some clues how to start?

Thanks

Hanzo October 31, 2012 23:30

Quote:

Originally Posted by mhsn (Post 389516)
Can you be more specific or link me to something that has been done like that so that I can get some clues how to start?

Thanks

I think, using the following is a nice start:

http://www.tfd.chalmers.se/~hani/kur...actingFoam.pdf

It's a tutorial written by Andreas Lundstrom and he introduces two own reactions, shows how to write that down in chemkin files and also explains how to set up the 7 high-low coeffs for this simple case.

Later, you could use the chemkinToFoam tool to convert the input into the nativeOpenFoam chemistry format, because, I think, this format is much more flexible and easier to read.

Last but not least: there are some minor typos in the tutorial when it comes to compute some values, so don't get confused by this

Also, the Tutorial in the OpenFoam Wiki:
http://openfoamwiki.net/index.php/Tu..._firstTutorial

however, here the reactions are already quite complex

mhsn November 1, 2012 16:21

Thanks for the information :)
I will take a look at these tutorials to see how it works.

Hanzo November 2, 2012 02:00

You are welcome!

I forgot, here is the link to the case files for the Lundstrom tutorial.

http://www.tfd.chalmers.se/~hani/kur...utorial.tar.gz

mhsn November 9, 2012 17:47

Hanzo,
the tutorial you sent to me helped a lot. Now I can run my test case using chemkin mechanisms. But, I have another issue now. What if I want to use transport properties from chemkin files? Do you know how I can read the transport properties like I do for them file in chemkin format?
Thanks

Hanzo November 13, 2012 05:40

Quote:

Originally Posted by mhsn (Post 391332)
Hanzo,
the tutorial you sent to me helped a lot. Now I can run my test case using chemkin mechanisms. But, I have another issue now. What if I want to use transport properties from chemkin files? Do you know how I can read the transport properties like I do for them file in chemkin format?
Thanks

sorry, what do you mean with transport properties from chemkin files?

you only have the reaction parameters and the thermal properties stored in the chemkin files.

mhsn November 13, 2012 11:20

Basically, there are three different chemkin files for each mechanism: 1) for reactions 2) for thermal properties and 3) for transport properties such as diffusion coefficients, thermal conductivity, viscosity and such other properties.
OF has readers for reactions and thermal properties, and I'm not sure if there is any way that I can use chemkin transport file! Do you have any idea how these properties can be implemented for reactingFoam?

Hanzo November 13, 2012 22:27

Quote:

Originally Posted by mhsn (Post 391877)
Basically, there are three different chemkin files for each mechanism: 1) for reactions 2) for thermal properties and 3) for transport properties such as diffusion coefficients, thermal conductivity, viscosity and such other properties.

I never used Chemkin but now I see your point.

Quote:

Originally Posted by mhsn (Post 391877)
OF has readers for reactions and thermal properties, and I'm not sure if there is any way that I can use chemkin transport file! Do you have any idea how these properties can be implemented for reactingFoam?

When it comes to the transport properties I usually have a look on the equation the solver tries to solve. In reactingFoam if you have a look in the Yeqn.H

http://foam.sourceforge.net/docs/cpp/a02406_source.html
Code:

00024            fvScalarMatrix YiEqn
00025            (
00026                fvm::ddt(rho, Yi)
00027              + mvConvection->fvmDiv(phi, Yi)
00028              - fvm::laplacian(turbulence->muEff(), Yi)
00029              ==
00030                combustion->R(Yi)
00031            );

The Diffusion coefficient is set to muEff. This comes from the underlying assumption of unity turbulent Lewis number which is commonly used in turbulent combustion (http://www.openfoam.org/mantisbt/view.php?id=277) .

To input your own diffusion coefficients you should do something similar like here
http://www.cfd-online.com/Forums/ope...efficient.html

By the way, you are working a lot with the chemistry in openFoam. Maybe you can have a small look on my problem -> http://www.cfd-online.com/Forums/ope...-solution.html
I still have some conversion issues there :(

mhsn November 15, 2012 17:38

Hi Hanzo, thanks for your reply. Actually, because for the work I'm going to do there are plenty of species (around 50) with different mechanisms, that should not be the very right way to follow that. I really like a way like how thermal properties files are read in chemkin format.
About your question, I checked that post. It is really weird that you have discrepancy by factor 7! I think you may have to double check all units that you've used to see if they are consistent with other units used in the solver! That may be the reason!

Thanks

lx882211 June 2, 2016 11:35

Quote:

Originally Posted by Hanzo (Post 389590)
I think, using the following is a nice start:

http://www.tfd.chalmers.se/~hani/kur...actingFoam.pdf

It's a tutorial written by Andreas Lundstrom and he introduces two own reactions, shows how to write that down in chemkin files and also explains how to set up the 7 high-low coeffs for this simple case.

Later, you could use the chemkinToFoam tool to convert the input into the nativeOpenFoam chemistry format, because, I think, this format is much more flexible and easier to read.

Last but not least: there are some minor typos in the tutorial when it comes to compute some values, so don't get confused by this

Also, the Tutorial in the OpenFoam Wiki:
http://openfoamwiki.net/index.php/Tu..._firstTutorial

however, here the reactions are already quite complex

I meet a problem in Openfoam 2.3.0, reactingFoam, i need the data of CH4 reaction rate, but i failed to autowrite it like U or Yi.

First i added this code in the CreatField.H,

volScalarField Rrate
(
IOobject
(
"Rrate",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("Rrate", dimMass/dimVolume/dimTime, 0.0)
);

Then, i added this code in YEqn,

forAll(Y, i)
{
if (Y[i].name() != "CH4")
RR = reaction->R(Yi);
}

After wmake, it shows

YEqn.H:26:14: error: no match for ‘operator=’ (operand types are ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ and ‘Foam::tmp<Foam::fvMatrix<double> >’)
Rrate = reaction->R(Yi);

Can you tell me how to do that? Thank you very much.


All times are GMT -4. The time now is 02:39.