spe 167579 ms fourier expansion

15
SPE 167579 Explicit Half Range Cosine Fourier Series Expansion For Z Factor Lateef A. Kareem; King Fahd University of Petroleum and Minerals Copyright 2013, Society of Petroleum Engineers This paper was prepared for presentation at the Nigeria Annual International Conference and Exhibition held in Lagos, Nigeria, 30 July–1 August 2013. This paper was selected for presentation by an SPE program committee following review of information contained in an abstract submitted by the author(s). Contents of the paper have not been reviewed by the Society of Petroleum Engineers and are subject to correction by the author(s). The material does not necessarily reflect any position of the Society of Petroleum Engineers, its officers, or members. Electronic reproduction, distribution, or storage of any part of this paper without the written consent of the Society of Petroleum Engineers is prohibited. Permission to reproduce in print is restricted to an abstract of not more than 300 words; illustrations may not be copied. The abstract must contain conspicuous acknowledgment of SPE copyright. Abstract: All natural gas processes, including production, sweetening, drying, transportation, storage, metering and selling requires that we possess ability to predict with great accuracy its volume, pressure, temperature, specific heat capacity etc. Unlike an ideal gas, a real gas does not expand and contract according the simple pressure-volume-temperature relation. This deviation from the ideal gas behavior is corrected with the use of z-factor. Z factor is simply the ratio of the volume of a real gas to that which equal mass of an ideal gas will occupy under the same condition. Several computational methods of obtaining this factor have been developed, but the implicit nature of these correlations called for an explicit method of evaluating the multivariate parameter. In this paper, over 6000 data points prepared by careful laboratory measurement of behavior of natural gas mixture is used to develop the model. The result was found to match the result to a very high accuracy without over fitting. Introduction: Compressibility factor (z-factor) of gasses is used to correct the volume of gas estimated from the ideal gas equation to the actual value. ݖ ௧௨ It is required in all calculations involving natural gasses. Several attempts have been made to determine the compressibility factor as a function of the reduced property of the gasses. Result of the experimental investigation into the z-factor-reduced pressure-reduced temperature relation is available in form of Standing and Kartz chat [Heidaryan et al. 2010; Sanjari and Lay 2012; Azizi et al. 2010; Londono et al. 2002; Dranchuk 1959; Abou-kassem n.d.; Al-khamis 1995; Trube 1957; Ohirhian 2002; Jeje and Mattar 2004; Corredor et al. 1992; Elsharkawy et al. 2000; Jr 1961; Jaeschke et al. 1991].

Upload: lateef-adewale-kareem

Post on 16-Nov-2015

52 views

Category:

Documents


7 download

DESCRIPTION

Z factor of natural gas

