[Fixed]Can not set material: "Not known problem"

About the development of the FEM module/workbench.

Moderator: bernd

reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

[Fixed]Can not set material: "Not known problem"

Post by reox »

I try to set a material for a solid in the FEM workbench (Create a FEM Material for solid -> choose Material card -> click OK), but no matter what material I choose from the list, I get this error message:
2019-10-30-180210_500x109_scrot.png
2019-10-30-180210_500x109_scrot.png (8.24 KiB) Viewed 987 times
In the log I see:

Code: Select all

choose_material in FEM material task panel:
    /usr/share/freecad-daily/Mod/Material/StandardMaterial/Steel-1C22.FCMat
ThermalConductivity not found in material data of: 1C22
SpecificHeat not found in material data of: 1C22

Zero ThermalConductivity value. This parameter is not saved in the material data.
Zero SpecificHeat value. This parameter is not saved in the material data.
<Exception> syntax error
Parameter: ThermalExpansionCoefficient --> value: 0.000011 m/m/K --> Not known problem.
Due to some wrong material quantity units in the changed material data, the task panel changes where not accepted.
What is wrong there? Or is the problem between keyboard and chair?

Code: Select all

OS: Debian GNU/Linux bullseye/sid (i3/i3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18640 (Git)
Build type: Release
Branch: master
Hash: 2251f53eb5af097cbb4b879af89575132660e541
Python version: 3.7.5
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Austria (de_AT)
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Can not set material: "Not known problem"

Post by vocx »

reox wrote: Wed Oct 30, 2019 5:07 pm I try to set a material for a solid in the FEM workbench (Create a FEM Material for solid -> choose Material card -> click OK), but no matter what material I choose from the list, I get this error message:
...
You should probably ask in the FEM workbench, as it seems the problem is with how the workbench tries to get the material.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Can not set material: "Not known problem"

Post by Kunda1 »

Moved to FEM subforum
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Can not set material: "Not known problem"

Post by bernd »

reox wrote: Wed Oct 30, 2019 5:07 pm ...
<Exception> syntax error
...
[/code]

What is wrong there? Or is the problem between keyboard and chair?
Very strange for me 0.19.18638 works great. There has been no changes in the regard of either materials or FEM material taskpanel lately. The syntax error seams strange to me.

The only difference I am on Buster you on sid. Python verison on Buster is 3.7.3 this should not the problem. Do you find the syntax error or have more information about it.

You may could reduce the material directories to a own directory and only put a few material cards in, just to test.
reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: Can not set material: "Not known problem"

Post by reox »

Okay I think I know whats wrong:

I can also reproduce it by using "use Task Panel" and putting any non-zero value into the thermal expansion coeff.
Interestingly, if I put a 1 1/K there, I get this message:

Code: Select all

Parameter: ThermalExpansionCoefficient --> value: 1000000.0 um/m/K --> Not known problem.
Which got me thinking... Actually I use the Unit schema for "Metric small parts & CNC"! Switching this to Standard SI units made everything work.
So it looks like the parser for units gets confused when parsing the units when in CNC mode?!
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Can not set material: "Not known problem"

Post by bernd »

reox wrote: Fri Nov 01, 2019 12:46 pm Okay I think I know whats wrong:

I can also reproduce it by using "use Task Panel" and putting any non-zero value into the thermal expansion coeff.
Interestingly, if I put a 1 1/K there, I get this message:

Code: Select all

Parameter: ThermalExpansionCoefficient --> value: 1000000.0 um/m/K --> Not known problem.
Which got me thinking... Actually I use the Unit schema for "Metric small parts & CNC"! Switching this to Standard SI units made everything work.
So it looks like the parser for units gets confused when parsing the units when in CNC mode?!
ok one step further. I changed to this unit system too, still no problems here.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Can not set material: "Not known problem"

Post by bernd »

What I did:
- start FreeCAD
- change in prefs to unit small parts with cnc
- got to FEM wb
- Add an analysis
- add an material
- change to material Steel-1C22.FCMat

works without any problem
reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: Can not set material: "Not known problem"

Post by reox »

I tried it again, restart FC, set CNC units, etc.. did the same as you. And it produces the error.
Right now, I'm at

Code: Select all

OS: Debian GNU/Linux bullseye/sid (i3/i3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18644 (Git)
Build type: Release
Branch: master
Hash: 481870be2b48ef95b59acf1440b069d42b6fad23
Python version: 3.7.5
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Austria (de_AT)
Maybe I'm missing some build flags? (It is not the offical daily build but my own build)
But I checked the buildlog, there are only warnings (the usual stuff IMO), no errors.

My localization in FC is set to English - maybe this makes a difference?
I even started with a new .FreeCAD folder (which sets my locale by default to German btw) and could reproduce the error there when setting the Units to CNC.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Can not set material: "Not known problem"

Post by bernd »

how about the other unit systems ...
reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: Can not set material: "Not known problem"

Post by reox »

tested all of them:

Standard ... works
MKS ... works
US customary ... error
Imperial decimal ... error
Building euro ... error
Building US ... error
CNC ... error
Imperial civial ... error

btw you can debug this in the python console it looks like:

Code: Select all

>>> from FreeCAD import Units
>>> Units.ThermalExpansionCoefficient
Unit: 1/K (0,0,0,0,-1,0,0,0) [ThermalExpansionCoefficient]
>>> quantity = Units.Quantity(1, Units.ThermalExpansionCoefficient)
>>> user_prefered_unit = quantity.getUserPreferred()[2]
>>> user_prefered_unit
'm/m/K'
>>> param_value = Units.Quantity('0.0001 m/m/K')


>>> Gui.runCommand('Std_DlgPreferences',0)   # Changed from MKS to CNC


>>> quantity = Units.Quantity(1, Units.ThermalExpansionCoefficient)
>>> user_prefered_unit = quantity.getUserPreferred()[2]
>>> user_prefered_unit
'1/K'
>>> param_value.getValueAs(user_prefered_unit)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
Base.FreeCADError: syntax error
So somehow the meters per meters get replaced by 1, then it fails.
Especially if you do stuff like:

Code: Select all

>>> quantity.getValueAs('m/m/K')
1 
>>> quantity.getValueAs('1/K')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
Base.FreeCADError: syntax error
>>> quantity.getValueAs('kg/kg/K')
1 
So if you use ANY unit which cancels to 1 it works. But if you use 1 instead, it fails.

Interestingly, this works too:

Code: Select all

>>> quantity.getValueAs('K^-1')
1 
Post Reply