Hacker News new | ask | show | jobs
by dredmorbius 1501 days ago
GNU Units has builtins for some standard energy equivalent units, specifically "tonoil" and "barreloil". "litreoil" doesn't seem to be included by default (though it can be added via a local configuration file).

    literoil = 1 barreloil * liter/barrel
And the calculation gives me ...10.69 kWh/L

The barreloil value is for crude, diesel may have a slightly higher net energy density. But we're good to 3 sig figs.

I could have bypassed the tonoil step and calculated thermal energy in barreloil directly though saving another conversion.

Otherwise I'd have to remember energy density/L of diesel fuel.

I've added the definitions for litre, pound, and kg oil and can now run:

  $ units --terse '40 MWh/30%' literoil
  12470.969
The fun part though, at least for me, is showing how to do conversions with GNU units, and the equivalences which become apparent doing so.
1 comments

I looked around a bit in "definitions.units" and there are actually energy densities in there for various fuel sources, including diesel.

  You have: 1 diesel
  You want: Wh/L
   1 diesel = 10103.465 Wh/L
Slightly different value than in Wikipedia, but close enough.
*blink*

TIL, there are!

Thanks.

(For the curious, the definitions file is ~7500 lines, there's a lot in there. GNU version. For those on MacOS, the stock BSD units offers far less.)