Simulating Low Youngs Modulus <0.5MPa Problem Limitation
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Simulating Low Youngs Modulus <0.5MPa Problem Limitation
Hello Guys,
I am simulating my materials in Freecad which has a Young's Modulus 100KPa and 30KPa using materials card and it give me the following error, and I tried to see the limit for Young's modulus, if I go below 0.5MPa in the material card, it gives the error below above 0.5MPa is okay... This really made me very confused is that a software limitation? I am using Freecad app image
The numbers below are estimated upper bounds
number of:
nodes: 11865
elements: 10241
one-dimensional elements: 0
two-dimensional elements: 0
integration points per element: 4
degrees of freedom per node: 3
layers per element: 1
distributed facial loads: 0
distributed volumetric loads: 0
concentrated loads: 162
single point constraints: 486
multiple point constraints: 1
terms in all multiple point constraints: 1
tie constraints: 0
dependent nodes tied by cyclic constraints: 0
dependent nodes in pre-tension constraints: 0
sets: 5
terms in all sets: 40653
materials: 1
constants per material and temperature: 2
temperature points per material: 1
plastic data points per material: 0
orientations: 0
amplitudes: 2
data points in all amplitudes: 2
print requests: 1
transformations: 0
property cards: 0
*ERROR reading *ELASTIC: the Young
modulus should exceed 0.0
*ERROR reading *ELASTIC. Card image:
0,0.400
STEP 1
Static analysis was selected
*ERROR in calinput: at least one fatal
error message while reading the
input deck: CalculiX stops.
0.2: CalculiX execute error:
0.2: Loading result sets...
I am simulating my materials in Freecad which has a Young's Modulus 100KPa and 30KPa using materials card and it give me the following error, and I tried to see the limit for Young's modulus, if I go below 0.5MPa in the material card, it gives the error below above 0.5MPa is okay... This really made me very confused is that a software limitation? I am using Freecad app image
The numbers below are estimated upper bounds
number of:
nodes: 11865
elements: 10241
one-dimensional elements: 0
two-dimensional elements: 0
integration points per element: 4
degrees of freedom per node: 3
layers per element: 1
distributed facial loads: 0
distributed volumetric loads: 0
concentrated loads: 162
single point constraints: 486
multiple point constraints: 1
terms in all multiple point constraints: 1
tie constraints: 0
dependent nodes tied by cyclic constraints: 0
dependent nodes in pre-tension constraints: 0
sets: 5
terms in all sets: 40653
materials: 1
constants per material and temperature: 2
temperature points per material: 1
plastic data points per material: 0
orientations: 0
amplitudes: 2
data points in all amplitudes: 2
print requests: 1
transformations: 0
property cards: 0
*ERROR reading *ELASTIC: the Young
modulus should exceed 0.0
*ERROR reading *ELASTIC. Card image:
0,0.400
STEP 1
Static analysis was selected
*ERROR in calinput: at least one fatal
error message while reading the
input deck: CalculiX stops.
0.2: CalculiX execute error:
0.2: Loading result sets...
Re: Simulating Low Youngs Modulus <0.5MPa Problem Limitation
I think there is a bug in:
...src\Mod\Fem\femsolver\calculix\writer.py line 1431
{:.0f} means: format float with no decimal places
This has to be changed.
...src\Mod\Fem\femsolver\calculix\writer.py line 1431
Code: Select all
if mat_obj.Category == "Solid":
f.write("*ELASTIC\n")
f.write("{0:.0f}, {1:.3f}\n".format(YM_in_MPa, PR))
This has to be changed.
bernd wrote:
Re: Simulating Low Youngs Modulus <0.5MPa Problem Limitation
Hello,
there is fixed precision when FreeCAD writes modulus in MPa to the CalculiX input file. You can edit it manually before running the analysis:
Click "Edit .inp file"
Find *ELASTIC card close to the end of the file
On the next line, there are elastic modulus in MPa and Poisson number - modify elastic modulus as needed.
We discussed issue like this previously
https://forum.freecadweb.org/viewtopic.php?f=18&t=52599
https://github.com/FreeCAD/FreeCAD/blob ... r.py#L1433
there is fixed precision when FreeCAD writes modulus in MPa to the CalculiX input file. You can edit it manually before running the analysis:
Click "Edit .inp file"
Find *ELASTIC card close to the end of the file
On the next line, there are elastic modulus in MPa and Poisson number - modify elastic modulus as needed.
We discussed issue like this previously
https://forum.freecadweb.org/viewtopic.php?f=18&t=52599
https://github.com/FreeCAD/FreeCAD/blob ... r.py#L1433
Re: Simulating Low Youngs Modulus <0.5MPa Problem Limitation
since I am refactoring the writer ATM here a save link. https://github.com/FreeCAD/FreeCAD/blob ... r.py#L1433
Re: Simulating Low Youngs Modulus <0.5MPa Problem Limitation
confirmed!
What material has young's modulus lower than 500 kPa?
What material has young's modulus lower than 500 kPa?
Re: Simulating Low Youngs Modulus <0.5MPa Problem Limitation
Sorry but this solution looks a little bit strange.
All floating points fields read from ccx are F20.0 FORTRAN input fields.
So line 91
should be changed to:
That's all.
Please see a comment by bernd
All places writing floating points to ccx should be investigated for this bug.
All floating points fields read from ccx are F20.0 FORTRAN input fields.
So line 91
Code: Select all
f.write("{0:.0f}, {1:.3f}\n".format(YM_in_MPa, PR))
Code: Select all
f.write("{0:.13G}, {1:.3f}\n".format(YM_in_MPa, PR))
Please see a comment by bernd
Code: Select all
# Why {:.13G} ...
# ccx uses F20.0 FORTRAN input fields, see in dload.f in ccx's source
# https://forum.freecadweb.org/viewtopic.php?f=18&t=22759&#p176578
# example "{:.13G}".format(math.sqrt(2.)*-1e100) and count chars
All places writing floating points to ccx should be investigated for this bug.
Re: Simulating Low Youngs Modulus <0.5MPa Problem Limitation
would you go for a PR for this small fast change, will only take a few seconds ... But do not forget to run the unit test ... I should have been writing a comment in the code ...UR_ wrote: ↑Tue Jul 13, 2021 2:29 pm should be changed to:
That's all.Code: Select all
f.write("{0:.13G}, {1:.3f}\n".format(YM_in_MPa, PR))
Re: Simulating Low Youngs Modulus <0.5MPa Problem Limitation
my fault ... I should have run the unit test before go for a change ... git commit 74c3a4f676ca4