Commit 42205dc
authored
Add pound per pound-mole molar mass (#1703)
## Motivation
Fixes #1668.
`PoundPerMole` currently means pound mass per SI mole, `lb/mol`. That is
a valid unit and I don't think we should silently redefine it.
The issue is that engineering and manufacturing users often need
molecular weight in English Engineering units, where the common unit is
pound mass per pound-mole, `lb/lbmol`. That should be numerically equal
to `kg/kmol`, but it is not the same as `lb/mol`.
## Changes
- Add `MolarMassUnit.PoundPerPoundMole` with `lb/lbmol` and `lbm/lbmol`
abbreviations.
- Use `Pound` and the existing `PoundMole` amount-of-substance unit as
base units.
- Keep `PoundPerMole` unchanged, but document that it means pound mass
per SI mole.
- Regenerate UnitsNet and number-extension APIs.
- Add tests showing `lb/lbmol` matches `kg/kmol` and remains distinct
from `lb/mol`.
## Validation
- `generate-code.bat`
- `dotnet test UnitsNet.Tests --filter
"FullyQualifiedName~UnitsNet.Tests.CustomCode.MolarMassTests"`1 parent 29feec4 commit 42205dc
12 files changed
Lines changed: 130 additions & 2 deletions
File tree
- Common
- UnitDefinitions
- UnitsNet.NumberExtensions.CS14.Tests/GeneratedCode
- UnitsNet.NumberExtensions.CS14/GeneratedCode
- UnitsNet.NumberExtensions.Tests/GeneratedCode
- UnitsNet.NumberExtensions/GeneratedCode
- UnitsNet.Tests
- CustomCode
- GeneratedCode
- TestsBase
- UnitsNet/GeneratedCode
- Quantities
- Resources
- Units
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
67 | 86 | | |
68 | 87 | | |
69 | 88 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1055 | 1055 | | |
1056 | 1056 | | |
1057 | 1057 | | |
1058 | | - | |
| 1058 | + | |
| 1059 | + | |
1059 | 1060 | | |
1060 | 1061 | | |
1061 | 1062 | | |
| |||
Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
46 | 70 | | |
47 | 71 | | |
48 | 72 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments