-
-
April 13, 2022 at 12:22 pmakashp81995SubscriberApril 20, 2022 at 6:37 amAshish KhemkaForum Moderator
Right-click on the stress result item and then export the result. You will get an excel sheet of node ids and corresponding stress values.
Regards Ashish Khemka
April 20, 2022 at 8:19 amakashp81995SubscriberHi @akhemka Thank you for your response. I think it would help me do it manually.
I am trying to get the node ID with the maximum stress value using Python for ACT. And I might have to get the same for hundreds of results. So using this method suggested by you would create hundreds of files. In order to avoid this, I am looking for a Python API/Command that would give me the node ID with the maximum stress value without having to export the stress results.
Thanks in advance Akash Purushothaman
April 20, 2022 at 9:37 ampmaronehAnsys Employeein order to help you out, I would first need to know how you have retrieved the max stress values ? Indeed there are several ways to do that:
Through the automation API: insert a stress result and get the maximum value from the details view (ExtAPI.DataModel.Project.Model.Analyses[0].Solution.AddNormalStress() etc)
Through the result reader (ExtAPI.DataModel.Project.Model.Analyses[0].GetResultsData())
If you could share your script, it would help.
May 10, 2022 at 6:46 ammonSLSubscriberHi
I'd be interested as well on understanding how to get the max stress value using ACT and IronPython. Would you have any other updated about it?
Thanks M
May 10, 2022 at 1:23 pmakashp81995SubscriberI've used the first method that you'd mentioned about. Code below:
model = ExtAPI.DataModel.Project.Model
solution = model.Analyses[0].Solution
new_stress = solution.AddNormalStress new_stress.EvaluateAllResults max_stress = new_stress.Maximum
In this method I've retrieved the maximum stress value.
Thanks & Regards Akash Purushothaman
May 10, 2022 at 2:03 pmpmaronehAnsys EmployeeThanks for the additional information . In such case you can make use of the PlotData property from the result plot to loop through the data table and find the nodes that have the maximum stress value. Below is a script based on yours. Also adding a screenshot so that it's easier to read.
# Create Normal Stress Plot
model = ExtAPI.DataModel.Project.Model
solution = model.Analyses[0].Solution
new_stress = solution.AddNormalStress new_stress.EvaluateAllResults max_stress = new_stress.Maximum
# Extract data from plot
plot_data = new_stress.PlotData
nodes = plot_data ['Node']
result_value = plot_data ['Values']
# Handle unit conversion
import units
currentLengthUnit=ExtAPI.DataModel.CurrentUnitFromQuantityName('Stress')
scale_factor=units.ConvertUnit(1.,currentLengthUnit,result_value.Unit)
for index in range(len(nodes)):
if result_value[index] == max_stress.Value*scale_factor:
print(nodes[index])
May 10, 2022 at 4:02 pmakashp81995SubscriberThank you..
Thank you.. it works for stress values..
It doesnt work for contact pressure.. what changes do I need to make??
Thanks in advance
Akash Purushothaman
May 11, 2022 at 7:46 amErik KostsonAnsys Employee
Have in mind that we do not provide extensive help and codes/scripts for act application - we can advice only.
So for contact pressure there are multiple ways:
The first one is to use the contact tool:
ctool=solution.AddContactTool pres=ctool.AddPressure pres.....
etc.... (so do similar things as the previous code that was given by my colleague and that you used).
So another way of doing what you want is to use a user defined result scoped to the contact elements (say conta174) and use the pressure results (CONTPRES - results).
Example below:
model = ExtAPI.DataModel.Project.Model
solution = model.Analyses[0].Solution
useres=solution.AddUserDefinedResult you then need to select by Element Name ID, set elements to the contact elements, units, etc..
etc....
....
All the best
Erik
Viewing 8 reply threads- The topic ‘how to get the node id of the maximum stress/strain using ACT?’ is closed to new replies.
Ansys Innovation SpaceTrending discussions- Problem with access to session files
- Ayuda con Error: “Unable to access the source: EngineeringData”
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- Geometric stiffness matrix for solid elements
- How to select the interface delamination surface of a laminate?
- How to apply Compression-only Support?
- Timestep range set for animation export
- Image to file in Mechanical is bugged and does not show text
- SMART crack under fatigue conditions, different crack sizes can’t growth
Top Contributors-
1191
-
518
-
488
-
225
-
209
Top Rated Tags© 2024 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-
The Ansys Learning Forum is a public forum. You are prohibited from providing (i) information that is confidential to You, your employer, or any third party, (ii) Personal Data or individually identifiable health information, (iii) any information that is U.S. Government Classified, Controlled Unclassified Information, International Traffic in Arms Regulators (ITAR) or Export Administration Regulators (EAR) controlled or otherwise have been determined by the United States Government or by a foreign government to require protection against unauthorized disclosure for reasons of national security, or (iv) topics or information restricted by the People's Republic of China data protection and privacy laws.