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
238 changes: 238 additions & 0 deletions Common/UnitDefinitions/MassConcentration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
{
"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": {
"M": 1,
"L": -3
},
"Units": [
{
"SingularName": "GramPerCubicMillimeter",
"PluralName": "GramsPerCubicMillimeter",
"BaseUnits": {
"M": "Gram",
"L": "Millimeter"
},
"FromUnitToBaseFunc": "x/1e-6",
"FromBaseToUnitFunc": "x*1e-6",
"Prefixes": [ "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/mm³" ]
}
]
},
{
"SingularName": "GramPerCubicCentimeter",
"PluralName": "GramsPerCubicCentimeter",
"BaseUnits": {
"M": "Gram",
"L": "Centimeter"
},
"FromUnitToBaseFunc": "x/1e-3",
"FromBaseToUnitFunc": "x*1e-3",
"Prefixes": [ "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/cm³" ]
}
]
},
{
"SingularName": "GramPerCubicMeter",
"PluralName": "GramsPerCubicMeter",
"BaseUnits": {
"M": "Gram",
"L": "Meter"
},
"FromUnitToBaseFunc": "x/1e3",
"FromBaseToUnitFunc": "x*1e3",
"Prefixes": [ "Kilo", "Milli", "Micro" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/m³" ]
},
{
"Culture": "ru-RU",
"Abbreviations": [ "г/м³" ]
}
]
},
{
"SingularName": "GramPerMilliliter",
"PluralName": "GramsPerMilliliter",
"BaseUnits": {
"M": "Gram",
angularsen marked this conversation as resolved.
Show resolved Hide resolved
"L": "Centimeter"
},
"FromUnitToBaseFunc": "x/1e-3",
"FromBaseToUnitFunc": "x*1e-3",
"Prefixes": [ "Pico", "Nano", "Micro", "Milli", "Centi", "Deci" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/mL" ]
}
]
},
{
"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" ]
}
]
},
{
"SingularName": "GramPerLiter",
"PluralName": "GramsPerLiter",
"BaseUnits": {
"M": "Gram",
"L": "Decimeter"
},
"FromUnitToBaseFunc": "x",
"FromBaseToUnitFunc": "x",
"Prefixes": [ "Pico", "Nano", "Micro", "Milli", "Centi", "Deci", "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "g/L"]
}
]
},
{
"SingularName": "TonnePerCubicMillimeter",
"PluralName": "TonnesPerCubicMillimeter",
"BaseUnits": {
"M": "Tonne",
"L": "Millimeter"
},
"FromUnitToBaseFunc": "x/1e-12",
"FromBaseToUnitFunc": "x*1e-12",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "t/mm³" ]
}
]
},
{
"SingularName": "TonnePerCubicCentimeter",
"PluralName": "TonnesPerCubicCentimeter",
"BaseUnits": {
"M": "Tonne",
"L": "Centimeter"
},
"FromUnitToBaseFunc": "x/1e-9",
"FromBaseToUnitFunc": "x*1e-9",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "t/cm³" ]
}
]
},
{
"SingularName": "TonnePerCubicMeter",
"PluralName": "TonnesPerCubicMeter",
"BaseUnits": {
"M": "Tonne",
"L": "Meter"
},
"FromUnitToBaseFunc": "x/0.001",
"FromBaseToUnitFunc": "x*0.001",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "t/m³" ]
}
]
},
{
"SingularName": "PoundPerCubicInch",
"PluralName": "PoundsPerCubicInch",
"BaseUnits": {
"M": "Pound",
"L": "Inch"
},
"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": {
"M": "Pound",
"L": "Foot"
},
"FromUnitToBaseFunc": "x/0.062427961",
"FromBaseToUnitFunc": "x*0.062427961",
"Prefixes": [ "Kilo" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "lb/ft³" ],
"AbbreviationsWithPrefixes": [ "kip/ft³" ]
}
]
},
{
"SingularName": "SlugPerCubicFoot",
"PluralName": "SlugsPerCubicFoot",
"BaseUnits": {
"M": "Slug",
"L": "Foot"
},
"FromUnitToBaseFunc": "x*515.378818",
"FromBaseToUnitFunc": "x*0.00194032033",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "slug/ft³" ]
}
]
},
{
"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.)" ]
}
]
}
]
}
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",
"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" ]
}
]
}
]
}
10 changes: 9 additions & 1 deletion Common/UnitDefinitions/Molarity.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
{
"SingularName": "MolesPerCubicMeter",
"PluralName": "MolesPerCubicMeter",
"BaseUnits": {
"L": "Meter",
"N": "Mole"
},
"FromUnitToBaseFunc": "x",
"FromBaseToUnitFunc": "x",
"Prefixes": [],
Expand All @@ -24,13 +28,17 @@
{
"SingularName": "MolesPerLiter",
"PluralName": "MolesPerLiter",
"BaseUnits": {
"L": "Decimeter",
"N": "Mole"
},
"FromUnitToBaseFunc": "x/1e-3",
"FromBaseToUnitFunc": "x*1e-3",
"Prefixes": [ "Pico", "Nano", "Micro", "Milli", "Centi", "Deci" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "mol/L" ]
"Abbreviations": [ "mol/L", "M"]
}
]
}
Expand Down
Loading