collection of material issues

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: collection of material issues

Post by bernd »

9.

https://github.com/FreeCAD/FreeCAD/blob ... .FCMat#L17 The minus is no minus ...

Code: Select all

# with minus
ThermalConductivity = 25.83e-3 W/m/K
#
#
# from Nitrogen card
ThermalConductivity = 25.83e−3 W/m/K[
try in FreeCAD

Code: Select all

from FreeCAD import Units
Units.Quantity('25.83e−3 W/m/K')
will return

Code: Select all

>>>
>>> Units.Quantity('25.83e−3 W/m/K')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ValueError: syntax error
>>> 
it is like a this

Code: Select all

from FreeCAD import Units
Units.Quantity('123abc456 m')

Code: Select all

>>> 
>>> from FreeCAD import Units
>>> Units.Quantity('123abc456 m')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ValueError: syntax error
>>> 
IMHO this should not be handled in FEM but in FreeCAD Base.

What we could do is write some method to check the values as I started here: https://github.com/FreeCAD/FreeCAD/blob ... ls.py#L452
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: collection of material issues

Post by bernd »

git commit 0afa4bd3441a fixes the Nitrogen card
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: collection of material issues

Post by uwestoehr »

bernd wrote: Wed Jul 14, 2021 6:46 pm git commit 0afa4bd3441a fixes the Nitrogen card
many thanks!

However, we have now a bad regression:
- launch the material card editor
- open the existing Air.FCMat material card part of FreeCAD
- click e.g. on the electric conductivity

result: the value vanishes immediately.
Click now e.g. an the relative permittivity and this value does not vanish but is set to 1.
In both cases you loose the info.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: collection of material issues

Post by bernd »

uwestoehr wrote: Wed Jul 14, 2021 7:12 pm However, we have now a bad regression:
- launch the material card editor
- open the existing Air.FCMat material card part of FreeCAD
- click e.g. on the electric conductivity

result: the value vanishes immediately.
Click now e.g. an the relative permittivity and this value does not vanish but is set to 1.
In both cases you loose the info.
No this has not been added lately. Check out 4596f441bf0dad9d907613dcc729f040fdf7bb15 this is the parent commit of the first one I made in the regard of Materials lately. See https://github.com/FreeCAD/FreeCAD/comm ... d/Material the problem has been there before. I have played around. It seams the Material Editor rounds any value on 2 diggits. Since this is not only for displaying but it really changes the values this is a nasty bug ...
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: collection of material issues

Post by bernd »

- Start FreeCAD.
- switch to FEM
- add a Analysis
- add fluid Material
- add Air
- ok
- run code:

Code: Select all

 App.ActiveDocument.MaterialFluid.Material

Code: Select all

>>> 
>>> App.ActiveDocument.MaterialFluid.Material
{'CardName': 'Air', 'Density': '1.204 kg/m^3', 'Description': 'Dry air properties at 20 Degrees Celsius and 1 atm', 'DynamicViscosity': '1.80e-5 kg/m/s', 'ElectricalConductivity': '1e-12 S/m', 'Father': 'Gas', 'KinematicViscosity': '1.511e-5 m^2/s', 'MolarMass': '28.965', 'Name': 'Air', 'PrandtlNumber': '0.7', 'RelativePermittivity': '1.00059', 'SpecificHeat': '1.01 kJ/kg/K', 'ThermalConductivity': '0.02587 W/m/K', 'VolumetricThermalExpansionCoefficient': '0 m^3/m^3/K'}
>>> 
- double click on MaterialFluid
- edit in MaterialEditor
- double click in any value
- ok
- ok

Code: Select all

 App.ActiveDocument.MaterialFluid.Material

Code: Select all

>>> 
>>> App.ActiveDocument.MaterialFluid.Material
{'CardName': 'Air', 'Density': '1.20 kg/m^3', 'Description': 'Dry air properties at 20 Degrees Celsius and 1 atm', 'DynamicViscosity': '1.80e-5 kg/m/s', 'ElectricalConductivity': '0.00 mS/m', 'Father': 'Gas', 'KinematicViscosity': '1.511e-5 m^2/s', 'MolarMass': '28.965', 'Name': 'Air', 'PrandtlNumber': '0.7', 'RelativePermittivity': '1', 'SpecificHeat': '1010.00 J/kg/K', 'ThermalConductivity': '0.03 W/m/K', 'VolumetricThermalExpansionCoefficient': '0 m^3/m^3/K'}
>>> 
only the user defined values stay at his value
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: collection of material issues

Post by uwestoehr »

bernd wrote: Wed Jul 14, 2021 7:55 pm this has not been added lately.
Yes, I see this is also in FC 0.19 and super nasty.
The bug is the conversion from the decimal character:

- Load the card for Air
- click on the thermal conductivity

result: the values was "0.02587 W/m/K". The bug is that this value is interpreted ignoring the dot as being the decimal separator, (by the way, note that I have a German Windows). To FC thinks the value is "2587 W/m/K". Then the FC unit handling converts the unut to W/mm/k and thus the "result" is "2587 W/m/K".

same for the permittivity. The value is interpreted as 10059 but the internal limit is 99.99 so all values above this are reset to 1.

Same for Specific heat: Value is "1.01 kJ/kg/K" -> interpreted as "101 kJ/kg/K", this is then converted to "101000,000 J/kg/K"
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: collection of material issues

Post by bernd »

Try to use a locale with a "." Still not fixed. ... Ther 1.00059 will be 1.00 and 1.204 will be 1.20.

I gave it a try but the material editor https://github.com/berndhahnebach/FreeC ... lEditor.py is somehow very very difficult to understand ... IMHO. I am just not able to find it in a normal time range ... :evil:

BTW: How about 0.18 ?
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: collection of material issues

Post by bernd »

same problem on 0.18 ...

0.0257 changes to 0.03

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)

BTW no problem with decimal separator, but since it is swiss locale "." is used.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: collection of material issues

Post by bernd »

it works in 0.17 :)

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Switzerland (de_CH)
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: collection of material issues

Post by bernd »

Post Reply