-
-
July 19, 2023 at 7:48 pm
35020306
SubscriberDear all. I am currently working on a model of a cable-stayed bridge as shown above. As part of the modelling process, I would like to simulate sagging effect on the cables by calculating modified elasticity modulus for every cable. I figured I could do it more efficiently by using an APDL command in the analysis. My idea is to create a txt file that is comprised of two columns with the first column comprised of the stay cable ID and the second column comprised of the calculated values of the elasticity modulus. Roughly speaking, the file would look like this:
Cable ID | Modified Elasticity Modulus (MPa)
EC1 | 174000
EC2 | 160000
I would then make named selections of each cable pair (e.g. "EC1", "EC2", etc) in Mechanical. The APDL command script would read the cable ID in the first column, select the appropriate named selection, and then change the elasticity modulus of the elements in the named selection with the values in the second column. So far I've come up with this script but it still doesn't work.
/inquire,my_lines,lines,D:\Sagging_Calc,txt
*DIM,STRING_DATA,string,128,my_lines
*DIM,ARRAY_DATA,array,my_lines
*SREAD,STRING_DATA(1),D:\Sagging_Calc,txt
!Read from files
*DO,AR80,1,my_lines
AR70 = strpos(STRING_DATA(1,AR80),'')
ARRAY_DATA(AR80) = valchr(strsub(STRING_DATA(1,AR80),1,AR70))
AR71 = strleng(STRING_DATA(1,AR80))-AR70+1
STRING_DATA(1,AR80) = strsub(STRING_DATA(1,AR80),AR70,AR71)
*ENDDO
!Change the Elasticity Modulus
*DO,I,1,my_lines,1
CMSEL,S,STRING_DATA(I)
MP,EX,,ARRAY_DATA(I)
CMSEL,U,STRING_DATA(I)
*ENDDO
CMSEL,allFrom the result of the analysis, it seems that the problem is in the last block of code. I couldn't get CMSEL to recognize the stay cable ID which is stored in STRING_DATA. Any help would be appreciated.
-
July 20, 2023 at 9:57 am
Ashish Kumar
Forum ModeratorHi,
Please see if the following link helps: How to change material properties or material assignment in between steps (ansys.com)
Regards,
Ashish Kumar
-
July 20, 2023 at 11:08 am
Rahul Kumbhar
Ansys EmployeeHi,
Can you check if the first do loop has filled the array successfully?
-
July 20, 2023 at 1:55 pm
35020306
SubscriberHow do you check the content of the array?
-
-
- You must be logged in to reply to this topic.

Boost 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.
- Solver Pivot Warning in Beam Element Model
- Saving & sharing of Working project files in .wbpz format
- Understanding Force Convergence Solution Output
- User manual
- 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
-
7608
-
4440
-
2953
-
1427
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.