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 3725a78124
commit c6364c823a
4 changed files with 43 additions and 6 deletions

View File

@@ -161,7 +161,7 @@ QString UnitsSchemaInternal::schemaTranslate(const Quantity &quant, double &fact
else if (unit == Unit::ThermalConductivity) {
if (UnitValue > 1000000) {
unitString = QString::fromLatin1("W/mm/K");
factor = 1000000.0;
factor = 1e6;
}
else {
unitString = QString::fromLatin1("W/m/K");
@@ -170,7 +170,7 @@ QString UnitsSchemaInternal::schemaTranslate(const Quantity &quant, double &fact
}
else if (unit == Unit::ThermalExpansionCoefficient) {
if (UnitValue < 0.001) {
unitString = QString::fromUtf8("\xC2\xB5m/m/K");
unitString = QString::fromUtf8("\xC2\xB5m/m/K"); // micro-meter/meter/K
factor = 0.000001;
}
else {
@@ -178,9 +178,19 @@ QString UnitsSchemaInternal::schemaTranslate(const Quantity &quant, double &fact
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;
factor = 1e6;
}
else if (unit == Unit::ThermalTransferCoefficient) {
unitString = QString::fromLatin1("W/m^2/K");
@@ -298,7 +308,7 @@ QString UnitsSchemaInternal::schemaTranslate(const Quantity &quant, double &fact
}
else if (unit == Unit::HeatFlux) {
unitString = QString::fromLatin1("W/m^2");
factor = 1.0;
factor = 1; // unit signiture (0,1,-3,0,0) is length independent
}
else if (unit == Unit::ElectricCharge) {
unitString = QString::fromLatin1("C");
@@ -417,8 +427,18 @@ QString UnitsSchemaInternal::schemaTranslate(const Quantity &quant, double &fact
factor = 1.0;
}
else if (unit == Unit::DynamicViscosity) {
unitString = QString::fromLatin1("kg/(m*s)");
factor = 0.001;
unitString = QString::fromLatin1("kg/(mm*s)");
factor = 1.0;
}
else if (unit == Unit::KinematicViscosity) {
if (UnitValue < 1e3) {
unitString = QString::fromLatin1("mm^2/s");
factor = 1.0;
}
else {
unitString = QString::fromLatin1("m^2/s");
factor = 1e6;
}
}
else {
// default action for all cases without special treatment: