- React Native
- Expo SDK 54
- JavaScript ES6+
- AsyncStorage
- EAS Build
- Custom drawer
Field validation
- 6 / 6 Field measurements matching the wheel chart exactly
- 2 Corrections found only through physical testing
- 0.009 lb/gal error that the buoyancy correction removed
The calculations were checked against the physical instruments and printed tables in daily use at an airport fuel facility, not only against the published formulas. Reference sources were the Gammon GTP-3012-1A wheel, ATA Form 103.08 fuel quality records, and printed compressibility factor tables.
| Raw API | Temp | Wheel | FuelOps |
|---|---|---|---|
| 44.5 | 76°F | 43.1 | 43.1 |
| 45.5 | 83°F | 43.5 | 43.5 |
| 47.0 | 97°F | 43.7 | 43.7 |
| 45.5 | 86°F | 43.2 | 43.2 |
| 45.3 | 84°F | 43.2 | 43.2 |
| 45.5 | 89°F | 43.0 | 43.0 |
-
Hydrometer glass expansion
Early results drifted low, and the drift grew as the temperature difference grew. The glass of the hydrometer itself expands with temperature, changing the volume it displaces. API 11.1 corrects for this, and adding it closed the gap across the whole range.
-
Weight in air against vacuum
Metric density is defined in vacuum, but the API pounds-per-gallon tables report weight in air. Subtracting air buoyancy of 0.0011 g/mL brought the figure into agreement. Small enough to look like rounding, large enough that any operator checking against their chart would have called it a bug.
A third detail came out of the same testing. Displayed values are now derived from the rounded corrected API rather than the internal high-precision figure. That shifts specific gravity by 0.001, invisible to the physics, but it means every number on screen agrees with every other number and with the operator's wheel.
What it does
-
API gravity correction
Observed API and fuel temperature give corrected API at 60°F, with density, specific gravity, and pounds per gallon alongside. Switchable between ASTM 5B/6B at 60°F and ASTM 54B at 15°C.
-
Compressibility factor
Implements API MPMS 11.2.1 directly rather than reading a grid, so it accepts any input instead of the 0.5-step increments a printed page allows, across the full 0 to 90 degree API range.
-
Meter calibration factor
The inverse operation for calibration technicians: corrected API and product temperature give the correction factor, with density and pounds per gallon at that temperature.
-
Unit converter
Volume, weight, temperature, and length, plus a density-bridged converter between volume and mass.
-
Saved records
Calculations can be tagged with a tank or cart number and stored on the device, so a field reading survives until it reaches the paper form.
The calculation
-
Iterative convergence
Standard density is needed to find the thermal expansion coefficient, but the coefficient is needed to find standard density. ASTM resolves the circularity by iterating to a tolerance rather than making a single pass, and so does this.
-
Constants selected inside the loop
The K₀ and K₁ coefficients differ by fuel class. Selecting them inside the iteration means a density that crosses a class boundary during convergence still lands on the right constants.
-
Real 6B constants
The constants referenced to 60°F are the 15°C constants scaled by 5/9. An earlier version bridged the two references with an empirical fudge factor. It fitted the data but could not be defended, so it was removed.
-
Fuel type detection
Gasolines, transition, jet fuels and kerosene, or diesels, identified from the corrected API range.
How it is built
The app keeps an MVVM-style separation adapted to React Native conventions. Pure calculation and persistence live in /utils and /storage with no state and no interface. Custom hooks in /hooks take the ViewModel role, holding state, input parsing, validation, and orchestration. Screens and components are JSX only.
The unit converter is where that separation earns its keep: volume, weight, and length all run through one useUnitConverter hook driven by a unit table, so adding a category means adding a table rather than a screen.
Navigation is a custom drawer built on React Native's own Animated API. The usual choice, react-native-reanimated, kept producing TurboModule errors against the new Android architecture, so the dependency was dropped in favour of about eighty lines of first-party code.
Scope and limits
- 44–47° API range validated against instruments — jet fuel only
- Android iOS build waits on Apple Developer enrolment
- Diesel and AVGAS bands have not been checked against physical instruments, and I would not claim them until they have been.
- No fuel specification limits yet — density, flash point, and freeze point per ASTM D1655, D975, and D4814 are on the list but not in the app.
- No PDF export for shift handover yet.
The calculations are an engineering aid. They are not to be used as the sole basis for custody transfer, billing, or any safety-critical decision.
What I took from it
In engineering software, the physics is the test suite. Twice the code ran cleanly, looked right, and was wrong. Both times what caught it was a number that felt off to someone who had stood next to the hydrometer. Unit tests would have passed.