Menu

Workshops

Projects

Blogs

Careers

Find Jobs


For Business / Universities

Corporate Training

Hire from US

Academic Up-skilling


All Courses

Choose a category

Loading...

All Courses

All Courses

logo

Loading...

FOR BUSINESSES

Corporate Upskilling

Hire from Us

FOR Universities

Academic Training

More

Mechanical

Uploaded on

31 Oct 2022

What Are Contacts In ANSYS?

logo

Skill-Lync

Contacts and joints are usually created using the ANSYS APIs. Some of the options are pretty straightforward and they don't deviate much from what we have already studied till now. Basically, contacts and joints are helpful in transferring the forces from one end to the other in case of an assembly of components involving motion. Let's look into some of the nooks and corners of the contacts and joints APIs.

How To Create A Contact/Joint in ANSYS?

To create a Contact or joint, the very first code is,

Code 1: Contacts=ExtAPI.DataModel.Project.Model.Connections.AddConnectionGroup()

Under this connection tag only, each and every connection group is put together.

Now, using code 1, only the connection group gets created and not a contact region. So, if one has to create a contact region, then he/she should use,

Code 2: Contacts=ExtAPI.DataModel.Project.Model.Connections.AddConnectionGroup().AddContact Region()

Running the above code creates a connection group and also a contact region is shown below,

One can also directly write it as,

Code 4: Contacts=ExtAPI.DataModel.Project.Model.Connections.AddContact Region()

This will also automatically create a connection group and a contact region.

Now, if you try to run the above code once again, then the new contact region is created with a connection group. The new contact region will not get automatically created inside the already existing connection group as shown below,

To avoid this issue, call the contact region by mentioning the children of the connection under which you wish to create a new contact. It can be done by using the following,

Code 5: Contacts=ExtAPI.DataModel.Project.Model.Connections.Children[0].AddContact Region()

A new contact region has been created inside the first connection group under the connections tag. This is based on the fact that each and every entity present in the outline window is considered a ‘List’.

Now, the same goes for creating joints as well,

Code 6: Contacts=ExtAPI.DataModel.Project.Model.Connections.AddJoint()

The catch here is that joints cannot be created inside the connection group where contact is created. Joints require a separate connection group and the contact region requires a separate connection group. So care must be taken when going forward with joint creation.

Now, Let's see how to define some of the constants that are present inside the contact region, here is a new connection group with a contact region is created and to that contact region we are defining the contact type to be ‘Frictional’

Code 7: c=ExtAPI.DataModel.Project.Model.Connections.AddContactRegion()

c1=ExtAPI.DataModel.Project.Model.Connections.Children[0]

d=c1.Children[0]

d.ContactType=ContactType.Frictional

The first line of the code instructs to create a new contact region. The second line is to call and define the children present below the ‘Connections’ tag which is nothing but the connection group. The third line is to call and define the contact region present inside the connection group. The fourth line is to assign the Frictional contact type for the contact region created as shown below in the image.

In the same way, one can define the other constants as mentioned below. Some of the important constants are behaviour, formulation, interface treatment, Friction coefficient (if the contact is frictional).

Code 8: d.ContactType=ContactType.Frictional

Code 9: d.Behavior=ContactBehavior.ProgramControlled

Code 10: d.InterfaceTreatment=ContactInitialEffect.AdjustToTouch

Code 11: d.ContactFormulation=ContactFormulation.AugmentedLagrange

Code 12: d.ContactFormulation= ContactFormulation.PurePenalty

Code 13: d.UpdateStiffness = UpdateContactStiffness.EachIteration

In a similar manner, the constants in the joints can be defined as mentioned below,

c1=ExtAPI.DataModel.Project.Model.Connections.AddJoint()

c2=ExtAPI.DataModel.Project.Model.Connections.Children[1]

d1=c2.Children[1]

Code 14: d1.Type=JointType.Cylindrical

Code 15: d1.ConnectionType=JointScopingType.BodyToGround

Code 16: d1.ConnectionType=JointScopingType.BodyToBody

