|
[Sponsors] | |||||
hConstThermo: calculating Cp in addition operator |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 | |
|
New Member
Join Date: Oct 2012
Posts: 2
Rep Power: 0 ![]() |
Hello all,
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: Code:
int main(int argc, char *argv[])
{
typedef constTransport<specieThermo<hConstThermo<perfectGas> > > ThermoType;
IFstream f("thermo.dict");
dictionary dict(f);
ThermoType t1(dict.subDict("specie1"));
ThermoType t2(dict.subDict("specie2"));
Info << "W= " << t1.W() << " " << t2.W() << " " << (t1+t2).W() << endl;
Info << "Cp= " << t1.cp(1) << " " << t2.cp(1) << " " << (t1+t2).cp(1) << endl;
return(0);
}
Code:
specie1{
specie {
nMoles 1;
molWeight 1;
}
thermodynamics {
Cp 1;
Hf 0;
}
transport {
mu 1;
Pr 1;
}
}
specie2{
specie {
nMoles 1;
molWeight 0.5;
}
thermodynamics {
Cp 2;
Hf 0;
}
transport {
mu 1;
Pr 1;
}
}
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): Code:
ct1.nMoles()/eofs.nMoles()*ct1.Cp_
+ ct2.nMoles()/eofs.nMoles()*ct2.Cp_
So, the correct code should be something like Code:
(ct1.nMoles()/eofs.nMoles()*ct1.Cp_*ct1.W()
+ ct2.nMoles()/eofs.nMoles()*ct2.Cp_*ct2.W())
/eofs.W()
Note also that a similar code exists in janafThermo: Code:
highCpCoeffs[coefLabel] =
molr1*jt1.highCpCoeffs_[coefLabel]
+ molr2*jt2.highCpCoeffs_[coefLabel];
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: Quote:
|
||
|
|
|
||
|
|
|
#2 |
|
New Member
Join Date: Oct 2012
Posts: 2
Rep Power: 0 ![]() |
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
|
|
|
|
|
|
![]() |
| Tags |
| chemistry, hconstthermo, heat capacitance, mixture |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Installation of OpenFOAM15dev | antonio_ing | OpenFOAM Installation | 34 | December 18, 2009 11:06 |
| Operator declaration in Thermophysical library | lena | OpenFOAM Running, Solving & CFD | 0 | March 12, 2009 10:47 |
| Problems in calculating the fluid traction on the current structure frame in 3D models | fw407 | OpenFOAM Running, Solving & CFD | 0 | August 6, 2008 13:04 |
| UDF for heat addition and mass addition | Srikanth | FLUENT | 2 | September 20, 2006 20:12 |
| How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 18:27 |