Adding of a new thermotype
Hi everybody,
I hope ereything is good for you. I am struggling to add a new thermotype. I would like to use perfectfluid for my problem : thermoType { type hePsiThermo; mixture singleStepReactingMixture; transport sutherland; thermo janaf; energy sensibleEnthalpy; equationOfState perfectFluid; specie specie; } I think I add all that openfoam needs: 1) In psiReactionThermos.C, makeReactionThermo ( psiThermo, psiReactionThermo, hePsiThermo, singleStepReactingMixture, sutherlandTransport, sensibleEnthalpy, janafThermo, perfectFluid, specie ); 2) In thermoPhysicsTypes.H, typedef sutherlandTransport < species::thermo < janafThermo < perfectFluid<specie> >, sensibleEnthalpy > > perfectFluidPhysics; 3) In reactionsTypes.H, typedef Reaction<perfectFluidPhysics> perfectFluidReaction; 4) In makeReactions.C, makeReactions(perfectFluidPhysics, perfectFluidReaction) 5) I even add something pointless for me (I think) in makeChemistryReaders.C: makeChemistryReader(perfectFluidPhysics); makeChemistryReaderType(foamChemistryReader, perfectFluidPhysics); I compiled all of this and all OpenFOAM-dev. It works until I want to use the solver. I am using fireFoam but it is the same for an other solver, it stops at the beginning of the solver. I do not know if the case is important, I do not think so because it runs when I use perfectGas. I do not understand the error, the thermotype is added, I am sure of that it does not work. The message is: Code:
Create time |
No help ?
Hello,
nobody has suggestion ? If someone could tell me what can be wrong in the steps. Have a good day. |
New equation of state
Hello Fabien,
I am trying to do the same thing as you, but i have difficulties so i was wondering if you managed to do what you wanted... I created a new thermophysical model in order to implement a new equation of state with a custom solver derived from reactingFoam. It works when i am in a non reacting case, but when i add combustion, my solver don't recognize my new equation of state any more. If you succeeded in your task, you maybe have some advices for me to make it work ...? Thanks in advance, Have a nice day, Cécile |
Hello,
I gave up (sorry) concerning this implementation because actually, it was not usefull for me. However, I think you should put the error message that you have because it can help me (perhaps). An other possibility is to use an eos that is recognized by reactingFoam and modify within the eos file (do not do that for perfect gas because it is linked with janaf and I think you cannot). Moreover, have you done all the steps that I had done ? Have a good day (if you can:p) |
Thank you so much for answering me !
Yes i have done all the steps that you have done. I have created new libspecie.so and libreactionThermophysicalModels.so libraries with my eos. But when i run a reacting case it doesn't see the new libraries, execution fails because of the wrong thermo model while it runs well in a cold case. You gave me a clue because my custom eos is derived from parfectGas and i use janaf thermo tables, i am going to look this point further... Thanks again! Cécile |
Ok keep me up to date, I am still interested.
|
Hello you two, I don't know if this is of any help, but I implemented a new thermo type with a new janaf model(note that this janaf model is equal to the one implemetented in openFOAM) and transport model, which I used with the multiRegionSimpleReactingFoam solver, link: https://github.com/TonkomoLLC/multiRegionReactingFoam.
I have linked a dropbox link to the developed thermotype ready to be build as well as a case with the solver and thermotype implemented. The mentioned solver is also included in the dropbox link. Hope its to any help. https://www.dropbox.com/s/7igba23zvj...er.tar.gz?dl=0 Please note if you wan't to run my example, run the AllMesh, then copy the content of the .org folders to the respective directories and then run the Allrun. |
Thank you for your files!
I'm gonna have a look and try to understand how it works. |
Let me know if there is any issues with running the example case.
|
openFOAM 6 -- add thermoType
Hi There!
Trying to add e.g. a custom equation of state: thermoType { type heRhoThermo; mixture pureMixture; transport const; thermo hConst; equationOfState myState; specie specie; energy sensibleEnthalpy; } It used to work perfectly well under opneFOAM 4.x in the sense that it recognized the combination while running a CHT multi-region solver. Now that combustion has been added to the multi-region solver, the combination is not recognized even though I have done everything previously used in 4.x and what is described in the beginning of this thread. The 4.x CHT multi-region solver recompiled for openFOAM 6 also works fine. The error I get is Unknown rhoReactionThermo Type ... as if it is not part of thermos. https://www.cfd-online.com/Forums/da...AASUVORK5CYII= And the confusing thing is that if I add a thermo to rhoReacationThermos.C it also works ... but there is no pureMixture. Has anyone seen this before? Thanks! |
Hello LennyZ,
Are you able to upload a compile ready case of the custom thermoType so that I can try to solve the issue? Regards Lasse |
Hello Lasse,
It'll take a bit of effort to upload something as an example. What I can say is that is quite standard -- the usual changes in therrmophicalModels/specie & basic described above (very top) in the thread. I am sure it is not syntax since, like I said, if I simply change the solvers from this new (openFOAM 6) chtMultiRegionFoam to my old 4.x (but recompiled to openFOAM 6) solver the thermoType combination -- there is no issue. Frankly, it is not just the equation of state -- all of the entries are custom: transport, thermo and equation of state, and am I talking about heRhoThermo. chtMultiRegionFoam.C includes these, and it looks like rhoReactionThermo.H here instead of rhoThermo.H is responsible ... requires something I do not do, or do something I should not do. There is a detailed wiki on chtMultiRegionFoam.C. #include "fvCFD.H" #include "turbulentFluidThermoModel.H" #include "rhoReactionThermo.H" #include "CombustionModel.H" #include "fixedGradientFvPatchFields.H" #include "regionProperties.H" #include "compressibleCourantNo.H" #include "solidRegionDiffNo.H" #include "solidThermo.H" #include "radiationModel.H" #include "fvOptions.H" #include "coordinateSystem.H" #include "pimpleMultiRegionControl.H" #include "pressureControl.H" |
Solved, perhaps
... I think I have figured out this one out. There is quite a few things I have tried in "reactionThermo" ... but the key element that I missed is probably a "makeThermoPhysicsReactionThermo" in "rhoReactionThermos.C" like this:
makeThermoPhysicsReactionThermo ( rhoReactionThermo, heRhoThermo, singleComponentMixture, my_blah_blah_Physics ); This way the CHT solver somehow finds its way to specie and rhoThermo, to rhoThermos.C where the type combination with a pureMixture is listed as a Thermos. So for now I think that is issue is closed (this is again: openFOAM 6). And it is probably similar in openFOAM 4.x too and elsewhere. |
All times are GMT -4. The time now is 13:09. |