-
-
April 13, 2022 at 12:22 pm
akashp81995
SubscriberApril 20, 2022 at 6:37 amAshish Khemka
Forum 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 amakashp81995
SubscriberHi @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 ampmaroneh
Ansys 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 ammonSL
SubscriberHi
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 pmakashp81995
SubscriberI'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 pmpmaroneh
Ansys 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 pmakashp81995
SubscriberThank 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 Kostson
Ansys 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- You must be logged in to reply to this topic.
Ansys Innovation SpaceBoost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.Â
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
Trending discussions- Saving & sharing of Working project files in .wbpz format
- Solver Pivot Warning in Beam Element Model
- Understanding Force Convergence Solution Output
- An Unknown error occurred during solution. Check the Solver Output…..
- What is the difference between bonded contact region and fixed joint
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- whether have the difference between using contact and target bodies
- Defining rigid body and contact
- Colors and Mesh Display
- A solver pivot warning or error has been detected
Top Contributors-
8762
-
4658
-
3151
-
1678
-
1456
Top Rated Tags© 2023 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.
-