2
Vote

Density on lbs/gal

description

The density calculation on lbs/gal is off by a significant amount. Line 89 of Source\Units\Quantities\Density.cs needs updated from 99.7763287677 to 119.826427, plus whatever the rest of the digits are for 10 decimal accuracy.

comments

objo wrote Feb 23, 2014 at 7:10 PM

Currently it is defined as the imperial lbs/gal. But I see there is an inconsistency since gallon is defined as US fluid. This raises an important question, which units should be defined in the default unit system - the imperial, US fluid or US dry? Only one lbs/gal can be selected by the parser (I think it is the first one). From the code side, it should be no problem to have more lbs/gal definitions.

In units.csv, I suggest to change to
Density,KilogramPerCubicMetre,kg/m^3,1
Density,KilogramPerCubicDecimetre,kg/dm^3,1000
Density,GramPerCubicCentietre,g/cm^3,1000
Density,KilogramPerLitre,kg/L,1000
Density,GramPerMillilitre,g/mL,1000
Density,OuncePerCubicFoot,oz/ft^3,1.001153961
Density,OuncePerCubicInch,oz/in^3,1.729994044
Density,OuncePerImperialGallon,oz/gal,6.236023291
Density,OuncePerUSFluidGallon,oz/gal,7.489151707
Density,PoundPerCubicFoot,lb/ft^3,16.01846337396
Density,PoundPerCubicInch,lb/in^3,27679.9047102031
Density,PoundPerImperialGallon,lb/gal,99.7763287677
Density,PoundPerUSFluidGallon,lb/gal,119.8264273
Density,SlugPerCubicFoot,slug/ft^3,515.3788184
which should make the imperial units default. Or we could change the order to make US fluid units default.
To change the default units for your application, you need to register the units you want with a UnitProvider.

objo wrote Aug 29, 2014 at 6:33 AM