Merge pull request #13620 from vvlladd28/improvement/unit/mmbtu

Add new units definition MBtu, MMBtu and BTU/d
This commit is contained in:
Igor Kulikov 2025-06-20 18:39:50 +03:00 committed by GitHub
commit bbeb87b7ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 75 additions and 10 deletions

View File

@ -33,7 +33,7 @@ export type EnergyMetricUnits =
| 'GJ' | 'GJ'
| 'eV'; | 'eV';
export type EnergyImperialUnits = 'kcal' | 'cal' | 'Cal' | 'BTU' | 'ft·lb' | 'thm'; export type EnergyImperialUnits = 'kcal' | 'cal' | 'Cal' | 'BTU' | 'MBtu' | 'MMBtu' | 'ft·lb' | 'thm';
const METRIC: TbMeasureUnits<EnergyMetricUnits> = { const METRIC: TbMeasureUnits<EnergyMetricUnits> = {
ratio: 1 / 4.184, ratio: 1 / 4.184,
@ -117,7 +117,17 @@ const IMPERIAL: TbMeasureUnits<EnergyImperialUnits> = {
BTU: { BTU: {
name: 'unit.british-thermal-unit', name: 'unit.british-thermal-unit',
tags: ['heat', 'work done'], tags: ['heat', 'work done'],
to_anchor: 252.164401, to_anchor: 252.1644007218,
},
MBtu: {
name: 'unit.thousand-british-thermal-unit',
tags: ['heat', 'work done'],
to_anchor: 252164.4007218,
},
MMBtu : {
name: 'unit.million-british-thermal-unit',
tags: ['heat', 'work done'],
to_anchor: 252164400.7218,
}, },
'ft·lb': { 'ft·lb': {
name: 'unit.foot-pound', name: 'unit.foot-pound',

View File

@ -19,7 +19,18 @@ import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type PowerUnits = PowerMetricUnits | PowerImperialUnits; export type PowerUnits = PowerMetricUnits | PowerImperialUnits;
export type PowerMetricUnits = 'W' | 'μW' | 'mW' | 'kW' | 'MW' | 'GW' | 'PS'; export type PowerMetricUnits = 'W' | 'μW' | 'mW' | 'kW' | 'MW' | 'GW' | 'PS';
export type PowerImperialUnits = 'BTU/s' | 'ft-lb/s' | 'hp' | 'BTU/h'; export type PowerImperialUnits =
| 'ft-lb/s'
| 'hp'
| 'BTU/s'
| 'BTU/h'
| 'BTU/d'
| 'MBtu/s'
| 'MBtu/h'
| 'MBtu/d'
| 'MMBtu/s'
| 'MMBtu/h'
| 'MMBtu/d';
const METRIC: TbMeasureUnits<PowerMetricUnits> = { const METRIC: TbMeasureUnits<PowerMetricUnits> = {
ratio: 0.737562149, ratio: 0.737562149,
@ -65,11 +76,6 @@ const METRIC: TbMeasureUnits<PowerMetricUnits> = {
const IMPERIAL: TbMeasureUnits<PowerImperialUnits> = { const IMPERIAL: TbMeasureUnits<PowerImperialUnits> = {
ratio: 1 / 0.737562149, ratio: 1 / 0.737562149,
units: { units: {
'BTU/s': {
name: 'unit.btu-per-second',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 778.16937,
},
'ft-lb/s': { 'ft-lb/s': {
name: 'unit.foot-pound-per-second', name: 'unit.foot-pound-per-second',
tags: ['mechanical power'], tags: ['mechanical power'],
@ -80,11 +86,51 @@ const IMPERIAL: TbMeasureUnits<PowerImperialUnits> = {
tags: ['performance', 'electricity'], tags: ['performance', 'electricity'],
to_anchor: 550, to_anchor: 550,
}, },
'BTU/s': {
name: 'unit.btu-per-second',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 778.16937,
},
'BTU/h': { 'BTU/h': {
name: 'unit.btu-per-hour', name: 'unit.btu-per-hour',
tags: ['heat transfer', 'thermal energy', 'HVAC'], tags: ['heat transfer', 'thermal energy', 'HVAC'],
to_anchor: 0.216158, to_anchor: 0.216158,
}, },
'BTU/d': {
name: 'unit.btu-per-day',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 0.00900613,
},
'MBtu/s': {
name: 'unit.btu-per-second',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 778169.37,
},
'MBtu/h': {
name: 'unit.btu-per-hour',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 216.158,
},
'MBtu/d': {
name: 'unit.btu-per-day',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 9.00613,
},
'MMBtu/s': {
name: 'unit.btu-per-second',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 778169370,
},
'MMBtu/h': {
name: 'unit.btu-per-hour',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 216158,
},
'MMBtu/d': {
name: 'unit.btu-per-day',
tags: ['heat transfer', 'thermal energy'],
to_anchor: 9006.13,
},
}, },
}; };

View File

@ -6124,6 +6124,8 @@
"electron-volts": "Electron volts", "electron-volts": "Electron volts",
"joules-per-coulomb": "Joules per Coulomb", "joules-per-coulomb": "Joules per Coulomb",
"british-thermal-unit": "British Thermal Units", "british-thermal-unit": "British Thermal Units",
"thousand-british-thermal-unit": "Thousand British Thermal Units",
"million-british-thermal-unit": "Million British Thermal Units",
"foot-pound": "Foot-pound", "foot-pound": "Foot-pound",
"calorie": "Calorie", "calorie": "Calorie",
"small-calorie": "Small Calorie", "small-calorie": "Small Calorie",
@ -6154,8 +6156,15 @@
"watt-per-square-inch": "Watts per square inch", "watt-per-square-inch": "Watts per square inch",
"kilowatt-per-square-inch": "Kilowatts per square inch", "kilowatt-per-square-inch": "Kilowatts per square inch",
"horsepower": "Horsepower", "horsepower": "Horsepower",
"btu-per-hour": "British thermal units/hour", "btu-per-hour": "British thermal units per hour",
"btu-per-second": "British thermal units/second", "btu-per-second": "British thermal units per second",
"btu-per-day": "British thermal units per day",
"mbtu-per-hour": "Thousand British thermal units per hour",
"mbtu-per-second": "Thousand British thermal units per second",
"mbtu-per-day": "Thousand British thermal units per day",
"mmbtu-per-hour": "Million British thermal units per hour",
"mmbtu-per-second": "Million British thermal units per second",
"mmbtu-per-day": "Million British thermal units per day",
"foot-pound-per-second": "foot-pound per second", "foot-pound-per-second": "foot-pound per second",
"coulomb": "Coulomb", "coulomb": "Coulomb",
"millicoulomb": "Millicoulombs", "millicoulomb": "Millicoulombs",