CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   handling complex reaction schemes with fluent (https://www.cfd-online.com/Forums/fluent/213037-handling-complex-reaction-schemes-fluent.html)

Weiqiang Liu December 12, 2018 12:20

handling complex reaction schemes with fluent
 
Hi all,
I am writing this thread to ask a really general question. That is how to deal with the divergence problem with Ansys Fluent.

The project I have been doing is the catalytic micro-channel combustion of methane.

Firstly, the version of fluent I used was fluent 15 and the gas and surface mechanisms I used were GRI 3.0 and DETCHEM respectively. I kept getting the error 'received fatal error: segmentation fault'. After some struggling, I found when I changed the gas mechanism to GRI 2.0, the error did not happen again.
By consulting to fluent staff, I knew it is because the old version of Fluent can not handle gas species more than 50 while GRI 3.0 has 53 species.

from the point on, I used Fluent 17.0 to continue my simulation. However, fluent keeps complaining about 'divergence detected in AMG solver: temperature'. Some measurements have been taken in attempting to solve this problem as follows:
1. decreasing the under relaxation factors. This is the most common method recommended in literature and forums.

2. turn off energy equation to get a 'cold flow' results and turn on energy equation to continue iteration.

3. make the leading edge of the catalytic wall inert. In other words, there is no surface reaction on the leading edge of the wall. Instead, a temperature boundary condition which has the same temperature with the inlet mixture is imposed.

4. using simpler gas mechanisms other than GRI 3.0

However, nothing above works. Fluent keeps telling me 'divergence detected in AMG solver'.

So I wrote email to those authors who have published papers of the same topic . Most of the authors used the in-house CFD code developed by their own group. They gave me suggestions just similar to those I mentioned above. Some other authors who used Fluent as well just told me to give a better initial guess in order to converge.

I am wondering is it really that hard for fluent to handle complex reaction schemes? Hope someone can give me some suggestions under this thread. or freshers like me can discuss this topic and share your experience.

Thanks very much!

weiqiang.

LuckyTran December 12, 2018 13:07

Quote:

Originally Posted by Weiqiang Liu (Post 719005)
By consulting to fluent staff, I knew it is because the old version of Fluent can not handle gas species more than 50 while GRI 3.0 has 53 species.


This is or should be well known. It's written in the Fluent manual and Fluent even comes shipped with a 50 species version of GRIMECH 3.0, the infamous grimech30_50 and it is used in one of the tutorials. It is infamously well-known precisely because of the hardcoded 50 species limitation in Fluent. Not sure why the developers chose the number 50, but it happened. A few weeks of CFD will save you from a few minutes of reading.

Quote:

Originally Posted by Weiqiang Liu (Post 719005)

I am wondering is it really that hard for fluent to handle complex reaction schemes? Hope someone can give me some suggestions under this thread. or freshers like me can discuss this topic and share your experience.


What makes any reaction scheme complex? Grimech is by no means a complex kinetic model, especially considering that it's been tuned to produce results. You are just solving a bunch of coupled ode's. Funny that you mentioned the number of species but not the number of reactions in Grimech...

I echo all the suggestions already given. It doesn't matter how awesome any code is. At the end of the day you need:
Correct boundary conditions. A good initial guess. A proper mesh.

Assuming you didn't screw up with BC's and a mesh, coming up with a good initial guess is not trivial. If you rely on Fluent automatically initialization, it's hit or miss and likely a miss because the temperature is probably not uniform in a reacting flow. Notice that all of the recommendations are methods of achieving better solution states (i.e. they're ways to come up with a better initial guess).


It really doesn't matter that you case is diverging and you are running some sort of reaction model. Unless you input the wrong model, you case diverged. That's all. And you follow the general rules for dealing with divergence.

Weiqiang Liu December 12, 2018 13:53

Quote:

Originally Posted by LuckyTran (Post 719009)
This is or should be well known. It's written in the Fluent manual and Fluent even comes shipped with a 50 species version of GRIMECH 3.0, the infamous grimech30_50 and it is used in one of the tutorials. It is infamously well-known precisely because of the hardcoded 50 species limitation in Fluent. Not sure why the developers chose the number 50, but it happened. A few weeks of CFD will save you from a few minutes of reading.




What makes any reaction scheme complex? Grimech is by no means a complex kinetic model, especially considering that it's been tuned to produce results. You are just solving a bunch of coupled ode's. Funny that you mentioned the number of species but not the number of reactions in Grimech...

I echo all the suggestions already given. It doesn't matter how awesome any code is. At the end of the day you need:
Correct boundary conditions. A good initial guess. A proper mesh.

Assuming you didn't screw up with BC's and a mesh, coming up with a good initial guess is not trivial. If you rely on Fluent automatically initialization, it's hit or miss and likely a miss because the temperature is probably not uniform in a reacting flow. Notice that all of the recommendations are methods of achieving better solution states (i.e. they're ways to come up with a better initial guess).


It really doesn't matter that you case is diverging and you are running some sort of reaction model. Unless you input the wrong model, you case diverged. That's all. And you follow the general rules for dealing with divergence.

hi,

the geometry is just a straight channel including solid and fluid. I checked the mesh quality in ICEM and fluent and the quality was reported ok in both software.

Regarding to BCs, velocity inlet and pressure outlet are imposed. On the interface of the solid and fluid, surface reactions happens. other BCs are wall boundary condition by default.

