Skip to main content

Using the Abaqus Scripting Interface (ASI) sand Python programming language, users are making engineering analysis easier than ever before. Running a simulation on a model in Abaqus is very fast and cost effective when compared to completing the tests in a real lab. However, building models in Abaqus can be time intensive, especially if the analyst works on a very complex model. Thankfully, there is a way to automate the simulation from pre- to post-processing by writing a Python script. The Python script allows the user to set up variables within the script that can be modified while the rest of the simulation can be built from the base that was created. Doing this type of automation saves a lot of time and money because the user does not have to perform repetitive tasks. Also, once the script has been verified, it significantly reduces the possible of human error, especially for time consuming or complex tasks. VIAS3D takes advantage of this feature to make sure that we can provide the customer with the fastest and most accurate results possible.

What is a Python Script?

Scripts are bits of codes that are written in a high-level programming language and your aim is to automatically perform those functions that exist in your software. These scripts help the user to see the steps that the program is using to finish the simulation. When you use Abaqus/CAE, the actions you perform in the GUI (graphical user interface) generate commands in Python. These Python commands are interpreted by the Python Interpreter and sent to the kernel for processing. For example, when you create a new material in Abaqus/CAE, it generates a command based on the material properties you have entered, and this information is sent to the kernel when the dialog box is closed or the Apply button is pressed (if an Apply button exists). In other words, the Abaqus/CAE GUI window is the interface between you and the kernel, and both the GUI and kernel communicate using Python commands. You can also use the ASI to write a series of Python commands in a file (called a script) and submit it to the kernel (File>Run Script) or you can type or copy and paste Python commands directly into the kernel command line interface (CLI). The above-mentioned options are the three options available to submit Python commands to Python interpreter so that these commands may be sent to the Abaqus/CAE kernel to be executed.

Figure 1 – Submitting python commands

How to Automate the Tasks?

In this Python files, all the values that were specified in the setup can be customized. The user can change the specific commands and the specific variables that were set to run on another model or simulation. This way, the person using the program does not have to repeat tasks that were done before. When running simulations, you may find yourself reusing the same set of materials on a regular basis. For example, if you analyze a product that contains several different material properties, you will need to define the material properties using the material editor every time you begin a new simulation. One way to save yourself the time in defining material properties is to write a script that will accomplish this task as shown in Figure 2. This is just one example of how Python scripting can be used to speed up the process.

 

Figure 2 – Simple material script

Figure 3 – Pipe with three different materials

 

Why is Automation important?

By using the method of just changing lines of code and not manually creating each one of the changes in Abaqus, the process may be expedited, and in some cases significantly. Let us assume you need to apply several loading and boundary conditions on various sections of a complex geometry to determine how deflection changes as a function of various model parameters. One way to do it would be recreating a part multiple times and then manually specify the necessary changes. Doing each model separately can prove to be tedious work and can open many opportunities to make mistakes and many times these are hard to identify and even harder to diagnose. A more sophisticated and efficient way of performing the same tasks would be to write a Python script to automate this process. Using a script, you can quickly change the value of the variable and rerun the script in loop as many times as you want until you get the desired results. An initial verification of the script would be necessary to ensure it was correctly written and provides the desired results. However, once verified, there is a greater level of confidence and therefore quality in future results versus the process of manually making changes to the Abaqus/CAE model or input file directly.

Conclusion

Using the Python scripting aspect in Abaqus could make the life of an analyst or engineer much easier when used correctly. You can do just about anything in a script that you can do in the Abaqus/CAE GUI. Once you can script a basic simulation you will be able to move on to more complex analysis that would only be feasible with a script such as making automated tasks when creating the simulation or performing repetitive tasks. The customization that is possible with Python scripting can be changed to fit the user’s needs. The result of automating an Abaqus workflow using Python is a reduction in analysis time and an increase in the quality of the analysis particularly for complex analysis workflows or those involving many repetitive and tedious tasks.

Here at VIAS3D, we use various scripting methods to ensure that we give the best solution to customers so they can make faster decisions. In addition, VIAS3D offers “Introduction to Abaqus Scripting” course that covers basic aspects of the Abaqus Scripting Interface and Python’s syntax.

If you want to have a better understanding on how to use scripting in Abaqus, please do not hesitate to contact us.

About VIAS3D

VIAS3D engineering and simulation team combines decades of analytical and design experience. They have successfully helped to design various products from many industries for strength, stability, rigidity, and fatigue endurance. Our design and analysis capabilities are accomplished through advanced engineering modeling techniques such as Finite Element Analysis (FEA) using Abaqus, Computational Fluid Dynamics (CFD), and other tools.

Using these advanced tools, we can capture complex design features and nonlinearities arising from materials, geometry, and surface interactions to simulate designs and predict their response before they are brought in production.

To Know more Please email us at [email protected] or drop a message at: https://www.linkedin.com/in/arinc16/

Contributors:

Miguel Lopez, B.S., FEA Engineering Intern at VIAS3D. His professional interests lie in the development and design of new mechanical structures. He is going into his senior year with experience in CAD software and coding experience with MatLab and Python. He will graduate Spring 2022 with a Bachelor of Science in Mechanical Engineering from the Letourneau University

Georgiy Makedonov, M.S., is an FEA Engineer at VIAS3D has over 4 years of industrial experience in finite element analysis simulation, technical support, and consulting. His professional interest involves designing, developing, and evaluation of rigid pipeline systems, teaching, and FEA analysis using Simulia Abaqus. He holds Master of Science in Mechanical and Subsea Engineering from University of Houston.

References:

[1] Puri, G. M. (2011). Python scripts for Abaqus: Learn by example.

 

 

Leave a Reply

Close Menu