|
[Sponsors] |
[OF 5.0] Add new reaction rate type in thermophysicalmodel |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 17, 2018, 09:49 |
[OF 5.0] Add new reaction rate type in thermophysicalmodel
|
#1 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 373
Rep Power: 11 |
Howdy folks:
I am thinking of adding a time dependent new reaction type (photolysis) into OpenFOAM. It should reside under ${FOAM_SRC}/thermophysicalModels/specie/reaction/reactionRate as with other reaction rate types. At the moment I am not intending on changing any specific solver, so my (naive) plan is to recompile libthermophysicalmodel.so and have this change visible to all solvers that use this library. My questions are: 1) Can I simply add a folder (photolysisRate, for instance) under the reactionRate folder (where other reaction rate type are present). 2) Is added the corresponding .H and I.H files into the Make/files file be sufficient to tell wallmake to pick them up. 3) Do I have to create a new solver (from reactingFoam, say) that uses this new library? Would the default solver otherwise be able to pick up the new library (or at least recompiled without explicitly using the new solver)? Thanks in advance, GK. |
|
May 17, 2018, 11:12 |
I figured it out
|
#2 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 373
Rep Power: 11 |
Looks like I figured it out. Here is what I did:
say, my new reaction rate is called "xyzRate" 1) Make a directory "xyzRate" (it could be anywhere, but I placed it in ${FOAM_SRC}/thermophysicalModels/specie/reaction/reactionRate) 2) In this directory create two other files: xyzRate.H and xyzRateI.H. (I took the two .H files from ArrheniusReactionRate as template). 3) Soft link (i.e., ln -s) the two files from (2) to ${FOAM_SRC}/thermophysicalModels/specie/lnInclude 4) Make a backup to file ${FOAM_SRC}/thermophysicalModels/specie/reaction/reactions/makeReactions.C before modifying it. You need to locate the block starting Code:
#define makeReactions(Thermo, Reaction) \ defineTemplateTypeNameAndDebug(Reaction, 0); \ defineTemplateRunTimeSelectionTable(Reaction, dictionary); \ Code:
makeReaction(Thermo, IrreversibleReaction, xyzRate) \ 6) Compile and build (Allwmake), either at the root level ${FOAM_SRC}, or under ${FOAM_SRC}/thermophysicalModels/ 7) If you have an example handy, change one of the reactions (under constants/) to a type that you know is not available (like "spontaneousCombustion"). When you run, say, reactingFoam, you should get the following error: Code:
Unknown reaction type spontaneousCombustion Valid reaction types are : 31 ( [skipped] ... irreversibleXyzReaction [skipped] ... ) GK. Last edited by Gerry Kan; May 24, 2018 at 04:13. Reason: Minor edit |
|
August 25, 2019, 08:59 |
|
#3 |
New Member
Join Date: Aug 2019
Posts: 1
Rep Power: 0 |
Thank you for your explanations!
I have a question : How can I do, to have a reaction rate depending on the X-coordinate? How to define a mesh dependence in the reaction rate. Thank you in advance for your help. |
|
Tags |
development, openfoam, reactionrate, thermophysicalmodels |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
activeBaffleVelocity boundary condition ? | om3ro | OpenFOAM Programming & Development | 10 | November 17, 2020 00:26 |
Problem with continuity simpleFoam kkl omega airfoils | ibelunatic | OpenFOAM Running, Solving & CFD | 0 | March 20, 2018 12:48 |
multiphaseEulerFoam/tank discharge | ves | OpenFOAM Running, Solving & CFD | 8 | December 31, 2017 15:59 |
Modified pimpleFoam solver to MRFPimpleFoam solver | hiuluom | OpenFOAM Programming & Development | 12 | June 14, 2015 22:22 |
LES supersonic free jet | martyn88 | OpenFOAM | 22 | April 17, 2015 07:00 |