浏览代码

2 new heat energy units 'therm' and 'thermie' added

mugheesqasim-hk 1 年之前
父节点
当前提交
c45eaa7cf4
共有 3 个文件被更改,包括 14 次插入0 次删除
  1. 2 0
      book/src/list-units.md
  2. 2 0
      examples/tests/unit_consistency_misc.nbt
  3. 10 0
      numbat/modules/units/misc.nbt

+ 2 - 0
book/src/list-units.md

@@ -41,6 +41,8 @@ and — where sensible — units allow for [binary prefixes](https://en.wikipedi
 | `ElectricResistance` | [Ohm](https://en.wikipedia.org/wiki/Ohm) | `ohm`, `ohms`, `Ω`, `Ω` |
 | `Energy` | [British thermal unit](https://en.wikipedia.org/wiki/British_thermal_unit) | `BTU`, `Btu` |
 | `Energy` | [Calorie](https://en.wikipedia.org/wiki/Calorie) | `cal`, `calorie`, `calories` |
+| `Energy` | [Therm](https://en.wikipedia.org/wiki/Therm) | `thm`, `therm`, `therms` |
+| `Energy` | [Thermie](https://en.wikipedia.org/wiki/Thermie) | `th`, `thermie`, `thermies` |
 | `Energy` | [Electron volt](https://en.wikipedia.org/wiki/Electronvolt) | `electronvolt`, `electronvolts`, `eV` |
 | `Energy` | [Erg](https://en.wikipedia.org/wiki/Erg) | `erg`, `ergs` |
 | `Energy` | [Hartree](https://en.wikipedia.org/wiki/Hartree) | `hartree`, `hartrees` |

+ 2 - 0
examples/tests/unit_consistency_misc.nbt

@@ -62,6 +62,8 @@ assert_eq(8e-15, 8 ppq, 1e-16)
 
 assert_eq(1 calorie, 4.184 J)
 assert_eq(1 BTU, 1055.05585262 J)
+assert_eq(1 therm, 1.05506e8 J)
+assert_eq(1 thermie, 4.1868e6 J)
 assert_eq(1 lbf, 4.448222 N)
 assert_eq(1 ozf, (4.448222 / 16.0) N, 1e-5 N)
 assert_eq(60 RPM, 1 Hz)

+ 10 - 0
numbat/modules/units/misc.nbt

@@ -30,6 +30,16 @@ unit calorie: Energy = 4.184 joule
 @aliases(Btu)
 unit BTU: Energy = 1055.05585262 joule
 
+@name("Therm")
+@url("https://en.wikipedia.org/wiki/Therm")
+@aliases(therms, thm : short)
+unit therm: Energy = 1.05506e8 joule
+
+@name("Thermie")
+@url("https://en.wikipedia.org/wiki/Thermie")
+@aliases(thermies, th : short)
+unit thermie: Energy = 4.1868e6 joule
+
 @name("Pound-force")
 @url("https://en.wikipedia.org/wiki/Pound_(force)")
 @aliases(lbf: short)