I use standard initialization in Fluent and normally I would patch a partial high temperature to ignite the mixture.

Actually, I don't really understand how to give a good initial guess to the whole domain. Do you mean I should patch all the temperature, species mole fractions in every part of the mesh and make them as close as possible to literature values? That should be a good enough guess for initial values.

thanks

weiqiang

LuckyTran December 12, 2018 18:03

The standard initialization gives uniform values to over the domain. Even if you use patches, you end up with a bunch of discontinuities.


As I said it's non-trivial how to come up with a good initial guess. Not only do you have to give the correct distribution for say velocity, temperature, pressure, you also have to make sure that all the fields are consistent with one another. Even if you give the right initial velocity field, having the wrong pressure or temperature or species fields can just as easily cause a divergence error. That's why it's so rare that anyone actually does this and why it is so common to do steps 1-4.

Weiqiang Liu December 13, 2018 12:21

Quote:

Originally Posted by LuckyTran (Post 719024)
The standard initialization gives uniform values to over the domain. Even if you use patches, you end up with a bunch of discontinuities.


As I said it's non-trivial how to come up with a good initial guess. Not only do you have to give the correct distribution for say velocity, temperature, pressure, you also have to make sure that all the fields are consistent with one another. Even if you give the right initial velocity field, having the wrong pressure or temperature or species fields can just as easily cause a divergence error. That's why it's so rare that anyone actually does this and why it is so common to do steps 1-4.

Thanks for your explanation. Before you emphasize this, I really thought initial guess for steady state calculation was trivial.
so If standard initialization gives uniform values to the whole domain and patches just ends up with a bunch of discontinuities , I should use hybrid initialization or UDF to get a good initial guess?

somebody told me that I should refine my mesh. However, it's just a straight channel with solid and fluid domain. I discretized the computation domain with the same parameters in literature. The mesh is with good quality according to my point-view. Do you think is the divergence related to mesh quality?

LuckyTran December 13, 2018 16:46

It is trivial to press the initialize button in Fluent. But as you are well aware, getting a converged solution after that is not so trivial.


Quote:

Originally Posted by Weiqiang Liu (Post 719110)
so If standard initialization gives uniform values to the whole domain and patches just ends up with a bunch of discontinuities , I should use hybrid initialization or UDF to get a good initial guess?


The problem starts here. Yes. The discontinuities are really big trouble makers. The hybrid initialization does better, but it still doesn't always produce a good enough initial guess. Let's say you wrote a UDF to be able to initialize it however you like, what would you initialize it with? The point of doing CFD is to figure out what the solution is. If you already knew the solution... You wouldn't be doing CFD in the first place.

You can refine the mesh until the universe ends and that will not help you come up with a better initial guess. Even with a coarse mesh, you should be able to get a result. Refining the mesh often hides or causes more problems.

Weiqiang Liu December 14, 2018 12:41

Quote:

Originally Posted by LuckyTran (Post 719124)
It is trivial to press the initialize button in Fluent. But as you are well aware, getting a converged solution after that is not so trivial.





The problem starts here. Yes. The discontinuities are really big trouble makers. The hybrid initialization does better, but it still doesn't always produce a good enough initial guess. Let's say you wrote a UDF to be able to initialize it however you like, what would you initialize it with? The point of doing CFD is to figure out what the solution is. If you already knew the solution... You wouldn't be doing CFD in the first place.

You can refine the mesh until the universe ends and that will not help you come up with a better initial guess. Even with a coarse mesh, you should be able to get a result. Refining the mesh often hides or causes more problems.



So you mean getting a good initial guess is not equivalent to as close as possible to real value but initial guess that can benefit convergence?

I tried to use simplified GRI mechanism which has 19 species and 84 reactions. It turned out fluent complained about divergence more quickly than the detailed GRI mechanism. I am wondering if it is because the simplified mechanism is more stiff than detailed one, which caused the divergence more quickly.

LuckyTran December 14, 2018 22:58

No I'm saying: 1) how the hell can you ever actually truly come up with a good initial guess? 2) even if you do guess completely correctly the velocity field, having any other fields inconsistent with the velocity field is just as bad as having a discontinuity

Weiqiang Liu December 15, 2018 09:29

Quote:

Originally Posted by LuckyTran (Post 719222)
No I'm saying: 1) how the hell can you ever actually truly come up with a good initial guess? 2) even if you do guess completely correctly the velocity field, having any other fields inconsistent with the velocity field is just as bad as having a discontinuity

ok I get it. Thanks for your sharing.

hnemati January 7, 2019 03:50

Quote:

Originally Posted by Weiqiang Liu (Post 719245)
ok I get it. Thanks for your sharing.

Hi man,
Do you get reverse flow during the simulation? If so, try to change your outlet BC to outlet~vent where you can introduce some resistance to the flow.

Weiqiang Liu January 7, 2019 10:58

Quote:

Originally Posted by hnemati (Post 721092)
Hi man,
Do you get reverse flow during the simulation? If so, try to change your outlet BC to outlet~vent where you can introduce some resistance to the flow.

hello,

I never get reverse flow during simulation. I just can not get very reasonable results. either the mixture can not be ignited or the maximum temperature is too low.

anyway, thanks for your advice.

weiqiang


All times are GMT -4. The time now is 10:37.