ucum icon indicating copy to clipboard operation
ucum copied to clipboard

Request for: degree API

Open dbhart opened this issue 9 months ago • 8 comments

Request for unit: degree API

Usage The degree API1,2 is the unit of measure for the API gravity (inverse of relative density). Quoting from UN/ECE Rec 20, the degree API is a "unit of relative density as a measure of how heavy or light a petroleum liquid is compared to water (API: American Petroleum Institute)." UN/ECE Rec 20, value J13

The degree API is defined as:

            141.5
°API = ------------------  -  131.5
       s.g. 60 °F / 60 °F

where s.g. 60 °F / 60 °F is defined as the specific gravity of the product at 60 degrees Fahrenheit, which is calculated as the density of one volume of product at 60 °F and 1 atm ambient pressure divided by the density of the same volume of deionized water at 60 °F and 1 atm ambient pressure.

Standardization of the unit API gravity is calculated by following one of the appropriate ASTM procedures: ASTM D287, ASTM D1298, or ASTM D4052. Conversion tables are used for temperature correction factors when the density of the product cannot be measured at the correct temperature (e.g., when measured at a custody transfer point in the field).

Proposed code There are two different reference temperatures specified in the ASTM methods -- 15 Cel and 60 [degF]. Based on the precedent used for Btu and Cal, I propose the following two codes:

[degAPI_60] := degree API at 60 degrees Fahrenheit

[degAPI_15] := degree API at 15 degrees Celsius

The definition in the XML essence would be:

   <unit Code="[degAPI_60]" CODE="[DEGAPI_60]" isMetric="no" isSpecial="yes" class="misc">
      <name>degree API (at 60 degrees Fahrenheit)</name>
      <property>fluid density</property>
      <value Unit="degApi(60 [degF])" UNIT="DEGAPI(60 [DEGF])">
         <function name="degApi" value="60" Unit="[degF]"/>
      </value>
   </unit>
   <unit Code="[degAPI_15]" CODE="[DEGAPI_15]" isMetric="no" isSpecial="yes" class="misc">
      <name>degree API (at 15 degrees Celsius)</name>
      <property>fluid density</property>
      <value Unit="degApi(15 Cel)" UNIT="DEGAPI(15 Cel)">
         <function name="degApi" value="15" Unit="Cel"/>
      </value>
   </unit>

dbhart avatar Mar 16 '25 17:03 dbhart

OK. This is an example of using a customary scale to measure (or calculate) the volumetric mass density of materials. The rules to convert to and from SI units mg/L, kg/m3 are a bit awkward, but well defined and unambiguous. This should be described a bit more clearly in the text, however.

The formula uses the "relative volumetric mass density" of a material, measured at specific pressure and temperatures. Note that there is a pending proposal to add UCUM codes for "relative density".

The preferred method should be the expression of the density directly in SI units like mg/L, kg/m3. But we could also accept customary scales in practical use, as this is commonly accepted for e. g. temperature.

We already have [den] and tex in UCUM as customary units for linear mass density.

I suggest to render the formula as Degrees API = (141.5 / (sp. gr. 60ºF / 60ºF)) - 131.5 as in https://www.eia.gov/dnav/pet/tbldefs/pet_pri_wco_tbldef2.asp

chgessner avatar Mar 17 '25 07:03 chgessner

As explained in https://github.com/ucum-org/ucum/issues/174#issuecomment-2727254573 this a case involving a dimensionless quantity and that might be better expressed using a code for the measurement and not with a code for the unit. For example, there are numerous LOINC codes for "specific gravity" measurements in medicine, e.g. for urine, body fluid, or even a generic material.

Therefore it might be better, NOT to add a unit for "specific gravity" (or "relative density"), in order to avoid confusion for users of UCUM in medicine.

chgessner avatar Mar 17 '25 07:03 chgessner

I will work on creating a better description for 'degree API' as the unit of the measurement 'API gravity' for the text.

dbhart avatar Mar 20 '25 14:03 dbhart

