A Mystran writer error when using 1d element

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: A Mystran writer error when using 1d element

Post by johnwang »

if use m, the shape is right. The others all SI.This 25mm rod. Need to use CBAR.
But displacement is 8.35 um. You sure it is in mm?
3dT7.jpg
3dT7.jpg (32.31 KiB) Viewed 1673 times
Mesh_m.dat.txt
(27.9 KiB) Downloaded 46 times
Last edited by johnwang on Sat Sep 18, 2021 12:11 pm, edited 1 time in total.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: A Mystran writer error when using 1d element

Post by bernd »

does it means your section code only works with meter units?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: A Mystran writer error when using 1d element

Post by bernd »

in FreeCAD everything is in mm. AFAIK length units passed to pyNastran and thus to mystran solver from FreeCAD are in mm as well.
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: A Mystran writer error when using 1d element

Post by johnwang »

For Mystran all should be SI in case file or the American one.

I haven't tested Rect/Pipe, will try tomorrow.

I changed here at exportNastranMesh.py

Code: Select all

    # nodes
    kr=0.001
    pynas_nodes = "# grid cards, geometric mesh points\n"
    for node in femnodes_mesh:
        vec = femnodes_mesh[node]
        pynas_nodes += "model.add_grid({}, [{}, {}, {}])\n".format(node, vec.x*kr, vec.y*kr, vec.z*kr)
    # print(pynas_nodes)
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: A Mystran writer error when using 1d element

Post by johnwang »

bernd wrote: Sat Sep 18, 2021 12:11 pm does it means your section code only works with meter units?
In the case file, if the mesh is in mm, the PBAR is calculated with m. They mixed up. So result will not be right.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: A Mystran writer error when using 1d element

Post by bernd »

no Mystran does not need SI units. Mystran will get you back what you have passed to him. I have asked this one to Mystran dev right at the beginning of coding and got repley from a dev. We in FreeCAD pass the same units as we pass to calculix solver. We pass mm and N, with this we get back stress in N/mm2 And thus we pass youngs mofulus in N/mm2. Thus your section code should pass all length units in mm and we will be fine.

See comments at the beginning of calculix writer in source code.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: A Mystran writer error when using 1d element

Post by bernd »

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

Re: A Mystran writer error when using 1d element

Post by bernd »

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

Re: A Mystran writer error when using 1d element

Post by bernd »

https://github.com/berndhahnebach/FreeC ... ry.py#L116

these lines need to read the data in mm. Than you are fine ...

with this fix in your code, I get 8.35 mm maximum deflection ... :D

https://github.com/berndhahnebach/FreeC ... b8f6a6b28c
Post Reply