Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add concentration units (mixtures/solutions) #646

Merged
merged 10 commits into from
Apr 21, 2019
246 changes: 246 additions & 0 deletions Common/UnitDefinitions/MassConcentration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
{
"Name": "MassConcentration",
"BaseUnit": "KilogramPerCubicMeter",
"XmlDoc": "In chemistry, the mass concentration ρi (or γi) is defined as the mass of a constituent mi divided by the volume of the mixture V",
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Mass_concentration_(chemistry)",
"BaseDimensions": {
"L": -3,
"M": 1
},
"Units": [
{
"SingularName": "GramPerCubicMillimeter",
"PluralName": "GramsPerCubicMillimeter",
"BaseUnits": {
"L": "Millimeter",
"M": "Gram"
},
"FromUnitToBaseFunc": "x/1e-6",
"FromBaseToUnitFunc": "x*1e-6",
"Prefixes": [ "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/mm³" ]
}
]
},
{
"SingularName": "GramPerCubicCentimeter",
"PluralName": "GramsPerCubicCentimeter",
"BaseUnits": {
"L": "Centimeter",
"M": "Gram"
},
"FromUnitToBaseFunc": "x/1e-3",
"FromBaseToUnitFunc": "x*1e-3",
"Prefixes": [ "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/cm³" ]
}
]
},
{
"SingularName": "GramPerCubicMeter",
"PluralName": "GramsPerCubicMeter",
"BaseUnits": {
"L": "Meter",
"M": "Gram"
},
"FromUnitToBaseFunc": "x/1e3",
"FromBaseToUnitFunc": "x*1e3",
"Prefixes": [ "Kilo", "Milli", "Micro" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/m³" ]
},
{
"Culture": "ru-RU",
"Abbreviations": [ "г/м³" ]
}
]
},
{
"SingularName": "PoundPerCubicInch",
"PluralName": "PoundsPerCubicInch",
"BaseUnits": {
"L": "Inch",
"M": "Pound"
},
"FromUnitToBaseFunc": "x/3.6127298147753e-5",
"FromBaseToUnitFunc": "x*3.6127298147753e-5",
"Prefixes": [ "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "lb/in³" ],
"AbbreviationsWithPrefixes": [ "kip/in³" ]
}
]
},
{
"SingularName": "PoundPerCubicFoot",
"PluralName": "PoundsPerCubicFoot",
"BaseUnits": {
"L": "Foot",
"M": "Pound"
},
"FromUnitToBaseFunc": "x/0.062427961",
"FromBaseToUnitFunc": "x*0.062427961",
"Prefixes": [ "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "lb/ft³" ],
"AbbreviationsWithPrefixes": [ "kip/ft³" ]
}
]
},
{
"SingularName": "TonnePerCubicMillimeter",
"PluralName": "TonnesPerCubicMillimeter",
"BaseUnits": {
"L": "Millimeter",
"M": "Tonne"
},
"FromUnitToBaseFunc": "x/1e-12",
"FromBaseToUnitFunc": "x*1e-12",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "t/mm³" ]
}
]
},
{
"SingularName": "TonnePerCubicCentimeter",
"PluralName": "TonnesPerCubicCentimeter",
"BaseUnits": {
"L": "Centimeter",
"M": "Tonne"
},
"FromUnitToBaseFunc": "x/1e-9",
"FromBaseToUnitFunc": "x*1e-9",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "t/cm³" ]
}
]
},
{
"SingularName": "TonnePerCubicMeter",
"PluralName": "TonnesPerCubicMeter",
"BaseUnits": {
"L": "Meter",
"M": "Tonne"
},
"FromUnitToBaseFunc": "x/0.001",
"FromBaseToUnitFunc": "x*0.001",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "t/m³" ]
}
]
},
{
"SingularName": "SlugPerCubicFoot",
"PluralName": "SlugsPerCubicFoot",
"BaseUnits": {
"L": "Foot",
"M": "Slug"
},
"FromUnitToBaseFunc": "x*515.378818",
"FromBaseToUnitFunc": "x*0.00194032033",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "slug/ft³" ]
}
]
},
{
"SingularName": "GramPerLiter",
"PluralName": "GramsPerLiter",
"FromUnitToBaseFunc": "x/1",
angularsen marked this conversation as resolved.
Show resolved Hide resolved
lipchev marked this conversation as resolved.
Show resolved Hide resolved
"FromBaseToUnitFunc": "x*1",
"Prefixes": [ "Pico", "Nano", "Micro", "Milli", "Centi", "Deci" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/l"]
lipchev marked this conversation as resolved.
Show resolved Hide resolved
}
]
},
{
"SingularName": "GramPerDeciliter",
"PluralName": "GramsPerDeciLiter",
"FromUnitToBaseFunc": "x/1e-1",
"FromBaseToUnitFunc": "x*1e-1",
"Prefixes": [ "Pico", "Nano", "Micro", "Milli", "Centi", "Deci" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/dl" ]
lipchev marked this conversation as resolved.
Show resolved Hide resolved
}
]
},
{
"SingularName": "GramPerMilliliter",
"PluralName": "GramsPerMilliliter",
"FromUnitToBaseFunc": "x/1e-3",
"FromBaseToUnitFunc": "x*1e-3",
"Prefixes": [ "Pico", "Nano", "Micro", "Milli", "Centi", "Deci" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/ml" ]
}
]
},
{
"SingularName": "PoundPerUSGallon",
"PluralName": "PoundsPerUSGallon",
"FromUnitToBaseFunc": "x*1.19826427e2",
"FromBaseToUnitFunc": "x/1.19826427e2",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "ppg (U.S.)" ]
lipchev marked this conversation as resolved.
Show resolved Hide resolved
}
]
},
{
"SingularName": "PoundPerImperialGallon",
"PluralName": "PoundsPerImperialGallon",
"FromUnitToBaseFunc": "x*9.9776398e1",
"FromBaseToUnitFunc": "x/9.9776398e1",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "ppg (imp.)" ]
}
]
},
{
"SingularName": "KilogramPerLiter",
"PluralName": "KilogramsPerLiter",
"BaseUnits": {
"L": "Decimeter",
"M": "Kilogram"
},
"FromUnitToBaseFunc": "x*1e3",
"FromBaseToUnitFunc": "x/1e3",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "kg/l" ]
}
]
}
]
}
106 changes: 106 additions & 0 deletions Common/UnitDefinitions/MassFraction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"Name": "MassFraction",
lipchev marked this conversation as resolved.
Show resolved Hide resolved
"BaseUnit": "DecimalFraction",
"XmlDoc": "The mass fraction is defined as the mass of a constituent divided by the total mass of the mixture.",
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Mass_fraction_(chemistry)",
"Units": [
{
"SingularName": "DecimalFraction",
"PluralName": "DecimalFractions",
"FromUnitToBaseFunc": "x",
"FromBaseToUnitFunc": "x",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "" ]
}
]
},
{
"SingularName": "GramPerGram",
"PluralName": "GramsPerGram",
"FromUnitToBaseFunc": "x",
"FromBaseToUnitFunc": "x",
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Deca", "Hecto", "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/g" ]
}
]
},
{
"SingularName": "GramPerKiloGram",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PerKilogram

"PluralName": "GramsPerKiloGram",
"FromUnitToBaseFunc": "x/1e3",
"FromBaseToUnitFunc": "x*1e3",
"Prefixes": [ "Nano", "Micro", "Milli", "Centi", "Deci", "Deca", "Hecto", "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/kg" ]
}
]
},
{
"SingularName": "Percent",
"PluralName": "Percent",
"FromUnitToBaseFunc": "x/1e2",
"FromBaseToUnitFunc": "x*1e2",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "%", "% (w/w)" ]
}
]
},
{
"SingularName": "PartPerThousand",
"PluralName": "PartsPerThousand",
"FromUnitToBaseFunc": "x/1e3",
"FromBaseToUnitFunc": "x*1e3",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "‰" ]
}
]
},
{
"SingularName": "PartPerMillion",
"PluralName": "PartsPerMillion",
"FromUnitToBaseFunc": "x/1e6",
"FromBaseToUnitFunc": "x*1e6",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "ppm" ]
}
]
},
{
"SingularName": "PartPerBillion",
"PluralName": "PartsPerBillion",
"FromUnitToBaseFunc": "x/1e9",
"FromBaseToUnitFunc": "x*1e9",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "ppb" ]
}
]
},
{
"SingularName": "PartPerTrillion",
"PluralName": "PartsPerTrillion",
"FromUnitToBaseFunc": "x/1e12",
"FromBaseToUnitFunc": "x*1e12",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "ppt" ]
}
]
}
]
}
15 changes: 14 additions & 1 deletion Common/UnitDefinitions/Molarity.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,20 @@
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "mol/L" ]
"Abbreviations": [ "mol/L"]
}
]
},
{
"SingularName": "Molar",
angularsen marked this conversation as resolved.
Show resolved Hide resolved
"PluralName": "Molar",
"FromUnitToBaseFunc": "x/1e-3",
"FromBaseToUnitFunc": "x*1e-3",
"Prefixes": [ "Pico", "Nano", "Micro", "Milli"],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "M"]
}
]
}
Expand Down
Loading