CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Inconsistent declaration of hConstThermo vs janafThermo (http://www.cfd-online.com/Forums/openfoam-bugs/62390-inconsistent-declaration-hconstthermo-vs-janafthermo.html)

dominik_christ July 18, 2008 08:53

Hello everyone, I came acro
 
Hello everyone,

I came across this inconsistency when trying to run a new combination of thermophysicalProperties:

makeCombustionThermo
(
hCombustionThermo,
hMixtureThermo,
multiComponentMixture,
constTransport,
hConstThermo,
perfectGas
);

The problem is that multiComponentMixture::cellMixture() does not calculate the mixture value but only takes the value of the first species.

(I posted a detailed description here: http://www.cfd-online.com/cgi-bin/Op...4276#POST24276 )

The reason seem to be different declarations in hConstThermo.H and janafThermo.H. In janafThermo.H the operators += , -= and *= are defined, in hConstThermo they're not. The cell mixture is calculated in multiComponentMixture.C from:

mixture_ += Y_[n][celli]/speciesData_[n].W()*speciesData_[n];

Changing this to:

mixture_ = mixture_ + Y_[n][celli]/speciesData_[n].W()*speciesData_[n];

solves the error. You have to do the same in patchFaceMixture.

Though this solves the problem, it is actually only a workaround for multiComponentMixture. I think the right solution would be to implement += , -= and *= in hConstThermo as well.

All this now seems quite straightforward but it actually took me well over a month to figure out.
Thanks to Tommaso Lucchini for his help that guided me into the right direction!!

Regards,
Dominik

hjasak July 18, 2008 09:13

Tommaso, can you have a go at
 
Tommaso, can you have a go at this - should not be a problem...

Hrv

henry July 24, 2008 04:22

Dear Dominik, Thanks for th
 
Dear Dominik,

Thanks for the detailed bug report. I have now added the missing operators to hConstThermo and eConstThermo and these changes will be included in a patched-release of 1.5 as soon as we have sorted out all the other major issues being reported.

H

henry July 24, 2008 04:49

P.S. I don't believe the *= op
 
P.S. I don't believe the *= operator is needed as it simply calls the inherited operator from the equationOfState.

H

kallipygian October 27, 2008 03:42

Dear Henry, I am using the
 
Dear Henry,

I am using the similar declaration from hCombusionThermo (refer the first post from Dominik) for calculating mixture properties and didn't realize that there might a problem in reading the values. I am using OpenFOAM-1.4

Can you please enlist the missing operators in hConstThermo and eConstThermo?

Regards

henry October 27, 2008 04:10

These changes are in the files
 
These changes are in the files on our git repository, you could download that and pull out the files/changes you need.

H

kallipygian October 31, 2008 05:15

Dear Henry, Thanks for you
 
Dear Henry,

Thanks for your reply. I downloaded the files from the git repo. But, there are no documents which mentions the specific changes in the library. I had been working with 1.4.1 and am a bit reluctant to try 1.5 now. I wish somehow you can help me modify the library.

Regards


All times are GMT -4. The time now is 21:02.