PVT - Functions - Excel Add-In - VBA - List

Functions Gas and Water - Add-In Excel - VBA - Tool PVT - Properties / Correlations - Gallery - ResEngMike -
a Reservoir Engineering Toolbox

Programming – using visual basic (VBA) – Excel Add-In solutions:
Status as of present development : finalized @05/2021:

PVT-Excel Add-In-Functions for Gas and Water Analysis:
Based on a detailed gas composition using PVT-parameters like:
Methane, Ethane, Propane, … Decane, CO2, N2, He, H2S, O2 and free water:

All functions were checked by reference PVT-data/tables for a significant deviation by using a pressure range:
An overall result reached a deviation of -1.5% to +3.5% in comparison with other references/ PVT-Tables.

All created functions were recommended, when their calculated results are <5% apart from reference calculations – commercial PVT-tables.

The Excel PVT-functions are described by practical applications and verifications.
For a quicker application: short function examples are added in a worksheet.
Additionally, application details are explained in specific worksheets to visualize/clarify the established possibilities.

Specific Functions for Gas Analysis:

Molar mass, specific gas gravity (absolute and relative), critical temperature,
critical pressure, upper/lower heating values and Wobbe index.

Further Functions for Gas and Water :
On a common development style:
common input naming and all functions contain a final optional parameter:
with option= 1: check input for data validity
with option= 2: show general function Information and some with futher special option featurs

Gas (Excel Functions / Add-In):

Gas z-Factor Dranchuk (1974): 
z-Factor_Dranchuk (Press,Temp, Pc, Tc, option= 1/2 (as of all below))

Gas Density Dranchuk (Rho(g)): 
GasDen_Dranchuk (Press, Temp, Pc, Tc, gasg)

Gas Expansion Factor Dranchuk (1/Bg): 
GasExp_Dranchuk (Press, Temp, Tc, Pc)

z-Factor Invers (Back Calculation):
z-FacInv_Dranchuk (pz, Temp, Pc, Tc)

z-Factor Dranckuk & Abou-Kassem – DAK (1975):
z-Factor_DAK (Press, Temp, gasg, N2, CO2, H2S)

Gas Density – DAK (Rho(g)): 
GasDen_DAK (Press, Temp, gasg, N2, CO2, H2S)

Gas Expansion Factor – DAK: (1/Bg): 
GasExp_DAK (Press, Temp, gasg, N2, CO2, H2S)

z-Factor – Hall-Yarborough (1973): 
z-Factor_Hall_Yarb (Press, Temp, gasg, N2, CO2, H2S)

z-Factor (Hall-Yarborough – Newton and Rawson): 
z-Factor_DAK_NTR (Press, Temp, Pc, Tc)

Gas Viscosity (Lee/Gonzalez 1968/66) (µg): 
GasVisc ( Press, Temp, GasG, Pc, Tc)

Gas Viscosity (Lee/Gonzalez 1968/66) (µg):
Using alternative parameters: 
MueG (gasG, Press, Temp, zFactor)

Gas Compressibility (cg): 
GasComp ( Press, Temp, Pc, Tc)

Critical Pressure (Braun & Katz (1948), Pc) : 
PC_BK (gasg, N2, CO2, H2S)

Critical Temperature (Braun & Katz (1948),Tc): 
TC_BK (gasg, N2, CO2, H2S)

Critical Pressure (Standing (1977), Pc) : 
PC (gasg, N2, CO2, H2S)

Critical Temperature (Standing (1977), Tc) : 
TC (gasg, N2, CO2, H2S)

Rock Compressibility (Hall, cf): 
cf_Hall (phi)

Rock Compressibility (Newman, cf): 
cf_NewMan (phi, Rocktype)

Bottom Hole (BH)-Flowing Pressure – Average Temperature/Z-Factor-Method:
PwfSec_XmMethod (FP_Top, GasRate, Sec_AHD, Sec_TVD,Temp_Top, Temp_Bot, TempGRAD, Pc, Tc, gasg, Tubing_ID, EPSe)

Alternative: Bottom Hole (BH) – Flowing Pressure by Cullender & Smith Method:
PwfSec_CS_Method (FP_Top, GasRate, Sec_AHD, Sec_TVD, Temp_Top, Temp_Bot,….)

Static BH-Pressure: 
Pstatic (WHSIP, WHT, TGrad, DepthTarget, gasg, Pc, Tc)

Static BH-Pressure: Alternative Functions:  
PstaticModi () and StaticDAK ()

Pseudo Pressure (m(p)) – Version 1:
PseudoPress_Golan_V1 (Press, Temp, gasg, Pc, Tc)

Pseudo Pressure (m(p)) – Version 2 – using alternative parameters:
PseudoPress_Golan_V2 (Press, Temp, gasg, N2, CO2, H2S)

Water (Excel Functions/ Add In):

Water Formation Volume Factor (Bw): 
BwSal (Press, Temp, NaCl_ppm)

Water Formation Volume Factor (Bw): 
BwGasSal (Press, Temp, NaCl_ppm)

Gas Dissolved in Water: 
GasWatDis (Press, Temp, NaCl_ppm)

Water Density: 
WaterDensity (Press, Temp, NaCl_ppm)

Condense Water Content:
WatContGas_Bahadori (Press, Temp)

WH–>BH: Water Injection (BH-Pressure with Tubing Friction):
Water_BHFP_InjSec  (FP_Top, WaterInjRate, Sec_AHD, Sec_TVD,
… Temp_Top, Temp_Bot, TempGRAD, Salinity, Tubing_ID, EPSe)

BH: Water Injection (Pressure Loss due to mechanical Skin):
… Water_DeltaP_MechSkin  (WaterInjRate, FP_Bot, Temp_Bot, Perm, Hnet, Skin, Salinity)

WH–>BH Water Injection (Wellbore Friction, Skin Losses and PSS-Flow Injection (Matching Tool)):
Water_InjRateMax  (WaterInjRateTarget, FP_Top, Temp_Top, Sec_AHD, Sec_TVD,
…. Temp_Bot, TempGRAD, Salinity, Tubing_ID, EPSe, Perm, Hnet, Skin, BHSIP, BHT, Re, Rw)

Other Functions (Excel Functions/ Add-In):

Interpolation Tools:
different: Linear- and Spline-Interpolation-Tools

Legend: later described by an alphabetic list – of cause: each input parameter has a short text legend and the unit information – presently – all SI-Units:
Selected parameters used:
Pressure (Press), temperature (Temp), Gas Rate, Water Injection Rate, specific gas gravity (gasg), mole fraction of gas composition in 0-100, critical pressure, temperature, z-factor, porosity (phi), NaCl concentration, water density, compressibility (gas/water), viscosity (gas/water), section along hole depth/true vertical depth (Sec_AHD/Sec_TVD), gas rate, tubing ID, tube roughness (Eps), temp-gradient (TempGrad), flowing/shut-in pressure (FP/SIP) for bottom- and top-location (Bot/Top), permeability (Perm), net thickness (hNet), mechanical Skin-Factor (Skin), drainage radius (re), wellbore radius (rw), bottom hole shut-in pressure (BHSIP), bottom hole temperature (BHT).

To be continued by:
further functions and additional Object Pascal developments.