[FEM] fix wrong console outputs for fluid materials
- since a while ThermalExpansionCoefficient is used, VolumetricThermalExpansionCoefficient is only used for the material task panel - as already stated in a code comment, the unit of VolumetricThermalExpansionCoefficient is ThermalExpansionCoefficient, therefore we must check for ThermalExpansionCoefficient - we must also check if ThermalExpansionCoefficient exists - Adapt the existing fluid material cards to use the ThermalExpansionCoefficient
This commit is contained in:
@@ -461,22 +461,36 @@ class _TaskPanel:
|
||||
.format(self.material["Name"])
|
||||
)
|
||||
self.material["KinematicViscosity"] = "0 m^2/s"
|
||||
if "ThermalExpansionCoefficient" in self.material:
|
||||
vol_ther_ex_co = self.material["ThermalExpansionCoefficient"]
|
||||
if "ThermalExpansionCoefficient" not in str(Units.Unit(vol_ther_ex_co)):
|
||||
FreeCAD.Console.PrintMessage(
|
||||
"ThermalExpansionCoefficient in material data "
|
||||
"seems to have no unit or a wrong unit (reset the value): {}\n"
|
||||
.format(self.material["Name"])
|
||||
)
|
||||
self.material["ThermalExpansionCoefficient"] = "0 1/K"
|
||||
else:
|
||||
FreeCAD.Console.PrintMessage(
|
||||
"ThermalExpansionCoefficient not found in {}\n"
|
||||
.format(self.material["Name"])
|
||||
)
|
||||
self.material["VolumetricThermalExpansionCoefficient"] = "0 1/K"
|
||||
if "VolumetricThermalExpansionCoefficient" in self.material:
|
||||
# unit type VolumetricThermalExpansionCoefficient is ThermalExpansionCoefficient
|
||||
vol_ther_ex_co = self.material["VolumetricThermalExpansionCoefficient"]
|
||||
if "VolumetricThermalExpansionCoefficient" not in str(Units.Unit(vol_ther_ex_co)):
|
||||
if "ThermalExpansionCoefficient" not in str(Units.Unit(vol_ther_ex_co)):
|
||||
FreeCAD.Console.PrintMessage(
|
||||
"VolumetricThermalExpansionCoefficient in material data "
|
||||
"seems to have no unit or a wrong unit (reset the value): {}\n"
|
||||
.format(self.material["Name"])
|
||||
)
|
||||
self.material["VolumetricThermalExpansionCoefficient"] = "0 m^3/m^3/K"
|
||||
self.material["VolumetricThermalExpansionCoefficient"] = "0 1/K"
|
||||
else:
|
||||
FreeCAD.Console.PrintMessage(
|
||||
"VolumetricThermalExpansionCoefficient not found in {}\n"
|
||||
.format(self.material["Name"])
|
||||
)
|
||||
self.material["VolumetricThermalExpansionCoefficient"] = "0 m^3/m^3/K"
|
||||
if "ThermalExpansionCoefficient" in self.material:
|
||||
self.material["VolumetricThermalExpansionCoefficient"] = self.material["ThermalExpansionCoefficient"]
|
||||
else:
|
||||
self.material["VolumetricThermalExpansionCoefficient"] = "0 1/K"
|
||||
# Thermal properties
|
||||
if "ThermalConductivity" in self.material:
|
||||
# TODO implement for all task panel values
|
||||
|
||||
@@ -14,8 +14,8 @@ PrandtlNumber = 0.7
|
||||
[Thermal]
|
||||
SpecificHeat = 1.01 kJ/kg/K
|
||||
ThermalConductivity = 0.02587 W/m/K
|
||||
; volumetric expansion coeff of ideal gas depends on temperature and pressure
|
||||
VolumetricThermalExpansionCoefficient = 3.43e-3 m/m/K
|
||||
; thermal expansion coefficient of ideal gas is 1/temperature
|
||||
ThermalExpansionCoefficient = 3.43e-3 1/K
|
||||
|
||||
[Electrical]
|
||||
RelativePermittivity = 1.00059
|
||||
|
||||
@@ -15,8 +15,8 @@ PrandtlNumber = 0.7
|
||||
[Thermal]
|
||||
SpecificHeat = 0.520 kJ/kg/K
|
||||
ThermalConductivity = 0.018 W/m/K
|
||||
; volumetric expansion coeff of ideal gas depends on temperature and pressure
|
||||
VolumetricThermalExpansionCoefficient = 3.43e-3 1/K
|
||||
; thermal expansion coefficient of ideal gas is 1/temperature
|
||||
ThermalExpansionCoefficient = 3.43e-3 1/K
|
||||
|
||||
[Electrical]
|
||||
RelativePermittivity = 1.000513
|
||||
|
||||
@@ -15,8 +15,8 @@ PrandtlNumber = 0.7
|
||||
[Thermal]
|
||||
SpecificHeat = 1.04 kJ/kg/K
|
||||
ThermalConductivity = 25.83e-3 W/m/K
|
||||
; volumetric expansion coeff of ideal gas depends on temperature and pressure
|
||||
VolumetricThermalExpansionCoefficient = 3.43e-3 1/K
|
||||
; thermal expansion coefficient of ideal gas is 1/temperature
|
||||
ThermalExpansionCoefficient = 3.43e-3 1/K
|
||||
|
||||
[Electrical]
|
||||
RelativePermittivity = 1.00058
|
||||
|
||||
@@ -12,5 +12,4 @@ KinematicViscosity = 0 m^2/s
|
||||
[Thermal]
|
||||
SpecificHeat = 0 J/kg/K
|
||||
ThermalConductivity = 0 W/m/K
|
||||
ThermalExpansionCoefficient = 0 um/m/K
|
||||
VolumetricThermalExpansionCoefficient = 0 m/m/K
|
||||
ThermalExpansionCoefficient = 0 1/K
|
||||
|
||||
Reference in New Issue
Block a user