TRANSCRIPT

  • SPE 167579

    Explicit Half Range Cosine Fourier Series Expansion For Z Factor Lateef A. Kareem; King Fahd University of Petroleum and Minerals Copyright 2013, Society of Petroleum Engineers This paper was prepared for presentation at the Nigeria Annual International Conference and Exhibition held in Lagos, Nigeria, 30 July1 August 2013. This paper was selected for presentation by an SPE program committee following review of information contained in an abstract submitted by the author(s). Contents of the paper have not been reviewed by the Society of Petroleum Engineers and are subject to correction by the author(s). The material does not necessarily reflect any position of the Society of Petroleum Engineers, its officers, or members. Electronic reproduction, distribution, or storage of any part of this paper without the written consent of the Society of Petroleum Engineers is prohibited. Permission to reproduce in print is restricted to an abstract of not more than 300 words; illustrations may not be copied. The abstract must contain conspicuous acknowledgment of SPE copyright.

    Abstract: All natural gas processes, including production, sweetening, drying, transportation, storage, metering and selling requires that we possess ability to predict with great accuracy its volume, pressure, temperature, specific heat capacity etc. Unlike an ideal gas, a real gas does not expand and contract according the simple pressure-volume-temperature relation. This deviation from the ideal gas behavior is corrected with the use of z-factor. Z factor is simply the ratio of the volume of a real gas to that which equal mass of an ideal gas will occupy under the same condition. Several computational methods of obtaining this factor have been developed, but the implicit nature of these correlations called for an explicit method of evaluating the multivariate parameter. In this paper, over 6000 data points prepared by careful laboratory measurement of behavior of natural gas mixture is used to develop the model. The result was found to match the result to a very high accuracy without over fitting. Introduction: Compressibility factor (z-factor) of gasses is used to correct the volume of gas estimated from the ideal gas equation to the actual value.

    It is required in all calculations involving natural gasses. Several attempts have been made to determine the compressibility factor as a function of the reduced property of the gasses. Result of the experimental investigation into the z-factor-reduced pressure-reduced temperature relation is available in form of Standing and Kartz chat [Heidaryan et al. 2010; Sanjari and Lay 2012; Azizi et al. 2010; Londono et al. 2002; Dranchuk 1959; Abou-kassem n.d.; Al-khamis 1995; Trube 1957; Ohirhian 2002; Jeje and Mattar 2004; Corredor et al. 1992; Elsharkawy et al. 2000; Jr 1961; Jaeschke et al. 1991].

  • 2 SPE 167579

    Figure 1: Plot of experimental measure of the z factor

    For numerical computations, these values are fed into the computing system and values not available are obtained by interpolation between given values. The cost of interpolation creates the requirement for a correlation that accurately predicts the values on the chat. This has been attempted in two directions. First is the data fitting without the use of an equation of state, the second is the regression of experimental data about an equation of state. One of the most notable members of the first group is an explicit equation by Brills and Beggs (1974). To the second group belong the most accurate correlations of evaluating the z-factor till date. Examples of these correlations are Yarborough (HY), Dranchuk, Purvis and Robinson (DPR) and Dranchuk and Abou Kassem (DAK) correlations Brill and Beggs (BB) Compressibility Factor

    1

    Where 1.39 0.92 . 0.36 0.10 0.62 0.23 0.0660.86 0.037

    0.3210

    0.132 0.32 log 10 9 1 0.3106 0.49 0.1824

    0 5 10 150.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    Ppr

    z

    1.051.101.151.21.251.31.351.41.451.51.61.71.81.92.02.22.42.62.83.0

  • SPE 167579 3

    Hall and Yarborough (HY) Compressibility Factor

    1 , 0.06125 . 14.76 9.76 4.58 , 90.7 242.2 42.4 ,

    2.18 2.82 ,

    1 0

    Dranchuk and Abou Kassem (DAK) z factor

    0.27

    Where y is the root of the equation

    1 1 0 , 0.27

    ,

    0.3265, 1.0700, 0.5339, 0.01569, 0.05165,

    0.5475, 0.7361, 0.1844, 0.1056, 0.6134,0.7210

    Dranchuk, Purvis and Robinson (DPR) z factor

    0.27

    Where y is the root of the equation

    1 1 0 ,

    , , 0.27 0.31506237, 1.04670990, 0.57832720, 0.53530771,

    0.61232032, 0.10488813, 0.68157001,0.68446549

    Problems of associated with BB, HY, DAK and DPR: Brill and Beggs correlation is the most successful explicit correlation for z, but it leads to unacceptable errors at higher pressure and temperature close to the critical temperature. While implicit correlations are accurate at elevated temperature, they are also not very good around the critical temperature. In addition to this, picking an initial guess that falls within the basins of attraction of the desired root is another problem that also leads to unwanted result [Heidaryan et al. 2010; Sanjari and Lay 2012; Azizi et al. 2010]. The key to solving this problem is in Fourier expansion using the sines and cosines basis. Fourier expansion gets better as the number of terms increases thereby eliminating the problem of over fitting associated with explicit fits in powers of independent variables.

  • 4 SPE 167579

    Figure 2: Plot of Hall and Yarborough z factor chart with convergence problem

    Figure 3: A plot of Dranchuk Abou Kassem z factor chart with convergence problem

    0 5 10 150.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    Ppr

    Z

    1.05 1.11.15 1.21.25 1.31.35 1.41.45 1.5 1.6 1.7 1.8 1.9 2 2.2 2.4 2.6 2.8 3

    0 5 10 150.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    Ppr

    Z

    1.05 1.11.15 1.21.25 1.31.35 1.41.45 1.5 1.6 1.7 1.8 1.9 2 2.2 2.4 2.6 2.8 3

  • SPE 167579 5

    Figure 4: A plot of Dranchuk Purvis Robinson z factor chart with convergence problem Fourier Series: In mathematics, a Fourier series is a decomposition of periodic functions or periodic signals into the sum of a (possibly infinite) set of oscillating circular functions, namely sines and cosines.

    cos sin

    12 , 1 cos

    1 sin

    The use of Fourier can be extended to non-periodic functions and made to be exclusively sine or cosine if extended into an old or even function respectively. Expansion of z factor: The Fourier expansion model is developed for pseudo reduced pressure ranging from 0 to 15 and reduced temperature from 1.05 to 3. The half range cosine expansion was selected so as to eliminate the Gibbs phenomenon around the boundaries at 0 and 15.

    , cos Where is the half range length of the reduced pressure

    15 0 15 Since the is bivariate, and is being expressed as a Fourier series in , then all the weights of the cosine terms are functions of And is expressed as simple degree 6 polynomial function of reciprocal of

    ,

    0 5 10 150.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    Ppr

    Z

    1.05 1.11.15 1.21.25 1.31.35 1.41.45 1.5 1.6 1.7 1.8 1.9 2 2.2 2.4 2.6 2.8 3

  • 6 SPE 167579

    Then the z-factor could be written as

    , , cos But for the discrete data is forced to be equal or less than the number of pressure point for a give pseudo reduced temperature. There is no point taking m to 300 since it a maximum value of 61 produced a very accurate prediction of z. Thus taking,

    cos as the variable, we can perform least square regression to evaluate , for 0 60 and 0 6.

    , , cos Validation: The explicit correlation was validated by generating the z factor chat and performing statistical error analysis shown in the table below . Table 1: Stastical Analysis of the Correlation

    Maximum Absolute Error

    1,2,3, .

    Maximum Absolute Percentage Error

    100% 1,2,3, .

    Average Absolute Percentage Error

    100%

    Root Mean Square of Absolute percentage Error

    100%

    Correlation of Regression

  • SPE 167579 7

    The error in the estimation of z factor using the explicit correlation is also compared with error generated by the implicit correlations.

    Figure 5: A plot of z factor chart using the explicit Fourier correlation

    Figure 6: A Comparison of Explicit Fourier correlation and the measured z

    0 5 10 150.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    Ppr

    z

    1.051.101.151.21.251.31.351.41.451.51.61.71.81.92.02.22.42.62.83.0

    0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.80.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    z-exp

    z-es

    t

  • 8 SPE 167579

    Figure 7: A Comparison of Hall and Yabourough correlation and the measured z

    Figure 8: A Comparison of Dranchuk & Abou Kaseem correlation and the measured z

    0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.80.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    z-exp

    z-es

    t

    0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.80.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    z-exp

    z-es

    t

  • SPE 167579 9

    Figure 9: A Comparison of Dranchuk, Purvis & Robinson correlation and the measured z

    The error plot shown in figure 10 shows that the explicit Fourier z factor correlation generated are closer to zero than all other correlations hence the far higher correlation of regression coefficient. See table 2

    Figure 10: Error plot for Hall & Yaborough, Dranchuk & Abou Kassem, Dranchuk, Purvis & Robinson, and Fourier z factor correlations

    0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.80.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    z-exp

    z-es

    t

    0 1000 2000 3000 4000 5000 6000-0.05

    -0.04

    -0.03

    -0.02

    -0.01

    0

    0.01

    0.02

    0.03

    Hall and YaboroughDranchuk & Abou KaseemDranchuk, Purvis & RobinsonFourier z

  • 10 SPE 167579

    Recommendation The Fourier series of a function has been known to always converge to the mean of the value of the function at the point of discontinuity. And by extension, it means the integral of the Fourier series also converges to the integral of the function, however the same is not always true for the derivative of the Fourier series and the derivative of the function.

    12

    Hence, this correlation should not be used in the evaluation of the Isothermal compressibility of the gas. Isothermal compressibility is the change in volume per unit volume per unit change in pressure

    1

    Using the real gas equation

    , ,

    1 1 1 1 1 In terms of reduced properties

    1 1

    1 1

    ,,

    But because

    1 1 , ,

    Conclusion The Fourier series expansion of z factor is a very accurate mean of evaluating the z factor explicitly. The explicit z factor so developed has a better performance in terms of correlation of regression, root mean square of error and maximum absolute error as shown in the table below.

  • SPE 167579 11

    Table 2: Summary of comparison of the correlations

    Maximum Absolute Error

    Maximum Absolute Percentage Error

    Hall and Yarborough 0.0221722 5.22538578 Dranchuk & Abou Kaseem 0.0496129 13.6272523 Dranchuk, Purvis & Robinson 0.0494820 13.1811496

    Fourier z 0.0166618 2.944261

    Average Absolute Percentage Error

    Root mean square percentage error

    Hall and Yarborough 0.3129010 0.543093764 Dranchuk & Abou Kaseem 0.3589575 0.752813852 Dranchuk, Purvis & Robinson 0.4410269 0.812348227

    Fourier z 0.1409741 0.275287118

    Coefficient of regression

    Hall and Yarborough 0.9998811487 Dranchuk & Abou Kaseem 0.9998350091 Dranchuk, Purvis & Robinson 0.9997621456

    Fourier z 0.9999724440 Nomenclature

    Gas compressibility Pseudo reduced compressibility Number of data point Universal Gas constant Pressure Pseudo critical pressure Pseudo reduced pressure

    Temperature Pseudo critical temperature Pseudo reduced temperature Pseudo critical pressure Pseudo reduced pressure

    Initial guess for iteration process Pseudo reduced density Compressibility factor

  • 12 SPE 167579

    Reference

    ABOU-KASSEM, P.M.D.J.H., EQUATIONS OF STATE.

    AL-KHAMIS, M.N., 1995. Evaluation of Correlations for Natural Gas Compressibility Factors by.

    AZIZI, N., BEHBAHANI, R. AND ISAZADEH, M. A., 2010. An efficient correlation for calculating compressibility factor of natural gases. Journal of Natural Gas Chemistry, 19(6), pp.642645.

    CORREDOR, J.H., PIPER, L.D., TEXAS, A., MCCAIN, W.D. AND HOLDITCH, S.A., 1992. Compressibility Factors for Naturally Occurring Petroleum Gases.

    DRANCHUK, R.A.P.D.B.R.P.M., 1959. GENERALIZED COMPRESSIBILITY FACTOR TABLES. , (1).

    ELSHARKAWY, A., HASHEM, Y. AND ALIKHAN, A., 2000. Compressibility Factor for Gas Condensates. Proceedings of SPE Permian Basin Oil and Gas Recovery Conference.

    HEIDARYAN, E., MOGHADASI, J. AND RAHIMI, M., 2010. New correlations to predict natural gas viscosity and compressibility factor. Journal of Petroleum Science and Engineering, 73(1-2), pp.6772.

    JAESCHKE, M. ET AL., 1991. Accurate Prediction of Compressibility ~ actors by the GERG Virial Equation. , (August), pp.343350.

    JEJE, O. AND MATTAR, L., 2004. Comparison of Correlations for Viscosity of Sour Natural Gas. Proceedings of Canadian International Petroleum Conference, pp.19.

    JR, L.E.R., 1961. Simplified Graphical Method of Determining Gas Compressibility Factors.

    LONDONO, F.E., ARCHER, R.A., BLASINGAME, T.A. AND TEXAS, A., 2002. SPE 75721 Simplified Correlations for Hydrocarbon Gas Viscosity and Gas Density Validation and Correlation of Behavior Using a Large-Scale Database.

    OHIRHIAN, P.U., 2002. SPE 30332 Calculation of the Pseudo Reduction Compressibility of Natural Gases. , (4), pp.116.

    SANJARI, E. AND LAY, E.N., 2012. An accurate empirical correlation for predicting natural gas compressibility factors. Journal of Natural Gas Chemistry, 21(2), pp.184188.

    TRUBE, A., 1957. Compressibility of Natural Gases. Journal of Petroleum Technology, 9(1).

  • SPE 167579 13

    Appendix 1. The value of ,

    0 1 2 3 4 5 6

    0 1.544 -3.629 12.312 -19.352 10.642 2.667 -3.204 1 -1.264 12.865 -58.207 134.949 -171.040 110.811 -28.750 2 0.050 0.822 -7.984 25.384 -34.801 21.883 -5.294 3 0.479 -6.793 36.040 -95.710 135.666 -97.241 27.582 4 -0.082 0.689 -2.470 5.482 -7.824 7.087 -2.809 5 -0.354 2.998 -10.415 19.561 -22.036 14.754 -4.457 6 -0.491 5.531 -25.626 62.664 -85.018 60.625 -17.623 7 -0.604 6.988 -33.131 81.932 -111.266 78.530 -22.404 8 -0.315 3.895 -19.415 49.888 -69.432 49.593 -14.155 9 -0.174 2.029 -9.658 23.708 -31.418 21.175 -5.609

    10 -0.231 2.568 -11.390 25.656 -30.628 18.189 -4.107 11 -0.015 -0.065 1.418 -6.395 12.869 -12.233 4.468 12 0.121 -1.658 9.068 -25.374 38.482 -30.007 9.412 13 0.413 -4.918 23.767 -59.655 82.006 -58.526 16.947 14 0.598 -6.806 31.529 -76.099 100.928 -69.692 19.570 15 0.527 -6.080 28.431 -68.964 91.522 -63.011 17.590 16 0.644 -7.153 32.281 -75.731 97.404 -65.101 17.665 17 0.471 -5.161 22.911 -52.810 66.637 -43.618 11.567 18 0.204 -2.240 9.903 -22.543 27.829 -17.614 4.451 19 0.135 -1.410 5.850 -12.281 13.645 -7.483 1.532 20 -0.121 1.436 -6.938 17.503 -24.295 17.609 -5.210 21 -0.287 3.209 -14.658 35.003 -46.109 31.790 -8.964 22 -0.253 2.880 -13.370 32.406 -43.222 30.089 -8.543 23 -0.333 3.727 -17.001 40.426 -52.865 36.065 -10.032 24 -0.333 3.780 -17.419 41.683 -54.635 37.233 -10.318 25 -0.283 3.180 -14.521 34.460 -44.828 30.327 -8.342 26 -0.273 3.031 -13.633 31.836 -40.717 27.070 -7.315 27 -0.173 1.895 -8.419 19.415 -24.504 16.052 -4.265 28 -0.148 1.592 -6.962 15.800 -19.602 12.604 -3.281 29 -0.101 1.071 -4.573 10.069 -12.052 7.429 -1.838 30 0.086 -0.932 4.120 -9.538 12.228 -8.239 2.282 31 0.140 -1.590 7.328 -17.588 23.180 -15.912 4.450 32 0.172 -1.922 8.756 -20.816 27.243 -18.608 5.185 33 0.213 -2.356 10.599 -24.871 32.129 -21.676 5.970 34 0.272 -3.006 13.523 -31.680 40.773 -27.343 7.469 35 0.190 -2.114 9.599 -22.727 29.586 -20.072 5.546 36 0.167 -1.853 8.353 -19.597 25.263 -16.976 4.649 37 0.084 -0.960 4.451 -10.760 14.280 -9.856 2.764 38 0.120 -1.299 5.739 -13.201 16.690 -11.001 2.955 39 0.043 -0.476 2.148 -5.025 6.428 -4.264 1.146 40 0.051 -0.526 2.209 -4.801 5.702 -3.504 0.869

  • 14 SPE 167579

    41 -0.043 0.485 -2.237 5.345 -6.986 4.750 -1.317 42 -0.070 0.751 -3.305 7.617 -9.691 6.462 -1.766 43 -0.041 0.475 -2.244 5.523 -7.457 5.241 -1.500 44 -0.107 1.199 -5.465 12.946 -16.825 11.388 -3.140 45 -0.083 0.915 -4.112 9.656 -12.489 8.440 -2.329 46 -0.061 0.686 -3.148 7.532 -9.895 6.771 -1.887 47 -0.033 0.354 -1.588 3.756 -4.930 3.402 -0.962 48 0.007 -0.047 0.090 0.077 -0.464 0.551 -0.215 49 -0.005 0.074 -0.437 1.250 -1.870 1.409 -0.421 50 -0.025 0.265 -1.164 2.657 -3.316 2.144 -0.561 51 0.008 -0.106 0.559 -1.506 2.180 -1.616 0.481 52 0.044 -0.477 2.093 -4.794 6.054 -4.001 1.082 53 0.045 -0.494 2.207 -5.166 6.679 -4.518 1.249 54 0.069 -0.757 3.373 -7.849 10.061 -6.736 1.841 55 0.069 -0.783 3.595 -8.575 11.204 -7.609 2.101 56 0.045 -0.493 2.209 -5.179 6.702 -4.537 1.255 57 0.012 -0.147 0.742 -1.931 2.734 -2.000 0.591 58 0.065 -0.709 3.160 -7.351 9.409 -6.284 1.712 59 0.048 -0.533 2.401 -5.622 7.224 -4.830 1.315 60 -0.031 0.323 -1.362 2.958 -3.491 2.124 -0.521

  • SPE 167579 15

    Appendix 2. Matlab code for evaluating z factor given the specific gravity, temperature and pressure function z = fourierz (s,T,P) %% Compressibility Factor (z) % Author : Kareem Lateef Adewale % Date : 28 February 2013 %---------------------------------------- % s is the gas gravity, T is the temperature in Fahrenheit and P is %the pressure in psia %---------------------------------------- % Solving the problem Tc = 170.491+307.344*s; %pseudo critical temperature Pc = 709.604-58.718*s; %pseudo critical pressure Tr = (T+460)/Tc; %pseudo reduced temperature Pr = P/Pc; %pseudo reduced pressure t = Tr^-1; load ('H.mat'); C = H'; c = C(:); A = zeros(size(c)); for h = 1:61 for i = 1:7 m = i + (h-1)*7; A(m) = (t^(i-1))*cos((h-1)*pi*Pr/15); end end z = sum(c.*A);