hConstThermo: calculating Cp in addition operator
It seems to me that operator+ in hConstThermo calculates the Cp in a wrong way (and this applies also to Hf and to other arithmetical operators).
Consider the following code:
W= 1 0.5 0.75
Cp= 1 1 1.125
However, the I expect the following output:
W= 1 0.5 0.75
Cp= 1 1 1
Indeed, here two species are defined having different molar masses (1 and 0.5 kg/kmol) and different heat capacitance per kg (1 and 2), but note that they have the same heat capacitance per mole --- 1 J/(kmol K).
The program reads both specie data, adds them, and outputs the resulting heat capacitance. As expected, cp() for both species separately is 1 (cp() returns J/(kmol K)). The heat capacitance per kilomole of mixture of these two species should therefore be 1 too, independently of the mixture composition, therefore the program should output 1, not 1.125.
As I understand it, the problems comes from the hConstThermo addition operator that calculates the thermal capacity by the following code (hConstThermoI.H, lines 209-210):
So, the correct code should be something like
Note also that a similar code exists in janafThermo:
Is my understanding correct and the behavior is really wrong, or is there any detail that I did not catch?
(In fact, I was trying to simulate chemistry with hConstThermo instead of janafThermo, but found that thermodynamical properties of the mixture are calculated wrongly.)
P.S. I have tried to submit this as a bug report at www.openfoam.org/bugs/ . I have registered there, filled the "Enter Report Details" form, clicked "Submit report", and got the following error:
Don't know what was wrong, but now from another computer I was able to post a report inth the bugtracker: http://www.openfoam.org/mantisbt/view.php?id=669
|All times are GMT -4. The time now is 12:18.|