Base: add VolExpansionCoeff and complete KinematicViscosity unit

This commit is contained in:
qingfengxia
2020-05-23 00:03:09 +02:00
committed by Bernd Hahnebach
parent 6074ffa69a
commit 5da01ab8b0
4 changed files with 43 additions and 6 deletions

View File

@@ -203,6 +203,16 @@ QString UnitsSchemaMKS::schemaTranslate(const Quantity &quant, double &factor, Q
factor = 1.0;
}
}
else if (unit == Unit::VolumetricThermalExpansionCoefficient) {
if (UnitValue < 0.001) {
unitString = QString::fromUtf8("mm^3/m^3/K");
factor = 1e-9;
}
else {
unitString = QString::fromLatin1("m^3/m^3/K");
factor = 1.0;
}
}
else if (unit == Unit::SpecificHeat) {
unitString = QString::fromLatin1("J/kg/K");
factor = 1000000.0;
@@ -423,6 +433,10 @@ QString UnitsSchemaMKS::schemaTranslate(const Quantity &quant, double &factor, Q
unitString = QString::fromLatin1("kg/(m*s)");
factor = 0.001;
}
else if (unit == Unit::KinematicViscosity) {
unitString = QString::fromLatin1("m^2/s)");
factor = 1e6;
}
else {
// default action for all cases without special treatment:
unitString = quant.getUnit().getString();