We love feedback. One common comment regarding the article on “Calculations with Queries” (http://www.naviknow.com/2018/07/25/using-databases-calculations-with-queries/) was that people wanted to see more examples. To follow is a relevant example that captures quite a few topics covered in both the previous article.
Let’s suppose you have created a data table in your database to store data on flares. The only data you are interested in are the flare identifiers (EPN), the flare height and the typical flow rate, lower heating value , and molecular weight of a gas stream to the flare. Since all the data came from a secondary data source, such as the TCEQ Emission Inventory database, all the data fields have a data type of varchar (50), i.e. text no more than 50 characters long (see Best Practices in http://www.naviknow.com/2018/07/11/using-databases-with-dispersion-modeling-the-basics/).
Based on the documentation from the secondary data source, the data field for flare identifiers is “EPN”, “HEIGHT_FEET” for flare height, “FLOW_RATE_MSCFM” for flow rate, “LOW_HEAT_VAL_BTU_SCF” for lower heating value, and “MOL_WT” for molecular weight. The units of the values are indicated in the field names.
A graphical depiction of the table structure should look like this:
When flares are represented in AERMOD, by guidance, they are to be characterized as POINT sources since there is no FLARE source type in AERMOD. As a result of this characterization, some of the source parameters (height, exhaust temperature, exhaust velocity, and diameter) are assigned effective values. The height maps to HEIGHT_FEET, but the exhaust temperature and velocity are assigned default values, 1273 K and 20 m/sec, respectively. The diameter value requires calculation based on the heat release and molecular weight of the gas stream sent to the flare.
To calculate the effective diameter of each flare in your flare table, tblFLARE_props, the following query can be used:
SELECT tblFLARE_props.EPN, Round(Cdbl(tblFLARE_props.HEIGHT_FEET)*0.3048, 2) AS [H (m)], CStr(Round(Sqr((252/60)*CDbl([tblFLARE_props].[FLOW_RATE_MSCFM])*1000 *CDbl([tblFLARE_props].[LOW_HEAT_VAL_BTU_SCF])*(1-0.048 *Sqr(CDbl([tblFLARE_props].[MOL_WT])))/1000000),3)) AS [D (m)], Cdbl(tblFLARE_props.FLOW_RATE_MSCFM)*1000 AS [Flow Rate (scfm)], tblFLARE_props.LOW_HEAT_VAL_BTU_SCF AS [LHV (Btu/scf)], tblFLARE_props.MOL_WT AS [Mol Weight] FROM tblFLARE_props
The familiar formula to calculate the effective diameter is in bold.
This query uses common functions such as ROUND, to round a decimal number to a specified number of decimal places, and SQR, for square roots. Other functions used are to convert the text values (varchar(50)) to numeric values (CDbl) and numeric values to text (CStr) for display purposes.
If you found this article informative, there is more helpful and actionable information for you. Go to http://learn.naviknow.com to see a list of past webinar mini-courses. Every Wednesday (Webinar Wednesday), NaviKnow is offering FREE webinar mini-courses on topics related to air quality dispersion modeling and air quality permitting. If you want to be on our email list, drop me a line at [email protected].
One of the goals of NaviKnow is to create an air quality professional community to share ideas and helpful hints like those covered in this article. So if you found this article helpful, please share with a colleague.