- #1

- 9

- 0

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

In summary, Amirul is trying to calculate the volumetric flow rate of natural gas in the NPS 8 pipeline. He is unsure of how to do this and seeks help from others.

- #1

- 9

- 0

Engineering news on Phys.org

- #2

Science Advisor

Homework Helper

- 15,814

- 4,715

I'm not an oil and gas expert (had to look up NPS) but as a physicist and chemical process modeller, I know that one needs input and relationships to do a calculation. You do not mention what is given, nor what you want to calculate. ('you', because we probably are unravelling a piece of spreadheet -- the zenith of unstructured programming).

This is an incomplete situation description. "The gas (not the gas source, that hopefully does not move) is coming " should be clarified: If you have pressure, temperature and physical properties you can link the mass flow to volume flow with ##pV = ZnRT## which you might recognize as the gas law. (with Z = 1 you get the ideal gas law, which you may or may not want to use for your 'situation').Amirul96 said:Ok the situation is the natural gas source is coming from NPS 18 and flow through NPS 8 and i need to calculate the mass and volumetric flow rate of the natural gas in the NPS 8 pipeline

In zero'th order mass flow and volume flow don't change: in steady state there is no pile-up and there is a velocity increase. But zero'th order is often not good enough: there is a change in pressure at a contraction.

Things complicate when pressure drop along the pipe line needs to be taken into consideration.

All depends on how detailed and sophisticated the Excel () author has built his/her model. Any documentation/comments ? Thought so

- #3

- 9

- 0

Hi, sorry my question is not clear.

The main parameter to calculate is the volumetric of the natural gas in NPS 8 pipeline as i need to know what is the maximum amount of natural gas can flow in the NPS 8 pipeline. The velocity of the gas is 10m/s and given data were pressure, temperature, composition of natural gas and the molecular weight.

As in the attachment, there is other parameter such as friction factor which i have discover how to calculate it. In addition, there is also Z values and pressure drop .

I try to derive some formula by combining**ṁ** = *ρ* x A x velocity x Mw / RTZ with PV= nRTZ

ṁ = P x A x velocity x Mw / RTZ.

Q = ṁ / p

Is it correct or i need to take other things to be considered such as pressure drop?

The main parameter to calculate is the volumetric of the natural gas in NPS 8 pipeline as i need to know what is the maximum amount of natural gas can flow in the NPS 8 pipeline. The velocity of the gas is 10m/s and given data were pressure, temperature, composition of natural gas and the molecular weight.

As in the attachment, there is other parameter such as friction factor which i have discover how to calculate it. In addition, there is also Z values and pressure drop .

I try to derive some formula by combining

ṁ = P x A x velocity x Mw / RTZ.

Q = ṁ / p

Is it correct or i need to take other things to be considered such as pressure drop?

Last edited:

- #4

- 23,164

- 5,635

- #5

Science Advisor

Homework Helper

- 15,814

- 4,715

To begin with input sheet line 1:

STP

So you want to check which is which for your case.Standard temperature and pressure (STP) is usually defined as being at 0°C (273.15 K) and 1013.25 hPa (1 atm). However, standard temperature may also be specified as 20 °C or 25 °C. Sometimes these reference conditions may also be referred to as normal temperature and pressure (NTP). Special industrial branches may even have their own definitions, e.g. the gas industry may reference flow volume to a temperature of 70 °F.

MMSCFD and kSm

