# Mass and Volumetric Flow rate of Natural Gas

• Amirul96
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.

#### Amirul96

Hi. I am currently doing my internship in the oil and gas industry (contractor) as process engineer. My supervisor give me a task to do some reverse engineering where i need to study how a spreadsheet (calculation) construct by other process engineer was been constructed. 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. The problem is i don't know the formula to calculate mass and volumetric flow rate as it involves gas phase and what i found on internet is the formula to calculate in liquid phases. Can someone help me ?

Hello Amirul, !

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).
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
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').

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

Chestermiller
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?

#### Attachments

• GV1.png
30.2 KB · Views: 433
• GV2.png
35.3 KB · Views: 382
Last edited:
Try solving it first for the case of an ideal gas. Why? If you can't solve it for that case, you certainly won't be able to do it for a real gas. What is the differential equation for the pressure gradient as a function of the gas volumetric flow rate, Reynolds number, friction factor, viscosity, density etc.?

Wow, a lot of sleuthing to do !

To begin with input sheet line 1:

STP
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.
So you want to check which is which for your case.

MMSCFD and kSm3/d is easy: 1 SCFD = (12*0.0254)3 m3/d
(This factor should be in one of the two cells, probably in the kSm3/d one)
(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 kSm3/d​
so 0.2% off for some reason -- different but close standard ?​

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

No idea what the dG stands for (@Chestermiller ?)You'll have to find out how the viscosity, Z and Cp/Cv are calculated (with a formula in the cell or with a VBA function call).

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 kSm3/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.19732) = 3.41 m/s, but he gets 3.54 !?

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.

Lnewqban
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.

Last edited:
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 kSm3/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.19732) = 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 = π r2
ρ at T&P = 39.67 kg/m3

ṁ = ρ A v
= 39.67 kg/m3 x π (0.096852 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/m3 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 m3atm/mol.K x 328.15K x 0.951)
= 39.03 kg/m3
where he get ρ = 39.67 kg/m3

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/m3
= 0.10 m3/s

Q at STP= ṁ/ρ at STP
= 4.14 kg/s / 0.71 kg/m3
= 5.8309 m3/s
= 503.80 m3/d

If i use ρ = 0.713
Q at STP= ṁ/ρ at STP
= 4.14 kg/s / 0.713 kg/m3
= 5.8065 m3/s
= 501.67 km3/d

where the Q at STP he get is 501. 77 ksm3/d

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

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:
Amirul96 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 = π r2
ρ at T&P = 39.67 kg/m3

ṁ = ρ A v
= 39.67 kg/m3 x π (0.096852 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/m3 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 m3atm/mol.K x 328.15K x 0.951)
= 39.03 kg/m3
where he get ρ = 39.67 kg/m3

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/m3
= 0.10 m3/s

Q at STP= ṁ/ρ at STP
= 4.14 kg/s / 0.71 kg/m3
= 5.8309 m3/s
= 503.80 m3/d

If i use ρ = 0.713
Q at STP= ṁ/ρ at STP
= 4.14 kg/s / 0.713 kg/m3
= 5.8065 m3/s
= 501.67 km3/d

where the Q at STP he get is 501. 77 ksm3/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?
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_chart
For the roughness factor and Reynolds number in your situation, the Moody chart gives a Darcy friction factor of 0.026, not 0.015.

The conversion factor between SCF (60 F and 1 atm) and moles is 1.1953. So 17.72 MMSCFD corresponds to 245.15 moles/sec. For a molecular weight of 16.88 gm/mole, this corresponds 4.14 kg/sec, thus confirming the value in your table.

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.

#### Attachments

• composition.png
10.3 KB · Views: 379
Last edited:
?? You posted a composition. Did you have that all the time, leaving us guessing ?

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

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

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
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 13.64 kg/Sm3 ?

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

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

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/Sm3 ?

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 value 0.951 on 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:
Amirul96 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

Amirul96 said:
Is it in excel?

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.

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
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 !

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

Mrs difficult task- Keep in mind.

- 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