Adding new Transport properties model
Hello Foamers!
I am currently trying to implement a method for calculating viscosities and thermal conductivities based on the Chapman-Enskog assumption (~Kinetic Theory method in Fluent). Starting from sutherlandTransport, this is very simple but I still have 2 questions: 1) Is it necessary to rebuild psiThermo, psiReactionThermo and psiChemistryModel equivalent classes that can handle this method of calculating transport properties or can I just make this method selectable somewhere? Since obviously at the moment the kinetic theory transport + janaf thermo is not considered a valid combination. 2) In case there's no way to make 1) work, I already went ahead and tried to build "pyThermo", ... as exact copies of the psi-equivalents, while making the necessary changes in thermoPhysicsTypes.H, PyThermos.C, pyReactionThermos.C, ... This new thermo lib compiles without a problem, as well as the pyChemistryModel lib but now comes the strange part: when I try to recompile my custom solver to use this pyChemistryModel instead of psyChemistryModel (everything exact copy, only adjusted so it can use kineticTheoryTransport), I get an undefined reference error: Code:
Make/linux64GccDPOpt/QSSAFoam.o: In function `main': My solver Make/options file looks like this, so I assume the libraries are correctly linked? Code:
EXE_INC = \ Best regards, David |
I'm still struggling with this matter...
No one ever tried to implement a new method of calculating specie transport or thermo properties? Best regards, David |
Greetings David,
It's not as much of a matter as to if someone has implemented this, it's a matter of someone who might have done it to see your question And to have time to answer! ;) ... it took me a while to figure out what the problem was, because I didn't read the whole post the first couple of times... OK, so the problem is this: Code:
-L$(FOAM_USER_LIBBIN)/libpyrolysisModel.so \ Code:
-L$(FOAM_USER_LIBBIN) \ Bruno |
Ah of course, thanks for pointing that out!
Apparently it's also not necessary to create a copy of psiThermo, psiReactionThermo, ... but all it takes is just to add the new thermo combinations to the runTimeSelectionTable. For my case this was achieved by the following code in the ktTransport.H file: Code:
makeThermo Kind regards, David |
On a related note, I'd like to implement the Wilke equation for calculating the viscosity of a gas mixture (cf. Fluent implementation: http://www.sharcnet.ca/Software/Flue...ug/node296.htm). I see that others have done this before me and although apparently this should have become easier in 2.2.x, I can't quite figure out where to make the changes.
In my case I'm using psiReactionThermo, so I suppose the essential part is in hePsiThermo, correct? Code:
template<class BasicPsiThermo, class MixtureType> Thank you in advance for any advice (and/or working code :o) to help me solve this problem! Best regards, David |
There's plenty of mixing discussion on the forums in how the mixture quantities are handled... A thread of my own that helped me understand whats going on greatly is here (for 2.1.1, I'm not sure what 2.2.x has done with this but first glances show its very similar)
That's a good starting point, as far as I understand it it's not quite as simple as you stated above, I'm not familiar with the wilke model, but I'm guessing you can't change the += operator to fit with the model? I've been secretly hoping someone would change around the mixture methods so we could select a mixture method at run time rather than be forced into the molar weighted coefficients but alas. Also, your typedefs inside the .h file for the new viscosity function is absolute genius and I'm not sure why I didn't think of it before, also not sure why I haven't found it documented elsewhere (I've been appending the thermo selection code like you had been trying to avoids)... Don't mind me, just expressing my shameless gratitude in saving me hours of time when I convert my 2.1.1 viscosity libraries over to 2.2.x |
Thanks for pointing my attention to that thread again, I must've missed some parts the first time I read it. ;) If I understand correctly, the coefficients are mixed into a new "average specie" and not the actual properties. In that case, I suppose the changes need to be made at an earlier stage than hePsiThermo, probably in multiComponentMixture...
Code:
template<class ThermoType> Best regards, David |
Quote:
If you figure it out I'd be very interested to hear how you do it, my 2.1.1 code calculates and mixes the viscosity in the solver, which is a non ideal solution if I ever want to compare viscosity models or change it up. I might take another look at the whole thing as well when I finish with the current paper I'm on but that might be awhile. |
Quote:
Secondly, I'm noticing a long list of "duplicate entry in runtime selection table" errors/warnings at runtime when I do this: Code:
Duplicate entry irreversibleLangmuirHinshelwoodReaction in runtime selection table Reaction Never mind the above, there's some other screwy things going on causing that I believe... Back on topic, I cannot get the code to compile by adding the appropriate selection combinations to the ktTransport.H file, did you include anything else in your ktTransport to get your method to work? It seems like I'm missing a vital step. The error I get is: Code:
lnInclude/hollisTransport.H:52:1: error: expected constructor, destructor, or type conversion before ‘(’ token |
1 Attachment(s)
Quote:
Maybe it's easiest if I just send you the files. Basically it's a full copy of sutherland with some alterations to ktTransport.H and ktTransportI.H and a bunch of includes to allow these typedefs. Let me know if it works for you! Best regards, David |
Ah I see, I thought it might have been some missing includes... what got me was that I didn't quite walk through where those functions are coming from...
I see one issue with this (forgive any miss wording C++ is a side thing for me), you're including files higher up in the chain, things that rely on specie to be there in the first place... this kind of cyclic referencing can lead to nastyness pretty easily (I think, feel free to correct me oh great C++ gurus). The compiler seems to be having a terrible time compiling my attempt to replicate your code, it would appear that the cyclic references are throwing it for a loop... Thanks for your help though, I think I'll just pawn editing the Basic/ReactionThermo/ChemistryModel files off on a summer student and avoid the cyclic-ness :p. As a side note, if you run into any issues with your mixture implementation let me know, I'll be glad to help as much as I can. |
Greetings to all!
I honestly have to say that I'm a bit lost on this thread. I'm not sure how I can give some help here, but perhaps the following threads/posts might assist you in getting a few more ideas:
Best regards, Bruno |
New transport model implementation in openFOAM v4.1
Hello openFOAMers, I know this is an old post, I downloaded the ktTransport model in link: https://www.cfd-online.com/Forums/op...tml#post445616
where I added the following entry in the options EXE_INC = \ block. Code:
-I$(LIB_SRC)/transportModels/compressible/lnInclude \ Thanks for your help in advance. Code:
wmakeLnInclude: linking include files to ./lnInclude |
All times are GMT -4. The time now is 21:11. |