(This factor should be in one of the two cells, probably in the kSm

(Provided the standard states are the same -- they are in your example)

Standard cubic feet are already defined poorly

A converter comes close: when I use this one , 17.72 in 5 decimals yields 500.63 kSm^{3}/d

so 0.2% off for some reason -- different but close standard ?

Next : MW, molweight is 16.88 so mainly CH

No idea what the dG stands for (@Chestermiller ?)You'll have to find out how the viscosity, Z and C

In case of VBA (which I would expect): press alt-F11 and search for the function name. Welcome to the powerful world of VBA.

With 61 bar and 55 ##^\circ##C you are past the critical T and p of methane

Then come the pipe parameters: I can't find a wall thickness of (219.08 - 197.3)/2 = 10.89 mm here, but I suppose the 197.3 mm is what you need and can trust. (I would expect 1/2 inch wall thickness, actually).

And roughness, an optimistic 0.05 mm.

-------------------------------------------------

We continue with output sheet line 1:

STP density is a lookup or again VBA

(here it says for methane

Density, gas at STP; 32°F/0°C 1 atm | 44.7 | mol/m3 | 0.7168 | kg/m3 |

T&P density may come from the gas law with a formula using Z, or again through VBA.

Mass flow is straightforward:

STP volume flow 501.77 kSm

(why he gets 4.14 I don't know. 0.713 kg/m3 ?)

Then Q in m3/s from: mass flow / T&P density= 4.14/39.67 = 0.104 m3/s

And I would get a velocity of 0.104 / (¼π 0.1973

We skipped over the friction factor that follows from this calculation: Churchill , Darcy

The resulting pressure drop of 1.92 kPa (0.02 Bar) per 100 m isn't all that much compared to the 61 Bar (I suppose the contraction from 18" to 8" isn't at hundreds of km from the delivery points ?)

----I did a lot of googling for you which you should be able to do yourself...

(I like reverse engineering, it apppears -- but to do a good job the .xls file is needed for that)

And I certainly second Chet's advice -- the 0.95 Z doesn't dgrade a preliminary answer all that much.

- #6

- 23,164

- 5,635

I'm a little confused over what is given and what you are trying to find. You know the inlet and outlet pressures and you need to find the mass flow rate? or, You know the mass flow rate and one of the pressures, and need to find the other pressure? And, how long is the pipe? And why can't you assume that the flow is isothermal.

If the pressure change over the length of pipe is significant compared to the average pressure, I would use a different approach. The pressure gradient in the pipe is given by $$\frac{dp}{dx}=-\rho \frac{v^2}{2}\frac{f}{D}\tag{1}$$, where f is the Darcy friction factor. Since the mass flow rate is constant, I would solve the problem in terms of that. The mass flow rate is given by $$m=\rho v\left(\pi\frac{D^2}{4}\right)$$ So, in terms of the mass flow rate, the velocity is given by $$v=\frac{4m}{\rho \pi D^2}\tag{2}$$and the Reynolds number is given by $$Re=\frac{\rho v D}{\mu}=\frac{4m}{\pi D \mu}$$where ##\mu## is the viscosity. If we combine Eqns. 1 and 2, we obtain: $$\frac{dp}{dx}=-\frac{8m^2}{\rho \pi^2 D^5}f\tag{3}$$Next, neglecting deviations from the ideal gas law, we have: $$\rho=\frac{pM}{RT}$$where p is the absolute pressure. Substituting this into Eqn. 1 and integrating then yields $$p_1^2-p_2^2=\frac{16 m^2(RT)L}{M\pi^2 D^5}f=\frac{G^2RT}{M}\frac{L}{D}f\tag{4}$$where G is the mass flux. This equation can be used to prepare a plot of either p1 or p2 as a function of the mass flow rate.

If the pressure change over the length of pipe is significant compared to the average pressure, I would use a different approach. The pressure gradient in the pipe is given by $$\frac{dp}{dx}=-\rho \frac{v^2}{2}\frac{f}{D}\tag{1}$$, where f is the Darcy friction factor. Since the mass flow rate is constant, I would solve the problem in terms of that. The mass flow rate is given by $$m=\rho v\left(\pi\frac{D^2}{4}\right)$$ So, in terms of the mass flow rate, the velocity is given by $$v=\frac{4m}{\rho \pi D^2}\tag{2}$$and the Reynolds number is given by $$Re=\frac{\rho v D}{\mu}=\frac{4m}{\pi D \mu}$$where ##\mu## is the viscosity. If we combine Eqns. 1 and 2, we obtain: $$\frac{dp}{dx}=-\frac{8m^2}{\rho \pi^2 D^5}f\tag{3}$$Next, neglecting deviations from the ideal gas law, we have: $$\rho=\frac{pM}{RT}$$where p is the absolute pressure. Substituting this into Eqn. 1 and integrating then yields $$p_1^2-p_2^2=\frac{16 m^2(RT)L}{M\pi^2 D^5}f=\frac{G^2RT}{M}\frac{L}{D}f\tag{4}$$where G is the mass flux. This equation can be used to prepare a plot of either p1 or p2 as a function of the mass flow rate.

Last edited:

- #7

- 9

- 0

BvU said:We continue with output sheet line 1:

STP density is a lookup or again VBA

(here it says for methane

)

Density, gas at STP; 32°F/0°C 1 atm 44.7 mol/m3 0.7168 kg/m3

T&P density may come from the gas law with a formula using Z, or again through VBA.

Mass flow is straightforward:

STP volume flow 501.77 kSm^{3}/d * 1000 /(24 h/d)/(3600 s/h) * 0.71 kg/m3 = 4.12 kg/s

(why he gets 4.14 I don't know. 0.713 kg/m3 ?)

Then Q in m3/s from: mass flow / T&P density= 4.14/39.67 = 0.104 m3/s

And I would get a velocity of 0.104 / (¼π 0.1973^{2}) = 3.41 m/s, but he gets 3.54 !?

I think this author using 4 decimal places during his calculation but in the data sheet he only stated 2 decimal places caused you didnt get the same answer as him

I think there is misunderstanding here. The main parameter that i want to calculate is volumetric flow rate at STP. I don't know why the author place volumetric flow rate at the input column, maybe as data input to the pipeline. Anyway i have done the calculation

For mass flow rate

A = π r

ṁ =

= 39.67 kg/m

= 4.14 kg/s

However I am fail to calculate density at T&P. The value of the density 39.67 kg/m

By combining

P = 60 bar = 59.5124 atm, R= 8.2057x10

= (59.5124 atm x 16.88 g/mol) / (8.2057x10

= 39.03 kg/m

where he get

I think the formula is right where it has involved ideal gas law. Therefore, what is the reason i don't get the same answer as author? Is it because the formula is wrong or the decimal places the author used?

For volumetric flowrate

Q at T&P = ṁ/

= 4.14 kg/s / 39.67 kg/m

= 0.10 m

Q at STP= ṁ/

= 4.14 kg/s / 0.71 kg/m

= 5.8309 m

= 503.80 m

If i use

Q at STP= ṁ/

= 4.14 kg/s / 0.713 kg/m

= 5.8065 m

= 501.67 km

where the Q at STP he get is 501. 77 ksm

BvU said:

Im not sure the significant the calculation of friction factor. As the calculation of density, mass and volumetric flowrate and velocity didnt use the friction factor. Is the friction factor is significant in the calculation of pressure drop and how to calculate the pressure drop?

Last edited:

- #8

- 23,164

- 5,635

Yes, the friction factor is significant in the calculation of pressure drop. My post #6 in this thread shows how to calculate the pressure drop. You should be using the friction factor determined from the Moody diagram, not from some equation in the spreadsheet: https://en.wikipedia.org/wiki/Moody_chartAmirul96 said:I think this author using 4 decimal places during his calculation but in the data sheet he only stated 2 decimal places caused you didnt get the same answer as him

I think there is misunderstanding here. The main parameter that i want to calculate is volumetric flow rate at STP. I don't know why the author place volumetric flow rate at the input column, maybe as data input to the pipeline. Anyway i have done the calculation

For mass flow rate

A = π r^{2}

ρ at T&P = 39.67 kg/m^{3}

ṁ =ρAv

= 39.67 kg/m^{3}x π (0.09685^{2}x 3.54 m/s

= 4.14 kg/s

However I am fail to calculate density at T&P. The value of the density 39.67 kg/m^{3}is from the spreasheet.

By combiningρ=m/v with v = nRTZ/P where n=m/Mw i getρ= P x Mw / RTZ

P = 60 bar = 59.5124 atm, R= 8.2057x10^{-5}

ρ= P x Mw / RTZ

= (59.5124 atm x 16.88 g/mol) / (8.2057x10^{-}5 m^{3}atm/mol.K x 328.15K x 0.951)

= 39.03 kg/m^{3}

where he getρ= 39.67 kg/m^{3}

I think the formula is right where it has involved ideal gas law. Therefore, what is the reason i don't get the same answer as author? Is it because the formula is wrong or the decimal places the author used?

For volumetric flowrate

Q at T&P = ṁ/ρat T&P

= 4.14 kg/s / 39.67 kg/m^{3}

= 0.10 m^{3}/s

Q at STP= ṁ/ρat STP

= 4.14 kg/s / 0.71 kg/m^{3}

= 5.8309 m^{3}/s

= 503.80 m^{3}/d

If i useρ= 0.713

Q at STP= ṁ/ρat STP

= 4.14 kg/s / 0.713 kg/m^{3}

= 5.8065 m^{3}/s

= 501.67 km^{3}/d

where the Q at STP he get is 501. 77 ksm^{3}/d

Im not sure the significant the calculation of friction factor. As the calculation of density, mass and volumetric flowrate and velocity didnt use the friction factor. Is the friction factor is significant in the calculation of pressure drop and how to calculate the pressure drop?

For the roughness factor and Reynolds number in your situation, the Moody chart gives a Darcy friction factor of 0.026, not 0.015.

- #9

- 23,164

- 5,635

- #10

- 9

- 0

I have settled all the calculation in the spreadsheet except for compressibilty factor and specific heat ratio.

I want to ask about VBA. Is the VBA contain module that can calculate compressibility factor and specific heat ratio or i have to google the VBA code from google? I have do some google and copy the VBA spreadsheet (Brill-Begs correlation http://excelcalculations.blogspot.com/2011/08/compressibility-factor-natural-gas.html and Hall and Yarborough https://topdogengineer.com/coding-the-hall-and-yarborough-z-factor-correlation/) but it seems I can't get the value. The closest I get is from the online calculator https://checalc.com/solved/gasVisc.html 0.95830 instead of 0.951.

As for specific heat ratio, for the lean gas cp/cv I get the value 0.951 but as i want to calculate for the rich gas, i get 0.951 instead of 0.932. It seems that Z value only change as the temperature and pressure change, the change of molecular weight will not change the Z value. Wrong spreadsheet i guess as it use the methane properties https://www.academia.edu/31217573/Heat_Transfer_Excel_Calculations_1?auto=downloadAs in the attachment is the composition of the natural gas. In my case for the lean gas.

I want to ask about VBA. Is the VBA contain module that can calculate compressibility factor and specific heat ratio or i have to google the VBA code from google? I have do some google and copy the VBA spreadsheet (Brill-Begs correlation http://excelcalculations.blogspot.com/2011/08/compressibility-factor-natural-gas.html and Hall and Yarborough https://topdogengineer.com/coding-the-hall-and-yarborough-z-factor-correlation/) but it seems I can't get the value. The closest I get is from the online calculator https://checalc.com/solved/gasVisc.html 0.95830 instead of 0.951.

As for specific heat ratio, for the lean gas cp/cv I get the value 0.951 but as i want to calculate for the rich gas, i get 0.951 instead of 0.932. It seems that Z value only change as the temperature and pressure change, the change of molecular weight will not change the Z value. Wrong spreadsheet i guess as it use the methane properties https://www.academia.edu/31217573/Heat_Transfer_Excel_Calculations_1?auto=downloadAs in the attachment is the composition of the natural gas. In my case for the lean gas.

Last edited:

- #11

Science Advisor

Homework Helper

- 15,814

- 4,715

BvU said:MW, molweight is 16.88 so mainly CH4 (as opposed to 19.5 for natural gas)

- #12

- 9

- 0

BvU said:?? You posted a composition. Did you have that all the time, leaving us guessing ?

View attachment 265608

Yes. I have the composition. I am sorry to leave your guessing. I think this information is not required as the spreadsheet contain the molecular weight

- #13

Science Advisor

Homework Helper

- 15,814

- 4,715

The composition can not follow from the molecular weight. Conclusion: Molecular weight is NOT an input, in spite of its appearance on the sheet INPUT DATA . What formula is in that cell ?Amirul96 said:Yes. I have the composition. I am sorry to leave your guessing. I think this information is not required as the spreadsheet contain the molecular weight

And: do you believe the composition sheet when it says Gas Density 13.64 kg/Sm

Compresssibility follows from T, P and composition. I strongly suspect the cell containing a value

When reverse engineering a piece of undocumented and unstructured software from someone else, it is important to establish a sequence of dependencies without guessing. And without being misled. Do you know how to use the 'Trace dependents' and 'Trace precedents' buttons on tab Formulas ?

Last edited:

- #14

Science Advisor

Homework Helper

- 15,814

- 4,715

Again: what is the content of those cells (not the value but the content) ?Amirul96 said:I want to ask about VBA. Is the VBA contain module that can calculate compressibility factor and specific heat ratio

- #15

- 9

- 0

BvU said:The composition can not follow from the molecular weight. Conclusion: Molecular weight is NOT an input, in spite of its appearance on the sheet INPUT DATA . What formula is in that cell ?

And: do you believe the composition sheet when it says Gas Density 1364 kg/Sm^{3}?

If u ask me about the formula, i don't know. Got the value from online calculator.

BvU said:Compresssibility follows from T, P and composition. I strongly suspect the cell containing a value0.951on the sheet INPUT DATA is also NOT an input. What formula is in that cell ?

I have tried many online calculator and online excel but didnt get the value. By the way, when you say it, I just noticed maybe you are right. The input probably is the input for the detailed calculation result part.

BvU said:When reverse engineering a piece of undocumented and unstructured software from someone else, it is importatnt to establish a sequence of dependencies without guessing. And without being misled. Do you know how to use teh 'Trace dependents'and 'Trace precedents' buttons on tab Formulas ?

First time hearing it. Is it in excel? maybe need to study it.

Last edited:

- #16

Science Advisor

Homework Helper

- 15,814

- 4,715

Move the cursor to that cell and click to make it the active cell. Does it contain a value or does it contain a formula ? likeAmirul96 said:If u ask me about the formula, i don't know

Amirul96 said:Is it in excel?

- #17

- 9

- 0

BvU said:Move the cursor to that cell and click to make it the active cell. Does it contain a value or does it contain a formula ? like

View attachment 266155

Unfortunately, I don't have the excel spreadhseet. It is in the form of pdf, not in xls form.

- #18

Science Advisor

Homework Helper

- 15,814

- 4,715

Mission impossible. PDF can't be reverse engineered. Put pressure on the supervisor to dig up the excel file. There must be a copy somewhere on a backup or whatever. Or else find another company: this one is no good: they don't keep their knowledge and hire sadists as trainee supervisor !Amirul96 said:a task to do some reverse engineering where i need to study how a spreadsheet (calculation) construct by other process engineer was been constructed

(Or is the origin of the PDF questionable ? Even worse !)

- #19

- 10

- 4

- for natural gas with sour gas (H2S) or incondensable (n2, Co2), we usually use correction factor asides the ideal behavior of the gas law

- To calculate gas transmission pipelines for pressure more than 100 psia, there are correlations that adjust up to 3 % to the field data. Is is your case, the excel sheet could be done with any of the correlation available for the pressure range of the pipeline, elevations and gas compositions. According to that, we as process engineer select the appropriated one.

Horacio

Share:

- Replies
- 1

- Views
- 214

- Replies
- 4

- Views
- 5K

- Replies
- 1

- Views
- 916

- Replies
- 4

- Views
- 3K

- Replies
- 4

- Views
- 1K

- Replies
- 17

- Views
- 5K

- Replies
- 2

- Views
- 1K

- Replies
- 1

- Views
- 1K

- Replies
- 3

- Views
- 1K

- Replies
- 427

- Views
- 14K