SCADACore provides American Gas Association calculation libraries to developers needing to calculate gas flow.

SCADACore’s AGA Gas Flow Library provides most of the AGA gas flow calculations provided by the American Gas Association. As we continue to develop new AGA gas flow libraries they will be added to the existing offering. All available AGA Calculations are combined into one easy to use DLL.

SCADACore offers Royalty Free AGA Gas Flow Library Licenses.
A Demo DLL is provided to help assess the integration of the library into an existing system.

Get The Demo

Pricing and Licensing Options

Internal Company License

$300000CDNone-time
  • The Internal Company License is royalty free, it allows companies to use the library for their own internal calculations. 
  • A single license does not have limits on the number of developers or the the number of applications that are created.
  • The license can not be used by clients or customers of the licensee. Only employees of the company can use the license or derived applications or libraries that are developed with the AGA Flow Calculation Library.

Redistributable License

$550000CDNone-time
  • License will allow a company to build applications that are accessible by both customers and internal employees.  
  •  License can be used as a part of an existing application to add real-time gas flow calculations.
  •  License does not have limits on the number of developers or the the number of applications that are created.
  • License can not be used to offer a free gas flow calculator similar to the SCADACore’s AGA Gas Flow Calculators, SCADACore’s AGA Gas Flow Calculators For Windows, or SCADACore’s Mobile Gas Flow Calculators

Code Samples

The AGA 3 Calculation is the most common AGA calculation used for measure natural gas flow through orifice meters. 

Compressibility factors if known can be inputed manually or AGA 8 calculations can be performed to calculate the compressibility based on the gas compositions of the well.

private void AGA3Example()
{
double flowTemperatureInCelcius = 57;
double pipeReferenceTemperatureInCelcius = 20;
double orificeReferenceTemperatureInCelcius = 20;
double baseTemperatureInCelcius = 15;
double staticPressureKPA = 2818.09;
double baseStaticPressureKPA = 101.325;
double differentialPressureKPA = 10.2000;
double orificeSizeMM = 9.525;
double pipeSizeMM = 52.370;
AgaConstants.MaterialType orificeMaterial = AgaConstants.MaterialType.StainlessSteel;
AgaConstants.MaterialType pipeMaterial = AgaConstants.MaterialType.CarbonSteel;
bool tapIsUpstream = true;
double flowCompressibility = .9280;
double baseCompressibility = .9959;
double specificGravity = .7792;
AGAFlowCalculation.Aga3 aga3calc = new AGAFlowCalculation.Aga3();
AGA3Result result = aga3calc.CalculateFlow(flowTemperatureInCelcius,             pipeReferenceTemperatureInCelcius, orificeReferenceTemperatureInCelcius, baseTemperatureInCelcius, staticPressureKPA, baseStaticPressureKPA, differentialPressureKPA, orificeSizeMM, pipeSizeMM,
orificeMaterial, pipeMaterial, tapIsUpstream,flowCompressibility,baseCompressibility,specificGravity);

System.Console.WriteLine(“AGA3 Test with Flow Compressibility, Base Compressibility, and Specific Gravity Entered”);
System.Console.WriteLine(“Base Compressibility: ” + result.BaseCompressibility_Zb);
System.Console.WriteLine(“Compressibility: ” + result.Compressibility_FPV);
System.Console.WriteLine(“Flowing Compressibility: ” + result.FlowingCompressibility_Zf);
System.Console.WriteLine(“Specific Gravity: ” + result.SpecificGravity);

System.Console.WriteLine(“***Flow***: ” + result.Flow);

System.Console.WriteLine(“Press Enter To Exit”);
System.Console.ReadLine();
}

The AGA 8 Calculations take Gas Compositions as parameters and produce the compressibility factors that can then be used by AGA 3, AGA 7 or AGA 11 to perform more accurate calculations.

