Skip to content

Commit 190bbf0

Browse files
tmilnthorpangularsen
authored andcommitted
Imperial units (#645)
* Adding BTU/lb·°F for SpecificEntropy * Adding reyn, lbf·s/in², and lbf·s/ft² to DynamicViscosity * Adding S/in and S/ft to ElectricConductivity
1 parent 5012caa commit 190bbf0

20 files changed

+313
-1
lines changed

Common/UnitDefinitions/DynamicViscosity.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,42 @@
4646
"Abbreviations": [ "P" ]
4747
}
4848
]
49+
},
50+
{
51+
"SingularName": "Reyn",
52+
"PluralName": "Reyns",
53+
"FromUnitToBaseFunc": "x * 6.8947572931683613e3",
54+
"FromBaseToUnitFunc": "x / 6.8947572931683613e3",
55+
"Localization": [
56+
{
57+
"Culture": "en-US",
58+
"Abbreviations": [ "reyn" ]
59+
}
60+
]
61+
},
62+
{
63+
"SingularName": "PoundForceSecondPerSquareInch",
64+
"PluralName": "PoundsForceSecondPerSquareInch",
65+
"FromUnitToBaseFunc": "x * 6.8947572931683613e3",
66+
"FromBaseToUnitFunc": "x / 6.8947572931683613e3",
67+
"Localization": [
68+
{
69+
"Culture": "en-US",
70+
"Abbreviations": [ "lbf·s/in²" ]
71+
}
72+
]
73+
},
74+
{
75+
"SingularName": "PoundForceSecondPerSquareFoot",
76+
"PluralName": "PoundsForceSecondPerSquareFoot",
77+
"FromUnitToBaseFunc": "x * 4.7880258980335843e1",
78+
"FromBaseToUnitFunc": "x / 4.7880258980335843e1",
79+
"Localization": [
80+
{
81+
"Culture": "en-US",
82+
"Abbreviations": [ "lbf·s/ft²" ]
83+
}
84+
]
4985
}
5086
]
5187
}

Common/UnitDefinitions/ElectricConductivity.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
{
1414
"SingularName": "SiemensPerMeter",
1515
"PluralName": "SiemensPerMeter",
16+
"BaseUnits": {
17+
"L": "Meter",
18+
"M": "Kilogram",
19+
"T": "Second",
20+
"I": "Ampere"
21+
},
1622
"FromUnitToBaseFunc": "x",
1723
"FromBaseToUnitFunc": "x",
1824
"Localization": [
@@ -21,6 +27,30 @@
2127
"Abbreviations": [ "S/m" ]
2228
}
2329
]
30+
},
31+
{
32+
"SingularName": "SiemensPerInch",
33+
"PluralName": "SiemensPerInch",
34+
"FromUnitToBaseFunc": "x * 3.937007874015748e1",
35+
"FromBaseToUnitFunc": "x / 3.937007874015748e1",
36+
"Localization": [
37+
{
38+
"Culture": "en-US",
39+
"Abbreviations": [ "S/in" ]
40+
}
41+
]
42+
},
43+
{
44+
"SingularName": "SiemensPerFoot",
45+
"PluralName": "SiemensPerFoot",
46+
"FromUnitToBaseFunc": "x * 3.2808398950131234",
47+
"FromBaseToUnitFunc": "x / 3.2808398950131234",
48+
"Localization": [
49+
{
50+
"Culture": "en-US",
51+
"Abbreviations": [ "S/ft" ]
52+
}
53+
]
2454
}
2555
]
2656
}

Common/UnitDefinitions/SpecificEntropy.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@
4646
"Abbreviations": [ "cal/g.K" ]
4747
}
4848
]
49+
},
50+
{
51+
"SingularName": "BtuPerPoundFahrenheit",
52+
"PluralName": "BtusPerPoundFahrenheit",
53+
"FromUnitToBaseFunc": "x * 4.1868e3",
54+
"FromBaseToUnitFunc": "x / 4.1868e3",
55+
"Localization": [
56+
{
57+
"Culture": "en-US",
58+
"Abbreviations": [ "BTU/lb·°F", "BTU/lbm·°F" ]
59+
}
60+
]
4961
}
5062
]
5163
}

UnitsNet.Tests/CustomCode/DynamicViscosityTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public class DynamicViscosityTests : DynamicViscosityTestsBase
1414
protected override double NewtonSecondsPerMeterSquaredInOneNewtonSecondPerMeterSquared => 1;
1515
protected override double PascalSecondsInOneNewtonSecondPerMeterSquared => 1;
1616
protected override double PoiseInOneNewtonSecondPerMeterSquared => 10;
17+
protected override double ReynsInOneNewtonSecondPerMeterSquared => 1.4503773773020922e-4;
18+
protected override double PoundsForceSecondPerSquareInchInOneNewtonSecondPerMeterSquared => 1.4503773773020922e-4;
19+
protected override double PoundsForceSecondPerSquareFootInOneNewtonSecondPerMeterSquared => 2.0885434233150127e-2;
1720

1821
[Fact]
1922
public static void DynamicViscosityDividedByDensityEqualsKinematicViscosity()

UnitsNet.Tests/CustomCode/ElectricConductivityTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@ namespace UnitsNet.Tests.CustomCode
2828
public class ElectricConductivityTests : ElectricConductivityTestsBase
2929
{
3030
protected override double SiemensPerMeterInOneSiemensPerMeter => 1;
31+
protected override double SiemensPerInchInOneSiemensPerMeter => 2.54e-2;
32+
protected override double SiemensPerFootInOneSiemensPerMeter => 3.048e-1;
3133
}
3234
}

UnitsNet.Tests/CustomCode/SpecificEntropyTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ public class SpecificEntropyTests : SpecificEntropyTestsBase
3535
protected override double MegajoulesPerKilogramKelvinInOneJoulePerKilogramKelvin => 1e-6;
3636
protected override double CaloriesPerGramKelvinInOneJoulePerKilogramKelvin => 2.390057e-4;
3737
protected override double KilocaloriesPerGramKelvinInOneJoulePerKilogramKelvin => 2.390057e-7;
38+
protected override double BtusPerPoundFahrenheitInOneJoulePerKilogramKelvin => 2.3884589662749594e-4;
3839
}
3940
}

UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.WindowsRuntimeComponent/GeneratedCode/UnitAbbreviationsCache.g.cs

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)