Temperature Correction Factor for the volume of LPG/NGL- part 2
In part 1 of “Temperature Correction Factors for LPG and NGL” we talked about table 24E, which is used to calculate a CTL based on relative density at 60 deg Fahrenheit.
In part 2 we will discuss the use of table 23E, which is used to convert a relative density at observed density to a relative density at 60 deg Fahrenheit.
This article is the second in a series of three (or possibly more) and attempts to explain the practical use of these tables, and table 23E in particular.
Okay, let’s get started!
The implementation methods for all standards are explained in detail in the API MPMS publication 11.2.4 and all formulas required to do the calculations are supplied in that publication. It is however not that easy to translate the explanations into for example an excel spreadsheet without a thorough study of the implementation methods. Especially for table 23E where one needs to carry out one or more iterations in order to arrive at a satisfactory answer.
Table 23E: Calculating relative density at 60 deg Fahrenheit based on observed relative density and observed temperature in deg Fahrenheit.
In all the implementation methods the calculations are performed using reference fluids that are close in density on either side of the input density. These reference fluids have a number of defined parameters that represent the equations for their corresponding states (i.e. whether they are in liquid or solid state, saturated or not etc). Utilizing these reference fluids and their given critical temperatures, the temperature correction factor can be calculated from the densities of the reference fluids, after they have been scaled to the observed reduced temperature (reduced by the critical temperature of the input fluid).
As described in part 1, the table with all data for the reference fluids is again necessary. The required data is given on page 13 of chapter 11.2.4, at the end of section 22.214.171.124 and can be viewed here.
NOTE: for all calculations double precision is required and figures are rounded to 12 decimals. It is important to follow this convention otherwise results will be different from those as calculated by API.
Input: (example figures and calculated results in blue letters)
– Relative density at observed temperature (Ύx) (0.24573)
– Observed temperature in °F (Tf) (189.98)
Step 23/1: Round the relative density to the nearest 0.0001 and round the observed temperature to the nearest 0.1 °F:
– Ύx = 0.2457, Tf = 190.0
Step 23/2: Convert the rounded observed temperature to units of °Kelvin: Tx = (Tf + 459.67) / 1.8
Tx = 360.927777777778
Step 23/3: Check if Tx and Ύx fall within the required boundaries:
– temperature: 227.15 <= Tx <= 366.15 °K
– density: 0.2100 <= Ύx <= 0.7400
If either one of the values is not within the boundaries the CTL cannot be calculated.
Step 23/4: Determine the two reference fluids that are immediately smaller and bigger than the input density. The approach here used is a bit different from the one used for use of table 24E since we must now first calculate a density for each reference fluid at the observed temperature and only afterwards (in step 23/5) determine which reference fluids to use. The densities of all reference fluids must be calculated at the observed temperature Tx as follows:
- Use each reference fluid’s critical temperature Tc,ref to compute its reduced observed temperature Tr,x: Tr,x = Tx / Tc,ref.
- If Tr,x <= 1 calculate the saturation density for this reference fluid using Tr,x and the formula from step 24/10 in the calculations of table 24E:
Rosatx,ref = Roc * (1 + ((k1 * Tau^0.35) + (k3 * Tau^2) + (k4 * Tau^3))/(1 + (k2 * Tau^0.65))) whereas Tau = 1 – Tr,x
k1, k2, k3 and k4 are factors taken from the table above for each reference fluid.
- Also calculate the saturation density for this reference fluid at 60°F using the reduced temperature Tr,60:
Tr,60 = 519.67 / (1.8 * Tc,ref)
Rosat60,ref = Roc * (1 + ((k1 * Tau^0.35) + (k3 * Tau^2) + (k4 * Tau^3))/(1 + (k2 * Tau^0.65))) whereas Tau = 1 – Tr,60
Calculate the relative density at the observed temperature for this reference fluid as:
Ύx,ref = Ύ60,ref * (Rosatx,ref / Rosat60,ref) where Ύx,ref is the reference fluid’s relative density at 60°F
If Tr,x > 1, this reference fluid will not be liquid at the observed temperature and no value of Ύx,ref can be calculated and the result should be flagged ‘-1’ in this case.
Step 23/5: Determine the two reference fluids to be used for the calculation. First choose the lowest density reference fluid that has a density value greater than Ύx and name this fluid ‘reference fluid 2’. Likewise find the next lowest density (i.e. the fluid that has a density value smaller than Ύx) and name this fluid ‘reference fluid 1’.
– fluid 1 = EP (35/65), Ύx,ref = -0.470381000000
– fluid 2 = Ethane, Ύx,ref = 0.341646473673
If Ύx is below that for “EE 68/32” (the reference fluid with the lowest density) then set “EE 68/32” as reference fluid 1 and “ethane” as reference fluid 2. Likewise if Ύx is above that for “n-heptane” then set “n-hexane” as fluid 1 and “n-heptane” as fluid 2.
Step 23/6: This is where the iteration process is about to start. Because of the fact that there is no formula that accurately describes the relationship between relative density at 60°F and relative density at observed temperature, we need to find the relative density at 60°F that corresponds to our observed density by trial and error. First we establish the high and low limits between which the relative density at 60°F and the observed density lie using the calculated data from step 23/5. Then, based on these limits we calculate a middle value for the relative density at 60°F. Then we calculate a CTL based on this middle value and Tx, and obtain an observed density by applying the CTL to this middle relative density at 60°F. After comparing the obtained observed density with our input relative density (Ύx) we check to see if the difference between the obtained observed density and (Ύx) is less then 0.000000001. If so, then we have found the solution. If not then we must make a new iteration as will be described in step 23/9.
Setting the limits:
- Set the upper limit for the observed fluid’s 60°F relative density, Ύ60,high as Ύ60,high = Ύ60,2
- Set the high limit for the relative density at observed temperature Ύx,high as Ύx,high = Ύx,2
However, if the relative density Ύx is greater than the reference fluid “2” relative density at observed temperature Ύx,2, then no answer exists. In this case Ύx,60 should be flagged as -1 and exit.
- Set the low limit for the observed fluid’s 60°F relative density, Ύ60,low as Ύ60,low = Ύ60,1
- Set the low limit for the relative density at observed temperature Ύx,low as Ύx,low = Ύx,1
However, if reference fluid “1” is not a liquid at the observed temperature (i.e. Tr,x >1 for the reference fluid), then set the lower limit 60°F relative density using the following equation:
Ύ60,low = ((Tx – Tc,1) * (Ύ60,2 – Ύ60,1) / (Tc,2 – Tc,1) ) + Ύ60,1
Also, if Ύ60,low is less than 0.3500, set it to 0.3500.
- If Ύ60,low has been reset using the preceding technique then recalculate the corresponding Ύx,low value, using table 24E steps 24/4 until 24/13 to calculate its CTL. The corresponding relative density at observed temperature will be: Ύx,low = CTL * Ύ60,low
- If the observed relative density Ύx is less than the observed lower limit Ύx,low, then no answer exists, and Ύ60 should be flagged as -1 and we should exit the procedure.
Step 23/7: Calculate an intermediate 60°F relative density value, Ύ60,mid.
If a value for Ύ60,low exists, then calculate Ύ60,mid from:
- δ = (Ύx – Ύx,low) / (Ύx,high – Ύx,low)
- If δ is less than 0.001, set it equal to 0.001. If δ is more than 0.999 set it equal to 0.999
- Ύ60,mid = Ύ60,low + δ * (Ύ60,high – Ύ60,low)
If however no value for Ύx,low exists then calculate Ύ60,mid from:
Ύ60,mid = (Ύ60,high + Ύ60,low) / 2
Calculate the CTL using this value of Ύ60,mid and Tx (both unrounded!), using steps 24/5 to 24/13 from table 24E. The relative density Ύx,mid at observed temperature Tx will be: Ύx,mid = Ύ60,mid * CTL
Step 23/8: Check for convergence of the 60°F relative density to see if the result is already satisfactory:
Convergence has been accomplished either:
- If Ύx is between Ύx,low and Ύx,mid and |Ύ60,low – Ύ60,mid| < 0.000000001
- If Ύx is between Ύx,high and Ύx,mid and |Ύ60,high – Ύ60,mid| < 0.000000001
If convergence has been achieved, set Ύ60 = Ύ60,mid and skip to step 23/12.
Step 23/9: Since convergence has not been achieved we now need to step through an iteration routine.
First we calculate an approximation to the relationship between the three pairs of relative density values (Ύx,low , Ύ60,low), (Ύx,mid , Ύ60,mid) and (Ύx,high , Ύ60,high). We can calculate a quadratic equation of the form y = Ax^2 + Bx + C that will fit through these three points, using the following formulas to obtain parameters a, b and c:
- α = (Ύ60,high – Ύ60,low)
- β = Ύx,high^2 – Ύx,low^2
- φ = (Ύx,high – Ύx,low) / (Ύx,mid – Ύx,low)
- A = (α – φ*( Ύ60,mid – Ύ60,low)) / (β – φ*( Ύx,mid^2 – Ύx,low^2))
- B = (α – A * β) / (Ύx,high – Ύx,low)
- C = Ύ60,low – B * Ύx,low + A * Ύx,low^2
- Consequently Ύ60,trial = A * Ύx^2 + B * Ύx + C
The resulting value of Ύ60,trial may need to be adjusted if it is outside the range Ύ60,low – Ύ60,high:
If Ύ60,trial < Ύ60,low then reset Ύ60,trial to:
Ύ60,trial = Ύ60,low + (Ύ60,mid – Ύ60,low) * (Ύx – Ύx,low) / (Ύx,mid – Ύx,low)
If Ύ60,trial > Ύ60,high then reset Ύ60,trial to:
Ύ60,trial = Ύ60,mid + (Ύ60,high – Ύ60,mid) * (Ύx – Ύx,mid) / (Ύx,high – Ύx,mid)
Next, calculate the temperature correction factor CTL, using the new value of Ύ60,trial and steps 24/4 until 24/13 from table 24E. Do not round off the output for CTL!
The relative density Ύx,trial at observed temperature will be:
Ύx,trial = CTL x Ύ60,trial
Step 23/10: Check for convergence of the 60°F relative density. The calculation will be considered converged if the absolute difference between Ύx,trial and Ύx is less than 0.00000001. If converged, set:
Ύ60 = Ύ60,trial
And skip to step 23/12
Step 23/11: Since the calculation has not yet converged, the iteration upper and lower limits must be updated:
- If Ύx,trial > Ύx then reset the upper limits to:
Ύx,high = Ύx,trial
Ύ60,high = Ύ60,trial
- Also, if Ύx,mid < Ύx then reset the lower limits to:
Ύx,low = Ύx,mid
Ύ60,low = Ύ60,mid
- If Ύx,trial < Ύx then reset the lower limits to:
Ύx,low = Ύx,trial
Ύ60,low = Ύ60,trial
- If Ύx,mid > Ύx then reset the upper limits to:
Ύx,high = Ύx,mid
Ύ60,high = Ύ60,mid
Now return to step 23/7 and continue the iteration process. At most 10 iterations should be done. If after 10 iterations no convergence has been achieved it means there is no solution. In that case flag the result as -1 and exit this procedure. According to the API MPMS white paper, all known cases have been found to return a solution within less than 10 iterations at present.
Step 23/12: Round off the 60°F relative density Ύ60 to the nearest 0.0001. If the value is less than 0.3500 or greater than 0.6880 the result is outside the scope of this standard and must be rejected.
Well, this brings us to the end of the procedure.
The calculations done here can be verified using my app Oilcalcs for iPhone and Oilcalcs HD for iPad, both of which you can download in the Appstore here:
Alternatively Oil Calculator Pro is also perfectly suited for this and is available for download in the Google Play Store: