#### View Issue Details

ID Project Category View Status Date Submitted Last Update 0000571 OpenFOAM [All Projects] Bug public 2012-07-02 15:38 2016-02-03 20:56 user463 henry high major always resolved fixed Linux OpenSuse 11.3 0000571: Formulation of internal energy in specieThermoI.H is wrong The 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). No tags attached.

#### Activities

 2012-07-02 17:34 manager   ~0001445 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. user463 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. 2012-07-03 08:25 manager   ~0001447 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. user463 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. 2012-07-03 09:40 manager   ~0001449 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.