2016-12-09 13:35 GMT

View Issue Details
IDProjectCategoryView StatusLast Update
0000571OpenFOAM[All Projects] Bugpublic2016-02-03 20:56
Reporterdohnie
Assigned Tohenry
PriorityhighSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed
PlatformLinuxOSOpenSuseOS Version11.3
Product Version
Target VersionFixed in Version
Summary0000571: Formulation of internal energy in specieThermoI.H is wrong
DescriptionThe current formulation (specieThermoI.H, line 112) is:
return this->h(T) - this->RR*(T - this->Tstd);

It should be corrected to
return this->h(T) - this->RR*T;

The same error is in the formulation of the sensible internal energy (line 119).
TagsNo tags attached.
Attached Files

 Relationships
 Relationships

 Notes ~0001445 henry (manager) 2012-07-02 17:34 Energy referencing is not right or wrong it is a choice. Given that currently enthalpy is the defining energy the this->RR*this->Tstd is included to ensure that internal enregy is 0 at Tstd which is useful provided the absolute relationship between internal energy and enthalpy is not needed. However, there is a bigger problem in the current formulation with is that the perfect gas equation of state is assumed in the evaluation of the pressure component of enthalpy even if the perfect gas equation of state is not appropriate. We are reworking and generalising the thermodynamics at the moment and this is one of the built-in assumptions which will be addressed and the definition of enthalpy and internal energy separated so that the above expression will no longer be used. ~0001446 dohnie (reporter) 2012-07-03 08:17 Henry, I disagree on that. Of course, you can set e=0 at whatever temperature you like. But it has to be consistent with enthalpy. The computation of internal energy is based on the difference between enthalpy and internal energy, e=h-pv (and for ideal gases e=h-RT). In the present formulation, you get e=h at T=Tstd which is wrong. ~0001447 henry (manager) 2012-07-03 08:25 e needs to be consistent with h if we convert between the two which we currently do not but at the moment we require e to be 0 at Tstd. However, all of this code is being rewritten and the relationship between e and h will be set by functions provided by the equation of state and the requirement that e is 0 at Tstd will be removed by other improvements in generality. ~0001448 dohnie (reporter) 2012-07-03 09:17 OK, I just stumbled upon this because I wrote my own solver where I need both e and h. Still, let me point out that in general you enforce e=h, not e=0, at T=Tstd. e=0 results if you define h=cp*T for example, but not if you use the JANAF polynomials. But if your code works with this, it is OK for me. ~0001449 henry (manager) 2012-07-03 09:40 At the moment e and h are indeed inconsistent but this inconsistency is being used and is OK provided conversion between e and h is not needed. This issue and others will be resolved in the rewrite of the thermodynamics we are undertaking and hope to include in the next release.
 Notes

 Date Modified Username Field Change Issue History 2012-07-02 15:38 dohnie New Issue 2012-07-02 17:34 henry Note Added: 0001445 2012-07-03 08:17 dohnie Note Added: 0001446 2012-07-03 08:25 henry Note Added: 0001447 2012-07-03 09:17 dohnie Note Added: 0001448 2012-07-03 09:40 henry Note Added: 0001449 2012-07-18 09:51 user2 Status new => resolved 2012-07-18 09:51 user2 Resolution open => suspended 2012-07-18 09:51 user2 Assigned To => henry 2016-02-03 09:22 henry Status resolved => closed 2016-02-03 09:22 henry Fixed in Version => 2.3.x 2016-02-03 09:22 henry Status closed => resolved 2016-02-03 09:22 henry Resolution suspended => fixed
 Issue History