private void AGA8Example()
{
//Example of AGA8/AGA3 Flow calculation with Gas Compositions…
AGAFlowCalculation.GasComps gascomps = new AGAFlowCalculation.GasComps();
gascomps.Add(.0184, AGAFlowCalculation.AgaConstants.GasCompositions.Nitrogen_N2);
gascomps.Add(0, AGAFlowCalculation.AgaConstants.GasCompositions.CarbonDioxide_CO2);
gascomps.Add(.0260, AGAFlowCalculation.AgaConstants.GasCompositions.HydrogenSulfide_H2S);
gascomps.Add(.7068, AGAFlowCalculation.AgaConstants.GasCompositions.Methane_C1);
gascomps.Add(.1414, AGAFlowCalculation.AgaConstants.GasCompositions.Ethane_C2);
gascomps.Add(.0674, AGAFlowCalculation.AgaConstants.GasCompositions.Propane_C3);
gascomps.Add(.0081, AGAFlowCalculation.AgaConstants.GasCompositions.iButane_iC4);
gascomps.Add(.0190, AGAFlowCalculation.AgaConstants.GasCompositions.nButane_nC4);
gascomps.Add(.0038, AGAFlowCalculation.AgaConstants.GasCompositions.iPentane_iC5);
gascomps.Add(.0043, AGAFlowCalculation.AgaConstants.GasCompositions.nPentane_nC5);
gascomps.Add(.0026, AGAFlowCalculation.AgaConstants.GasCompositions.nHexane_C6);
gascomps.Add(.0022, AGAFlowCalculation.AgaConstants.GasCompositions.nHeptane_C7);

double flowTemperatureInCelcius = 57;
double pipeReferenceTemperatureInCelcius = 20;
double orificeReferenceTemperatureInCelcius = 20;
double baseTemperatureInCelcius = 15;
double staticPressureKPA = 2818.09;
double baseStaticPressureKPA = 101.325;
double differentialPressureKPA = 10.2000;
double orificeSizeMM = 9.525;
double pipeSizeMM = 52.370;
AgaConstants.MaterialType orificeMaterial = AgaConstants.MaterialType.StainlessSteel;
AgaConstants.MaterialType pipeMaterial = AgaConstants.MaterialType.CarbonSteel;
bool tapIsUpstream = true;
AGAFlowCalculation.Aga3 aga3calc = new AGAFlowCalculation.Aga3();
AGA3Result result = aga3calc.CalculateFlow(flowTemperatureInCelcius, pipeReferenceTemperatureInCelcius,
orificeReferenceTemperatureInCelcius, baseTemperatureInCelcius, staticPressureKPA,
baseStaticPressureKPA, differentialPressureKPA, orificeSizeMM, pipeSizeMM,
orificeMaterial, pipeMaterial, tapIsUpstream, gascomps);
System.Console.WriteLine(“AGA3 Test with AGA8 Gas Compositions calculating compressibility and specific gravity”);
System.Console.WriteLine(“Base Compressibility: ” + result.BaseCompressibility_Zb);
System.Console.WriteLine(“Compressibility: ” + result.Compressibility_FPV);
System.Console.WriteLine(“Flowing Compressibility: ” + result.FlowingCompressibility_Zf);
System.Console.WriteLine(“Specific Gravity: ” + result.SpecificGravity);
System.Console.WriteLine(“***Flow***: ” + result.Flow);
System.Console.WriteLine(“Press Enter To Continue”);
System.Console.ReadLine();
}

When performing AGA 7 calculations you can either manually input the compressibility factors or use AGA 8 calculations to calculate the compressibility using the gas compositions.

public void AGA 7 Test()
{
AGAFlowCalculation.GasComps gascomps = new AGAFlowCalculation.GasComps();
gascomps.Add(.0184, AGAFlowCalculation.AgaConstants.GasCompositions.Nitrogen_N2);
gascomps.Add(0, AGAFlowCalculation.AgaConstants.GasCompositions.CarbonDioxide_CO2);
gascomps.Add(.0260, AGAFlowCalculation.AgaConstants.GasCompositions.HydrogenSulfide_H2S);
gascomps.Add(.7068, AGAFlowCalculation.AgaConstants.GasCompositions.Methane_C1);
gascomps.Add(.1414, AGAFlowCalculation.AgaConstants.GasCompositions.Ethane_C2);
gascomps.Add(.0674, AGAFlowCalculation.AgaConstants.GasCompositions.Propane_C3);
gascomps.Add(.0081, AGAFlowCalculation.AgaConstants.GasCompositions.iButane_iC4);
gascomps.Add(.0190, AGAFlowCalculation.AgaConstants.GasCompositions.nButane_nC4);
gascomps.Add(.0038, AGAFlowCalculation.AgaConstants.GasCompositions.iPentane_iC5);
gascomps.Add(.0043, AGAFlowCalculation.AgaConstants.GasCompositions.nPentane_nC5);
gascomps.Add(.0026, AGAFlowCalculation.AgaConstants.GasCompositions.nHexane_C6);
gascomps.Add(.0022, AGAFlowCalculation.AgaConstants.GasCompositions.nHeptane_C7);

double flowTemperatureInCelcius = 45.5;
double meterFactor = 2.0000;
double flowVolume = 10;
double baseTemperatureInCelcius = 15;
double staticPressureKPA = 13789.4;
double baseStaticPressureKPA = 101.325;
AGAFlowCalculation.Aga7 aga7calc = new AGAFlowCalculation.Aga7();
AGA7Result result = aga7calc.CalculateFlow(flowVolume, flowTemperatureInCelcius,
baseTemperatureInCelcius, staticPressureKPA, baseStaticPressureKPA, meterFactor, 0.848356, 0.997761, 1);
Assert.AreEqual(2.894755, result.Flow, (2.894755 * .001));
}

When performing AGA 11 calculations you can either manually input the compressibility factors or use AGA 8 calculations to calculate the compressibility using the gas compositions.

Code Snippet Coming Soon

Want to know more?

Contact SCADACore for demo AGA library and more information on our software consulting services.

  • Do  you need to accurately verify your well flow values?
  • Do you spend hours each month manually calculating flow values?
  • Do you want to automate tedious tasks and save time and money in the process?
  • Do you want to make your job easier?
Contact Us Now!