TAGGED: apdl, convergence-problem, design-optimization, energy, probe, workbench
-
-
May 10, 2023 at 6:04 am
Md_Salem
SubscriberHi everyone,
I am working on direct structural optimization project with Workbench 22R1 where the optimizer is allowed to change the number of bolts in some structure for each design point (increase them or decrease them).
The objective of the aptimization is to minimize potential energy in all bolts. How can I enforce the solver at each design point to select all bolts (the number of them changes as an optimization parameter) and assign an energy probe to all of them, then minimize it?
Are there any APDL commands that can be used, or any tool that enforce the energy probe to select certain material for instant ? or any other solutions for this sistuation ? or is it possiple to use a pattern for the bolts configuration and assign the energy probe to this pattern ?
-
May 10, 2023 at 2:39 pm
Dave Looman
Ansys Employee-
May 14, 2023 at 5:52 pm
Md_Salem
SubscriberI appreciate your concern,
In your code, can I use "SOLID185" (which is the used element for the bolts) instead of "188" at the third line ?
Also, is the "sene" referring to general potential energy? I mean, in the case of working with some coupled field element, for example, will "sene" get the potential energy for such a coupled field element (electric, magnetic, thermal, ,..)
Regards
-
May 18, 2023 at 12:26 pm
Md_Salem
SubscriberWell, I used your code to develop the next code in which I applied harmonic analysis (55 steps) and selected the maximum set of the induced potential energy in order to parametrize it later and then minimize it :
/POST1
SET,LAST
ESEL,S,ENAME,,188
*DIM,potential_energy, ARRAY,55 !number of steps*DO, step,1,55,1
/SOLU
*GET,energy,sene,step,ITEM
potential_energy(step)=energy
*ENDDO
*GET,max_index,total_potential_energy,MAX
max_potential_energy = potential_energy(max_index)
*get,my_energy,ssum,,Item,max_potential_energybut unfortunately the resultant “my_energy” was 0 , what would be the result for such a failure ?
Regards.
-
-
May 14, 2023 at 7:10 pm
Dave Looman
Ansys EmployeeIf you are using solid185 for the bolt then it must be an actual geometric body which you could make a named selection for. Then the line esel,s,enam,,188 could be replaced by cmsel,s,name where "name" is the name you give the named selection. SENE is just structural strain energy, 1/2 int(stress*strain)dv
-
May 15, 2023 at 10:40 am
Md_Salem
SubscriberHi Dave,
What does "188" stand for ?
also in case of using any other coupeled field material such as piezoelectric material, How can I assign the potential energy for it ?
Regards
-
May 19, 2023 at 3:03 pm
Md_Salem
SubscriberWell, I used 185 (which is assigned for bolts only) instead of 188 and my_energy still =0 , is something wrong with the syntax of the code ?
Regards
-
-
May 15, 2023 at 12:11 pm
Erik Kostson
Ansys EmployeeHi
Q:What does “188” stand for ?
It stands for beam188 beam element (or short 188).
As for the other question soild226 (short 226), they have SENE as well, so the script to get that is the same as above but change the esel to select the 226 elements (coupled field):
esel,s,ename,,226 .
Finally inside mechanical we can post process strain energy with the user defined result (set expression ):
ENERGYPOTENTIAL
See the help manual for more info if needed.
Erik
-
May 15, 2023 at 2:43 pm
Dave Looman
Ansys EmployeeYes, to all your statements above. My example with selecting beam188 elements was intended to demonstrate how to use SSUM, not how to select the bolts. If you want to learn how to retrieve non-structural energy review the solid226 documenation in the APDL Elements Manual. It contains information like below:
-
May 18, 2023 at 1:22 pm
Dave Looman
Ansys EmployeeYour commands still select the beam elements, 188. Is that what you want. Your *get command in solution is not going to work. If you notice, my *get command was issued after creating an etable item in post1 and summing it with ssum. That's not going to be possible from within the solution module. Perhaps you didn't mean to issue /solu, but if your loop is to be executed from post1 then there should be a set command to store each result and etable/ssum commands like I did.
-
May 20, 2023 at 11:08 am
Md_Salem
SubscriberI tried to modify the code as next, , in addition, I tried to print out the potential_energy array to a text file as shown. The text file was created, but unfortunately empty. And also ‘my_energy’ is zero
/POST1
SET,LAST
ESEL,S,ENAME,,185*DIM,potential_energy,ARRAY,55 ! Number of steps
*DO, step, 1, 55, 1
/SOLU
*GET,energy,SENE,step,ITEM
potential_energy(step) = energy
*ENDDO*CFOPEN,my_file,TXT,C:\Users\MD\Desktop\energy\
*VWRITE, potential_energy(1:55),”%10.2F”
*CFCLOSE*GET, max_index, potential_energy, MAX
*GET, my_energy, ARRAY, potential_energy(max_index)regards
-
-
May 24, 2023 at 2:54 pm
Dave Looman
Ansys EmployeeThere could be other errors, but procedurally the script should be like this:
/POST1
ESEL,S,ENAME,,185*DIM,potential_energy,ARRAY,55 ! Number of steps
*DO, step, 1, 55, 1
set,,,,,,,step ! store results for set step
*GET,energy,SENE,step,ITEM
potential_energy(step) = energy*CFOPEN,my_file,TXT,C:\Users\MD\Desktop\energy\
*VWRITE, potential_energy(1:55),”%10.2F”
*CFCLOSE*ENDDO
I don't recognize the format of the two commands below. Are they based on the *GET command documentation?
*GET, max_index, potential_energy, MAX
*GET, my_energy, ARRAY, potential_energy(max_index)-
May 25, 2023 at 10:44 am
Md_Salem
SubscriberDear Dave,
I appreciate your cooperation, but unfortunately, when I applied your code, I received the next two warnings :
*** WARNING ***
Unknown label for *GET command= SENE
The *GET command is ignored.
*** WARNING ***
Unknown parameter name= ENERGY. A value of 7.888609052E-31 will be used.and hence, the file my_energy was created but empty without any data .for the last two lines of the code I wrote, I was trying to get the maximum value of the "potential_energy" array to the parameter "my_energy"Regards
-
-
May 25, 2023 at 1:52 pm
Dave Looman
Ansys EmployeeReferring back to my May 10 posting you have left out the etable and ssum commands and your *get command is incorrect (see below.)
*DO, step, 1, 55, 1
set,,,,,,,step ! store results for set stepetable,energy,sene
ssum
*get,my_energy,ssum,,ITEM,energy
*GET,energy,SENE,step,ITEM ! this command was incorrect (see above)
-
- 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
- An Unknown error occurred during solution. Check the Solver Output…..
- What is the difference between bonded contact region and fixed joint
- User manual
- 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
- material damping and modal analysis
- Colors and Mesh Display
-
5162
-
3273
-
2445
-
1308
-
956
© 2023 Copyright ANSYS, Inc. All rights reserved.