[PATCH] Re: New Bug Reports/Feature Requests

Robert Helling helling at atdotde.de
Thu Feb 25 14:30:00 PST 2016


Hi,

> On 24.02.2016, at 21:26, Linus Torvalds <torvalds at linux-foundation.org> wrote:
> 
> On Wed, Feb 24, 2016 at 12:15 PM, Robert Helling <helling at atdotde.de <mailto:helling at atdotde.de>> wrote:
>> 
>> and in fact, Robert is looking into this issue. He decided to get the
>> physics (somewhat) right by using a van der Waals (or related) equation
>> rather than a random fit function but still has to do a bit of math before a
>> patch is coming.
> 
> Heh. That may be overkill.

After spending some hours with this and mathematica, I realized that this is in fact a waste of time since it gets the difference of the factor from 1 significantly wrong in the parameter range we are interested in. But the Redlich-Kwong-equation (of whose existence I learned from wikipedia) does a much better job numerically. So here is a patch that implements it. This equation is a cubic equation for Z, so I decided to solve it iteratively (three iterations seem to be good enough).



From what I learned, this is all black magic when it comes too mixtures of gases (like air or trimix) but the standard approach is to go via critical values and for those compute weighted averages. There is a whole industry for these real gas calculations as those are quite important for the oil/gas industry.

Best
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160225/9bbf94a0/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Compute-the-air-compressibility-factor.txt
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160225/9bbf94a0/attachment.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160225/9bbf94a0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160225/9bbf94a0/attachment.sig>


More information about the subsurface mailing list