<

Results 1 to 4 of 4

Thread: Hall-Yarborough Gas Compressibility Factor Calculator - 1 step - Visual Basic Enabled

  1. #1

    Hall-Yarborough Gas Compressibility Factor Calculator - 1 step - Visual Basic Enabled

    Check out this video. I have programmed a function in excel to do computation for calculating Z-Factor using the Hall-Yarborough method. This method requires minimal input from the user. The user needs to only type in the Tpr and Ppr.



    *************************************CODE********* **************************************
    Function Z_Factor(Tr* Pr)

    ''Programmed and developed by: Muhammad Hashim
    ''University of Regina
    ''Hall Yarborough Z-factor
    ''
    Application.ScreenUpdating = False
    Dim func As Double

    T = 1 / Tr

    Y = 0.001

    For i = 1 To 20000

    func = (-0.06125 * Pr) * T * Exp(-1.2 * (1 - T) ^ 2) + ((Y + Y ^ 2 + Y ^ 3 - Y ^ 4) / (1 - Y) ^ 3) - (14.76 * T - 9.76 * T ^ 2 + 4.58 * T ^ 3) * Y ^ 2 + (90.7 * T - 242.2 * T ^ 2 + 42.4 * T ^ 3) * Y ^ (2.18 + 2.82 * T)

    If (func > 0.001 Or func < -0.001) Then
    Y = Y + 0.001

    Else

    Z_Factor = (0.06125 * Pr * T * Exp(-1.2 * (1 - T) ^ 2)) / Y
    End If
    Next i

    End Function

    *****************************************END CODE*****************************************
    Last edited by ha5him; 12-13-2016 at 01:05 PM. Reason: Added Code

  2. # ADS
    Spons Circuit
    Join Date
    Always
    Posts
    Many
     
  3. #2

    Re: Hall-Yarborough Gas Compressibility Factor Calculator - 1 step - Visual Basic Ena

    can you exchange you vb software? thanks

  4.    Sponsored Links



    -

  5. #3

    Re: Hall-Yarborough Gas Compressibility Factor Calculator - 1 step - Visual Basic Ena

    I have included it in the main thread!

  6. #4

    Re: Hall-Yarborough Gas Compressibility Factor Calculator - 1 step - Visual Basic Ena

    Quote Originally Posted by josefreitas View Post
    can you exchange you vb software? Thanks
    many thanks

Similar Threads

  1. Replies: 9
    Last Post: 02-02-2019, 05:05 PM
  2. effect of the compressibility factor in the NFR
    By maradona in forum Free Zone
    Replies: 0
    Last Post: 01-20-2015, 10:54 PM
  3. Calculating compressibility factor (z-factor)
    By petro_student in forum Oil And Gas Production
    Replies: 0
    Last Post: 10-04-2009, 09:02 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40