Entropy calculation in OpenFoam
I have found a figure of entropy in this article that has made by OpenFOAM:
I'm wondering if does OF calculates entropy?which solvers does have it?I couldn't find a useful thread about this subject in the forum. that can improve my work and the conclusions. can anyone guide me through? |
hi all again
does anyone know an example for adding entropy equation to any of the compressible (or even other) solvers? It this work possible with a rational effort?or is too complicated? Has anyone think about this subject (seeing entropy values) so far? I thank any of thoughts |
no any opinion about entropy in OpenFOAM?
does have a solver calculate entropy? any hint? |
no one is interested?
|
how i can't find anything useful in the forum search related to this subject?
Means no one has ever thought about?!! |
Hi Ehsan,
According to the paper you've indicated, it seems that the solver "rhoCentralFoam" was used to calculate entropy. I've searched OpenFOAM's source code with the following command: Code:
find $FOAM_SRC -name "*.[CH]" | xargs grep -isl 'Entropy' The same could be done with the text editor "Kate", which can find text inside files on a particular folder. The files that were found were: Code:
./thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H As for not find much information on this topic: it's OpenFOAM. It's only natural that there are several undocumented or poorly documented details about OpenFOAM's features. But the great thing about OpenFOAM is that the source code is completely open for anyone to look at it and study it :D Best regards, Bruno |
thanks so much.
then entropy is calculated but not is shown.could simply change this behavior?(I have tested simple things like MUST_WRITE without success) will specificHeat.C work by changing only Cp to s or how? -------------------------- hi again I made little changes like this: Code:
int main(int argc, char *argv[]) Code:
SOURCE=entropy.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam220/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam220/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/entropy.o |
Quote:
I wrote "S", not "s"! ;) Quote:
|
in the solver its s.I changed s to S but erroe is same:
Code:
Making dependency list for source file entropy.C |
Hi Ehsan,
I didn't test it myself before... and I was assuming that if there was a "Cp", there should be an "S" as well... but apparently it doesn't exist yet! Looks like the OpenFOAM authors never needed a complete entropy field. And this isn't very simple to solve either. Here's the situation:
Worst thing is that this requires changing the core source code in OpenFOAM, which I don't know if you want to do this, since this would add even more complexity to your thesis, just because you need to calculate the entropy. I'm going to look a bit more into this, because I think I overlooked something... but I don't know when I might find a better answer for this. Best regards, Bruno |
1 Attachment(s)
Hi Ehsan,
I think you can consider yourself very lucky today! I've managed to figure out a solution without having to hack directly into OpenFOAM's source code! It took some C++ voodoo (mostly tricks with templates and macros), but it works! The only downside is that you have to modify the source code every time you change "thermoType" in "constant/thermophysicalProperties". This is exemplified in the comment section in "entropy.C" that starts with: Code:
/* Code:
//Define here the components of the thermodynamic class Code:
wmake ______________________ Now, explain what I had to do:
There's going to be some more people interested in this, because this gives access to the methods for the currently loaded thermodynamic sub-models! Best regards, Bruno |
then s is only there and they never have used it?
so there is a lot of work to do with it.could find the equation that entropy calculated from that? if it can be done is very nice.but if is so complicated never mind!:D ---------------------- your post received after mine! really it works?I don't believe it!:D its second chance i get today.except for this I figured out an issue i was engaged with for months!what a nice day!:D surprising.I'll test it soon. i think this thread of mine was a brilliant one and so valuable like those effective questions you had told me about before!:D;) the second one is http://www.cfd-online.com/Forums/ope...cp-values.html and third prize with a small distance belongs to: http://www.cfd-online.com/Forums/ope...uring-run.html :D but no prize I have awarded yet!:D:rolleyes: I'm happy that it can help others. thank you very much.:) (what a post with a lot of big grin icon):D |
Quote:
Quote:
|
I edited the before post.;)
I think 1 is more near to my intention. what does 2 mean?:D |
Quote:
Quote:
The molar entropy is calculated depending on the equation of state. For example, in "janaf" it's calculated in this method: Quote:
As for the other question: Quote:
Answer: looks like it's mostly for calculating "Gibbs free energy - g()" and "Helmholtz free energy - a()": https://github.com/OpenFOAM/OpenFOAM...thermoI.H#L172 All of this was found thanks to the Doxygen generated documentation: http://www.openfoam.org/docs/cpp/ |
hi
it displayes this error when compiling: Code:
ehsan@Ehsan-com:~/Desktop/entropyHePsi$ wmake |
OpenFOAM 2.2.0 has some broken stuff that has been already been fixed in 2.2.x....
Anyway, the quick fix is as follows:
|
thank you.it works except one of the cases:D.the error in this case is this:
Code:
ehsan@Ehsan-com:~/Desktop/WR_pimple_p$ entropy S dimensions is in SI,correct? is there any real gas model in OF rather than perfectGas? |
The problem is that the T field is not properly defined for the time instance "0". It's assuming values of 0 K (zero Kelvin!) for the "left" and "right" patches, which therefore leads to some massive problems!
Try: Code:
entropy -time '1e-30:' |
Hi Bruno
I changed the dictionary for one of my cases as this: Code:
#define myLengthyThermoClass makeTheLenghtyTypedefName( \ Code:
Create time |
All times are GMT -4. The time now is 08:02. |