View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000571OpenFOAM[All Projects] Bugpublic2012-07-02 14:382012-07-18 08:51
Reporterdohnie 
Assigned Tohenry 
PriorityhighSeveritymajorReproducibilityalways
StatusresolvedResolutionsuspended 
PlatformLinuxOSOpenSuseOS Version11.3
Product Version2.1.1 
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

-  Notes
(0001445)
henry (manager)
2012-07-02 16: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 07: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 07: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 08: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 08: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.

- Issue History
Date Modified Username Field Change
2012-07-02 14:38 dohnie New Issue
2012-07-02 16:34 henry Note Added: 0001445
2012-07-03 07:17 dohnie Note Added: 0001446
2012-07-03 07:25 henry Note Added: 0001447
2012-07-03 08:17 dohnie Note Added: 0001448
2012-07-03 08:40 henry Note Added: 0001449
2012-07-18 08:51 andy Status new => resolved
2012-07-18 08:51 andy Resolution open => suspended
2012-07-18 08:51 andy Assigned To => henry