View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000571||OpenFOAM||Bug||public||2012-07-02 15:38||2016-02-03 20:56|
|Summary||0000571: Formulation of internal energy in specieThermoI.H is wrong|
|Description||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).
|Tags||No tags attached.|
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.
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.
||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.|
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.
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.
|2012-07-02 17:34||henry||Note Added: 0001445|
||Note Added: 0001446|
|2012-07-03 08:25||henry||Note Added: 0001447|
||Note Added: 0001448|
|2012-07-03 09:40||henry||Note Added: 0001449|
||Status||new => resolved|
||Resolution||open => suspended|
||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|