I recommend against the use of the acronym, "API" for several reasons. First and foremost, "API" stands for the "American Petroleum Institute" (https://en.wikipedia.org/wiki/American_Petroleum_Institute), which, if incorporated into UCUM, implies a UCUM endorsement of the American Petroleum Institute. Second, in the healthcare regulatory community, the acronym "API" stands for "active pharmaceutical ingredient" (https://www.cancer.gov/publications/dictionaries/cancer-terms/def/active-pharmaceutical-ingredient) and "application programming interface" (https://en.wikipedia.org/wiki/API). Since the FDA regulates petroleum products that are used in the pharmaceutical and cosmetic industry, the use of the acronym "API" in the submission of regulatory data to FDA might lead to confusion. I agree that "degree API" is a dimensionless quantity and that might be better expressed using a code for the measurement and not with a code for the unit, such as LOINC codes.

SRKid avatar Mar 20 '25 15:03 SRKid

Thank you, sir. I understand your concerns - they definitely make sense. °API is the unit of density used for all liquid-petroleum products and energy logistics that touch the U.S. market - U.S. domestic and internationally; it is specified in contract language, and on the commodities markets, is used by both ASTM and NIST scientifically, and just can't be avoided the energy industry. API gravity is the measurement, but 'degree API' is a true unit, and just like Celsius and Fahrenheit are the name of the scales for temperature, the name of the crude oil density scale is the "API" scale (see n.b., at end).

I'm new to using UCUM - I got here because of UCUM's work with Open Geospatial Consortium (OGC) has led to the OGC recommending the use of UCUM codes for units of measure; I actually did not know about the deep healthcare and medical-coding linkage until fairly recently. So, I understand that members of the healthcare and medical field might see it in the list of units and wonder what it is at first, but I believe that a proper textual definition would handle that. And maybe there needs to be an additional suffix, but I don't see a way to avoid "API" since that's part of the unit's name.

As far as LOINC codes, I think the appropriate analog in petrochemical and energy logistics are ASTM measurements. I would say that something has a density of 42.3 °API as determined by ASTM.D287, but the unit has to go with the value.

Regarding the implied endorsement - I absolutely understand that. There are lots of reasons not to want to imply endorsement or support for any particular person/organization, especially when they are a living, active entity (as opposed to Lord Kelvin or Sir Isaac). But in this case, I don't think that the use of a well-established unit of measurement - that has been used by governments and on the international energy markets for over a century - would imply any more endorsement than using the name of unit based on a person; I'm not endorsing all of Sir Newton's ideas or beliefs by using the newton, and I don't feel I am endorsing the API organization when I say I'm moving 2.10*6 bbl of 37.5 °API sour crude oil. There are vendor-specific units throughout the chem/bio sections of the UCUM definitions, and I don't think it implies that UCUM is endorsing those vendors, it is just accepting the reality on the ground.

Anyway, I just wanted to try to address your concerns because I do see the reasons for them. I just don't see a way to avoid defining the 'degree API' if energy folks want to use the UCUM, because it is such a core unit within the energy industry.

Thanks!


N.b., the Baumé scale, with unit 'degree Baumé' (°Bé), was the original crude oil density scale and unit, but went out of favor in the 1920's because there were multiple zero points and instruments were sold that were mis-calibrated, so the API scale was developed based on the reality in the field, and so the US NBS (NIST predecessor) chose the degree API as the standard to promote. UN/ECE Rec 20 has three different designations for the unit of 'degree Baumé', none of which are well defined as compared to 'degree API', which is well defined and singular.

dbhart avatar Mar 20 '25 19:03 dbhart

So noted. I appreciate your perspective.

Below is a AI-generated detailed summary of the key CFR references where “degree API” appears or is used as a basis for calculations and quality adjustments for petroleum products:


  1. Indian Oil Valuation (Title 30 CFR Part 1206) • Use in Quality Normalization and Valuation: Under the Indian oil valuation rules, the “degree API” is used to normalize the quality of crude oil for royalty and valuation purposes. In practice, operators adjust sales prices to a baseline API gravity (for example, 23.5° API) so that differences in crude quality are fairly reflected in royalty calculations. – Example: The proposed Indian Oil Valuation Amendments (see Federal Register document 2014 13967) include detailed examples where oil purchased at different API values is “normalized” by deducting or adding a specified amount (e.g. $0.02 per 1/10° difference) so that a volume‐weighted average price can be calculated.

  1. Air Quality and Environmental Regulations (Title 40 CFR) • References in EPA Documents: In EPA-issued documents that are part of or referenced by Title 40 (which deals with environmental protection), “degree API gravity” is mentioned in discussions related to the quality of petroleum liquids. For example, documents available on Regulations.gov (such as the OAR Box publication) reference “degree API gravity” when discussing how oil properties affect emissions, air quality standards, or the handling of volatile organic compounds.

  1. Transportation of Petroleum Products (Title 49 CFR) • Hazard Classification and Handling: Although not as prominently detailed as in valuation rules, some sections in Title 49 CFR—which governs the transportation of hazardous materials—use physical properties (including API gravity) to help determine classification criteria for petroleum liquids. In these contexts, “degree API” helps distinguish light (high API) from heavy (low API) crudes, which in turn can influence packaging, labeling, and handling requirements during transport.

  1. Oil and Gas Leasing Standards (Title 30 CFR Part 250) • Definition of Crude Quality: In certain sections of Title 30 CFR Part 250—covering oil and gas leasing on federal and offshore lands—the quality of crude oil is partly defined by its API gravity. These references establish the technical basis for what constitutes “light” versus “heavy” crude, which can impact both environmental review and economic terms of lease agreements.

Summary Across these key sections, “degree API” is used as a standard measure to: – Normalize crude oil quality in royalty and valuation calculations (especially in Indian oil valuation under Part 1206). – Inform environmental and air quality assessments by defining the physical properties of petroleum liquids (as seen in EPA-related documents in Title 40). – Assist in the classification and safe transportation of petroleum products (under Title 49 CFR). – Define quality criteria in leasing regulations (in Title 30 CFR Part 250).


SRKid avatar Mar 20 '25 19:03 SRKid

Good discussion, it touches on some basic principles.

Just to remind everyone: There is no problem in using {degAPI_60} and {degAPI_15} in curly braces as a valid UCUM code. It might be at least a temporary workaround, to avoid stopping development.

chgessner avatar Mar 20 '25 20:03 chgessner

Agree!

SRKid avatar Mar 20 '25 20:03 SRKid