|
[Sponsors] |
External Chemistry Solvers and Internal Reaction Rates |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 12, 2011, 15:04 |
External Chemistry Solvers and Internal Reaction Rates
|
#1 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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! |
|
July 13, 2011, 07:23 |
|
#2 |
Senior Member
Nakul
Join Date: Apr 2010
Location: India
Posts: 147
Rep Power: 16 |
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 |
|
July 13, 2011, 14:42 |
|
#3 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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()() If there is a cleaner way to handle this, especially for long term compatibility with FOAM, that would be great to hear. |
|
April 4, 2013, 06:45 |
|
#4 |
New Member
Terrence Nguyen
Join Date: Jan 2012
Posts: 13
Rep Power: 14 |
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. |
|
May 11, 2013, 09:19 |
|
#5 |
New Member
Join Date: Jan 2013
Posts: 3
Rep Power: 13 |
Hi Terrence:
I have the same question with you . Have you find the way to slove it. |
|
May 15, 2013, 13:55 |
|
#6 |
New Member
Terrence Nguyen
Join Date: Jan 2012
Posts: 13
Rep Power: 14 |
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 |
|
May 17, 2013, 08:11 |
|
#7 | |
New Member
Join Date: Jan 2013
Posts: 3
Rep Power: 13 |
Quote:
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 !! |
||
|
|