|Anonymous | Login | Signup for a new account||2015-01-27 08:20 UTC|
|My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000571||OpenFOAM||[All Projects] Bug||public||2012-07-02 14:38||2012-07-18 08:51|
|Target Version||Fixed in Version|
|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 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|