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.
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:
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.