shell to shell contact

About the development of the FEM module/workbench.

Moderator: bernd

thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

shell to shell contact

Post by thschrader »

Hi,
want to calculate the contact between 2 cylinders using 2D shell-elements as described here
https://www.youtube.com/watch?v=cH_leTeGBuA

After writing the case the …contact.inp is empty (see picture). Maybe I do something wrong.
cylinder_contact_2D.FCStd
(13.8 KiB) Downloaded 22 times

3D-case works
cylinder_contact_3D.FCStd
(14.89 KiB) Downloaded 18 times

In the end I want to calculate flange to flange contact with 2D-elements and a plastic material like these guys are doing:
https://www.ideastatica.com/steel/
flange_2D.FCStd
(57.78 KiB) Downloaded 22 times

system:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15860 (Git)
Build type: Release
Branch: master
Hash: 3b708c7f84b0425076b520e1d95627b20fd75fe0
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)
contact_2_cylinder.JPG
contact_2_cylinder.JPG (110.32 KiB) Viewed 1090 times
bild
UR_
Veteran
Posts: 1354
Joined: Tue Jan 03, 2017 8:42 pm

Re: shell to shell contact

Post by UR_ »

You are right, shell to shell contact is a must have ;)

Unfortunately input writer doesn't support non solid elements ATM

src\Mod\Fem\femsolver\calculix\writer.py line 610

Code: Select all

                        f.write("*SURFACE, NAME =" + name + "\n")
                        v = self.mesh_object.FemMesh.getccxVolumesByFace(ref_shape)
                        for i in v:
                            f.write("{},S{}\n".format(i[0], i[1])) 
user manual ccx 2.16 page 543, 544 says:
for quadrilateral shell element
• Face NEG or 1: in negative
• Face POS or 2: in positive
• Face 3: 1-2
• Face 4: 2-3
• Face 5: 3-4
• Face 6: 4-1
for triangular shell elements:
• Face NEG or 1: in negative normal direction
• Face POS or 2: in positive normal direction
• Face 3: 1-2
• Face 4: 2-3
• Face 5: 3-1
Perhaps restriction to POS should be sufficient.
NEG sides aren't selectable by task panel of contact constraint.
UR_
Veteran
Posts: 1354
Joined: Tue Jan 03, 2017 8:42 pm

Re: shell to shell contact

Post by UR_ »

Screenshot 001.png
Screenshot 001.png (238.24 KiB) Viewed 997 times
Screenshot 002.png
Screenshot 002.png (17.5 KiB) Viewed 997 times

:roll:
expected results?


dirty proof:
src\Mod\Fem\femsolver\calculix\writer.py line 610

Code: Select all

                        f.write("*SURFACE, NAME =" + name + "\n")
                        #v = self.mesh_object.FemMesh.getccxVolumesByFace(ref_shape)
                        #for i in v:
                        #    f.write("{},S{}\n".format(i[0], i[1]))
                        v = self.mesh_object.FemMesh.getFacesByFace(ref_shape)
                        for i in v:
                            f.write("{},S2\n".format(i))
UR_
Veteran
Posts: 1354
Joined: Tue Jan 03, 2017 8:42 pm

Re: shell to shell contact

Post by UR_ »

bernd wrote: :bell:
A little patch for src/Mod/Fem/femsolver/calculix/writer.py
to get shell meshes covered.
line 611:

Code: Select all

                        
                        v = self.mesh_object.FemMesh.getccxVolumesByFace(ref_shape)
                        if len(v) > 0:
                            # volume elements found
                            FreeCAD.Console.PrintLog(
                                "{}, surface {}, {} touching volume elements found\n"
                                .format(contact_obj.Label, name, len(v))
                            )
                            for i in v:                        
                                f.write("{},S{}\n".format(i[0], i[1]))
                        else:
                            # try shell elements
                            v = self.mesh_object.FemMesh.getFacesByFace(ref_shape)
                            if len(v) > 0:
                                FreeCAD.Console.PrintLog(
                                    "{}, surface {}, {} touching shell elements found\n"
                                    .format(contact_obj.Label, name, len(v))
                                )
                                for i in v:
                                    f.write("{},S2\n".format(i))
                            else:
                                FreeCAD.Console.PrintError(
                                    "{}, surface {}, Error: Neither volume nor shell elements found!\n"
                                    .format(contact_obj.Label, name)
                                )

writer.py.diff.zip
(662 Bytes) Downloaded 15 times

modified file (if diff doesn't work)
writer.py
(89.67 KiB) Downloaded 19 times

A little test file made from shell elements:

Screenshot 004.png
Screenshot 004.png (156.5 KiB) Viewed 960 times
TubeTube-stripped.FCStd
(19.97 KiB) Downloaded 22 times

What's your opinion about this :?
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: shell to shell contact

Post by bernd »

If you continue to make such cool contributions I do not care if you use git or not. But it would make things easier even for you! :ugeek:

I will have a look on the weekend ...

cheers bernd
UR_
Veteran
Posts: 1354
Joined: Tue Jan 03, 2017 8:42 pm

Re: shell to shell contact

Post by UR_ »

bernd wrote: Fri Jan 10, 2020 7:41 pm ... even for you!
Hope there is a tutorial out there, howto get things done :shock:
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: shell to shell contact

Post by bernd »

FreeCAD helps with everything ... :mrgreen: Source_code_management
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: shell to shell contact

Post by bernd »

The short version ...

create a github account, fork FreeCAD, clone this repo to your local pc, make a new branch shellcontact on your local repo, copy the code (writer.py file), make a commit, push the new branch from your local repo to github and post the address here. If you encounter any problems ask.
UR_
Veteran
Posts: 1354
Joined: Tue Jan 03, 2017 8:42 pm

Re: shell to shell contact

Post by UR_ »

bernd wrote: Fri Jan 10, 2020 8:07 pm The short version ...

Hope this works.


https://github.com/FreeCAD/FreeCAD/pull/2892


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

Re: shell to shell contact

Post by bernd »

It would be possible to have a face with shell elements and one with tetras. FreeCAD would ust write it to file. Does this makes sense for FEM analyse point of view and does ccx can handle this case?
Post Reply