TAGGED: apdl, convergence-problem, design-optimization, energy, probe, workbench
-
-
May 10, 2023 at 6:04 amMd_SalemSubscriber
Hi 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 pmdloomanAnsys Employee
-
May 14, 2023 at 5:52 pmMd_SalemSubscriber
I 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 pmMd_SalemSubscriber
Well, 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 pmdloomanAnsys Employee
If 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 amMd_SalemSubscriber
Hi 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 pmMd_SalemSubscriber
Well, 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 pmErik KostsonAnsys Employee
Hi
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 pmdloomanAnsys Employee
Yes, 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 pmdloomanAnsys Employee
Your 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 amMd_SalemSubscriber
I 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 pmdloomanAnsys Employee
There 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 amMd_SalemSubscriber
Dear 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 pmdloomanAnsys Employee
Referring 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)
-
July 17, 2023 at 6:19 pmSheref haddadSubscriber
Hello @Dave,
I am writing APDL code inside the workbench, and I need to select some nodes in a plan at some distance from the origin in the Z axes. The problem is that distance is parametrized with the name H. How can I write this line of code?
greetings
-
-
July 18, 2023 at 10:29 amAshish KhemkaForum Moderator
Hi Sheref,
Can you please create a new post for your query?
Regards,
Ashish Khemka
-
July 18, 2023 at 8:38 pmSheref haddadSubscriber
Hi Ashish,
excuse me for such way to contact you , but I don't know why I am blocked from starting new post ! would you please help me with tha issue
regards
-
-
July 19, 2023 at 10:40 amAshish KhemkaForum Moderator
Hi,
I did check and you are not blocked from creating new posts. Please share a snapshot of the issue while creating a new post.
You can use NSEL command to select the nodes based on location (X, Y, or Z). Also, use of Named Selections Worksheet is an easy option to do so.
Regards,
Ashish Khemka
-
- The topic ‘how to assign energy probe using APDL command ?’ is closed to new replies.
- 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
-
1191
-
513
-
488
-
225
-
209
© 2024 Copyright ANSYS, Inc. All rights reserved.