Now comes the important part of assigning the target and source faces. This can be easily carried out if a named selection has been created for the contact surfaces. The input required for the source and target location is the string, so just by calling the named selection, one can easily assign it to the contact or joints. Let's consider the faces have been already assigned a Named selection, Follow as shown below,

NS=ExtAPI.DataModel.Project.Model.NamedSelections

NS1=NS.Children[0]

NS2=NS.Children[1]

Code 17: d.TargetLocation=NS2

Code 18: d.SourceLocation=NS1

If joints are defined, 

Code 19: d1.ReferenceBody=NS2

Code 20: d2.MobileBody=NS1

 


Author

author

Navin Baskar


Author

blogdetails

Skill-Lync

img

Continue Reading

Related Blogs

Shock tube simulation

Learn how to render a shock-tube-simulation and how to work on similar projects after enrolling into anyone of Skill-Lync's CAE courses.

Mechanical

10 May 2020


What is Finite element analysis (FEA)?

What exactly is Finite element analysis? How would one explain the basic concept to an undergrad friend? Learn how FEA courses at Skill-Lync can help you get employed.

Mechanical

08 May 2020


Design of Frontal BIW enclosure of a car (Bonnet)

In this blog, read how to design the frontal BIW enclosure of a car (Bonnet) and learn how Skill-Lync Master's Program in Automotive Design using CATIA V5 will help you get employed as a design engineer.

Mechanical

10 May 2020


What is Strain Hardening and Plasticity?

This effect shown in the kinematic hardening is known as the Bauschinger effect. For large strain problems, kinematic hardening model is not a good choice because of the Bauschinger effect.

Mechanical

27 Jun 2022


What is Hourglass Effect? Working & Fixes

When the elements in a model deform but the strain energy is not computed for that deformation, it results in an Hourglass deformation effect or Hourglass effect. Usually, this can be clearly seen in the post-processing stage where the elements will have a zig-zag formation.

Mechanical

28 Jun 2022



Author

blogdetails

Skill-Lync

img

Continue Reading

Related Blogs

Shock tube simulation

Learn how to render a shock-tube-simulation and how to work on similar projects after enrolling into anyone of Skill-Lync's CAE courses.

Mechanical

10 May 2020


What is Finite element analysis (FEA)?

What exactly is Finite element analysis? How would one explain the basic concept to an undergrad friend? Learn how FEA courses at Skill-Lync can help you get employed.

Mechanical

08 May 2020


Design of Frontal BIW enclosure of a car (Bonnet)

In this blog, read how to design the frontal BIW enclosure of a car (Bonnet) and learn how Skill-Lync Master's Program in Automotive Design using CATIA V5 will help you get employed as a design engineer.

Mechanical

10 May 2020


What is Strain Hardening and Plasticity?

This effect shown in the kinematic hardening is known as the Bauschinger effect. For large strain problems, kinematic hardening model is not a good choice because of the Bauschinger effect.

Mechanical

27 Jun 2022


What is Hourglass Effect? Working & Fixes

When the elements in a model deform but the strain energy is not computed for that deformation, it results in an Hourglass deformation effect or Hourglass effect. Usually, this can be clearly seen in the post-processing stage where the elements will have a zig-zag formation.

Mechanical

28 Jun 2022


Related Courses

https://d28ljev2bhqcfz.cloudfront.net/mainproject/thumb/mid-surface-extraction-and-meshing-of-an-ip-substrate_1616574368.jpg
Modelling of an Automotive IP Trim component by using ANSA
Recently launched
0 Hours of content
Design Domain
Know more
https://d28ljev2bhqcfz.cloudfront.net/maincourse/thumb/preprocessor-structural-analysis-ansa_1636604676.jpg
4.7
17 Hours of content
Cae Domain
https://d28ljev2bhqcfz.cloudfront.net/maincourse/thumb/advanced-cfd-meshing-ansa_1612263286.jpg
4.9
12 Hours of content
Cfd Domain
https://d28ljev2bhqcfz.cloudfront.net/mainproject/thumb/meshing-and-connections-deployment-of-rear-suspension-of-a-car-73676_1616585003.jpgRecently launched
0 Hours of content
Design Domain
Showing 1 of 6 courses
Try our top engineering courses, projects & workshops today!Book a FREE Demo