gascalc 5.0 api functions - home - bradley b bean · pdf file• aga 7 2006 calcpulse...
TRANSCRIPT
GASCalc 5.0 API FunctionsTable Of Contents
Table Of Contents
General Information.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2CalcElev - Atmospheric Elevation Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7CalcFact - Dimensional Unit Conversion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9CalcGP - Gas Properties Calculation.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15CalcLoss - Gas Loss Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19CalcMeter - Displacement Meter Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26CalcOrifice - Orifice Meter Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31CalcPatm - Atmospheric Pressure Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37CalcPave - Average Pressure Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39CalcPipeEquivL - Equivalent Pipe Length Calculation.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41CalcPipeFlow - Pipe Flow Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43CalcPipeVelocity - Pipe Velocity Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50CalcPulse - Pulse Output Meter Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52CalcPuncture - Equivalent Puncture Diameter Calculation.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56CalcQBase - Base Volume Conversion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58CalcQStd - Standard Volume Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61CalcReg - Regulator Flow Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65CalcRelief - Relief Valve Flow Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70CalcReynolds - Reynolds Number Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75CalcSonic - Sonic Velocity Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78CalcT - Temperature Unit Conversion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82CalcVCone - V-Cone Meter Calculation.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84CalcZF - Compressibility Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89SetLicense - Set License Function.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Bradley B Bean PE ENGINEERING & SOFTWARE Revision - 001, Copyright 2015, All Rights Reserved.
1
GASCalc 5.0 API FunctionsTable Of Contents
General Information
The GASCalc Application Program Interface (API) provides programmatic access to selected calculationroutines and methods found in the GASCalc software.
Modules & Functions
The API is licensed on a module basis. The individual modules allow access to specific calculation methodsand routines. The modules are described in the following table:
Module Functions Function Description Methods/Options
Compressibility CalcZFCalc_ZF
Calculatescompressibility factorand density
AGA NX19* AGA 8 - 1985 AGA 8 - 1992 GERG 88* GPSA* GPA 2145-09*
Gas Properties CalcGPCalc_GP
Calculates various gasproperty values
Heating Value AGA 8 GPA 2172-86 GPA 2172-09 GPSA
Ideal Gas Specific Gravity
Real Gas Specific Gravity
Ratio of Specific Heats Gas Engineers Handbook GPA
Dynamic/Absolute Viscosity
Speed of Sound (non-AGA 7) Traditional Thermodynamic
General SetLicenseSet_License
Sets and returns licenseinformation
Bradley B Bean PE ENGINEERING & SOFTWARE Revision - 001, Copyright 2015, All Rights Reserved.
2
GASCalc 5.0 API FunctionsTable Of Contents
Module Functions Function Description Methods/Options
Loss CalcLossCalc_Loss
Calculates the volumetricflow rate from apunctured or severedpipe
CalcPunctureCalc_Puncture
Calculates the equivalentdiameter of an irregularor rectangular shape
Meter CalcOrificeCalc_Orifice
Calculates various valuesassociated with flowthrough an orifice meter
AGA 3 - 1985 AGA 3 - 1992 ISO - 5167
CalcVconeCalc_Vcone
Calculates various valuesassociated with flowthrough a vcone typemeter
McCrometer
CalcMeter Calculates various valuesassociated with flowthrough diaphragm,rotary, and turbinemeters.
AGA 7 2006 Generic Rotary Generic Turbine GRI/SWRI Diaphragm Rockwell Diaphragm Sprague Diaphragm
CalcQStdCalc_QStd
Calculates a standardvolume based onspecified flowingconditions
AGA 7 2006
CalcPulseCalc_Pulse
Calculates a standardvolume based onspecified flowingconditions, meter factor,and pulse count
AGA 7 2006
Bradley B Bean PE ENGINEERING & SOFTWARE Revision - 001, Copyright 2015, All Rights Reserved.
3
GASCalc 5.0 API FunctionsTable Of Contents
Module Functions Function Description Methods/Options
Pipe CalcPipeFlowCalc_PipeFlow
Calculates various valuesassociated with flowthrough a pipe segment
CalcPipeEquivLCalc_PipeEquivL
Calculates the equivalentlength in terms of anequivalent diameterbased on a specified pipeor fitting diameter andlength
CalcPipeVelocityCalc_PipeVelocity
Calculates the maximumvelocity associated with avolumetric flow rate,pipe diameter, andpressure
Regulator &Relief Valve
CalcReg Calculates various valuesassociated with flowthrough a pressureregulator.
American American AFV Equimeter Fisher Controls Universal Grove 80 Grove 900 ISA S75.01 Mooney Controls Universal Pietro Fiorentini Rockwell Table Based
CalcRelief Calculates various valuesassociated with flowthrough a pressureregulator.
American American AFV API 520 ASME BPV Equimeter Fisher Controls Universal Grove 80 Grove 900 ISA S75.01 Mooney Controls Universal Pietro Fiorentini Rockwell Table Based
Bradley B Bean PE ENGINEERING & SOFTWARE Revision - 001, Copyright 2015, All Rights Reserved.
4
GASCalc 5.0 API FunctionsTable Of Contents
Module Functions Function Description Methods/Options
Sonic CalcSonicCalc_Sonic
Calculates the speed ofsound
AGA 7 2003 Traditional Thermodynamic
Support CalcFactCalc_Fact
Calculates variousdimensional unitconversions
CalcPatmCalc_Patm
Calculates atmosphericpressure values based ona specified elevation
International School ofHydrocarbon Measurement(ISHM) Handbook of Chemistry &Physics American Gas Association(AGA) - Measurement National Oceanographic AndAtmospheric (NOAA) - 1976
CalcPaveCalc_Pave
Calculates the average ofa pair of pressure values
CalcTCalc_T
Calculates varioustemperature conversionvalues
Note - The upper function name represents the name as used by the standard c dll interface. The lowername represents the name as used by the ActiveX and .net interfaces.
API Interface Methods
Access to the API is provided through several types of dynamic link library (dll) interfaces. The interfacetypes are listed below:
Interface Type Description
gc50_calcs.dll Standard c type dynamic link library. Access can be made using anydevelopment or application environment that can declare a function within itsenvironment.
Bradley B Bean PE ENGINEERING & SOFTWARE Revision - 001, Copyright 2015, All Rights Reserved.
5
GASCalc 5.0 API FunctionsTable Of Contents
Interface Type Description
gc50_apix.dll A 32-bit ActiveX control. The dll generally needs to be manually registered inWindows using the regsvr32.exe utility. Once registered the control can be usedby any development or application environment that allows creation of anobject.
gc50_apinet.dll A 32-bit or 64-bit resource that can be used by the .Net 4 framework. The dll canbe used in the development environment by adding it as a resource, or in otherenvironments by registering it with Windows using the regasm.exe utility.
The gc50_apix and gc50_apinet interfaces provide access to the standard c dll by way of their varioussupported environments. All calculations are performed by the gc50_calcs dll regardless of the interfaceused. The non-calculation routines need to be able to find and access the gc50_calcs.dll file, this may requirespecific placement of the gc50_calcs.dll file.
Function Names & Parameters
The following documentation reflects function names and parameter definitio