CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

External Chemistry Solvers and Internal Reaction Rates

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 12, 2011, 14:04
Default External Chemistry Solvers and Internal Reaction Rates
  #1
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 652
Rep Power: 17
mturcios777 will become famous soon enough
Hello All,

I'm updating an in-house solver that uses an external library to solve the combustion chemistry in a fast and efficient manner (well, at least we think so ). We're upgrading our systems to OF 2.0.x, and one problem is that with the change in solvers to sensible enthalpy the chemical enthalpy source terms aren't updated as we have external arrays that store the reaction rates that aren't updated.

I'm unsure the best way to make our system work with the new thermophysical models. I've tried making an public access function/member but am having trouble finding where it should be defined/implemented. I've also thought that maybe I should just define a new chemistry library (based on the code in ODEChemistry) with functions that call the external library and abstract it one level away from the base solver code).

Any suggestions/opinions would be appreciated. Long term compatibility with OpenFOAM is the primary consideration, with speed of implementation second. Thanks in advance!
mturcios777 is offline   Reply With Quote

Old   July 13, 2011, 06:23
Default
  #2
Senior Member
 
Nakul
Join Date: Apr 2010
Location: India
Posts: 147
Rep Power: 6
nakul is on a distinguished road
Hi,

It would be helpful if you could provide some more details. Based upon what you said, I would like to know if your solver is incapable of determining total enthalpy?

If it can determine that then there won't be much problem. Although the thermophysical model after OF-1.7 has been sensible enthalpy based, but the variable of total enthalpy still exists in the code of most solvers.

You may provide some more details regarding your solver and then we would see what can be done!

-Nakul
nakul is offline   Reply With Quote

Old   July 13, 2011, 13:42
Default
  #3
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 652
Rep Power: 17
mturcios777 will become famous soon enough
Thanks for your interest in my problem. The library itself is mainly for calculating the reaction rates, which then feeds into the OpenFOAM solver. I've partially solved the problem by introducting a public function to psiChemistry (virtual here) and ODEChemistry (we use the ODE solver for slow reactions involving nitrogen) that copies over the reaction rates calculated by the eternal library.

Actually this is the second "solution" I've come up with. This first was to create a version of psiChemistryModel that used hCombustionThermo instead of hsCombustionThermo (this may be overkill, but I couldn't figure out how to get access to h), and this replicates the exact behavior of our old solver.

However, I wanted to see what difference it would make to use the hsCombustionThermo instead, and while digging through the code found that I need to add
Code:
 chemistry.Sh()()
to the enthalpy transport equations, and following function calls through that I find that the reaction rates are used in calculating chemical enthalpy all the way back in janafThermo. Now that I copy rate fields over and add the chemical source term my temperature field changes; in fact it overshoots and I get a temperature that crashes the solver, so I need to play with that.

If there is a cleaner way to handle this, especially for long term compatibility with FOAM, that would be great to hear.
mturcios777 is offline   Reply With Quote

Old   April 4, 2013, 05:45
Default
  #4
New Member
 
Terrence Nguyen
Join Date: Jan 2012
Posts: 11
Rep Power: 4
hismother is on a distinguished road
hi Marco,

I am also trying to use hCombustionThermo with psiChemistryModel instead of hsCombustionThermo. Can you show me how you defined the thermo model in createFields.H when you replace hsCombustionThermo by hCombustionThermo. I tried, but somehow openfoam doesn't understand hCombustionThermo that I defined.
hismother is offline   Reply With Quote

Old   May 11, 2013, 08:19
Default
  #5
New Member
 
Join Date: Jan 2013
Posts: 3
Rep Power: 3
charmc is on a distinguished road
Hi Terrence:
I have the same question with you . Have you find the way to slove it.
charmc is offline   Reply With Quote

Old   May 15, 2013, 12:55
Default
  #6
New Member
 
Terrence Nguyen
Join Date: Jan 2012
Posts: 11
Rep Power: 4
hismother is on a distinguished road
Hi charmc,

the problem is Openfoam doesn't include the total enthalpy class in the thermo class anymore. But the code for its class is still there, in the folder of src/thermophysicalModels/reactionThermo/combustionthermo/.... So what I did was I included the hCombustionThermo class in the class of psiChemistryModel. You will understand if you look at the file hCombustionThermos.C at the folder position I gave above. After that you can define the hCombustionThermo in createFields.H in the solver code.

Hope that helps,

Terrence
hismother is offline   Reply With Quote

Old   May 17, 2013, 07:11
Default
  #7
New Member
 
Join Date: Jan 2013
Posts: 3
Rep Power: 3
charmc is on a distinguished road
Quote:
Originally Posted by hismother View Post
Hi charmc,

the problem is Openfoam doesn't include the total enthalpy class in the thermo class anymore. But the code for its class is still there, in the folder of src/thermophysicalModels/reactionThermo/combustionthermo/.... So what I did was I included the hCombustionThermo class in the class of psiChemistryModel. You will understand if you look at the file hCombustionThermos.C at the folder position I gave above. After that you can define the hCombustionThermo in createFields.H in the solver code.

Hope that helps,

Terrence
Hi Terrence:
Thank you for your reply! I think I can understand the question .But as a newbie , I have a little knowledge about Openfoam Source Code. I do not know how to " included the hCombustionThermo class in the class of psiChemistryModel" ? Do me a faver , please !

Best wishes !!
charmc is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 19:46.