-
-
May 26, 2022 at 5:52 pm
Ifexco
SubscriberHello guys Kindly assist. I am not used to coding. If for instance I want to kill all the elements in two separate bodies (flaw_1 and flaw_2) separately and in succession, how do I modify the code below such that the elements in flaw_1 is killed first in a time-step, after which those in flaw_2 are killed in the next time-step. I initially tried having a second Commands (APDL) and changing the element component to be killed to flaw_2, but the second APDL ends up overriding the first, killing only elements in flaw_2. I also tried using the element birth and death icon in Ansys mechanical enterprise but it didn't work. Perhaps, you may suggest to me a different way of doing it.
/com, #
*get,myncmls,active,,solu,ncmls ! cumulative number of load steps
*if,myncmls,gt,0,then ! if this is after the first
cmsel,s,flaw_1 ! ELEMENT component to be checked (This is for flaw 1)
nsle ! nodes on these elements
SELTOL,1.0e-12 ! stay within range below
! #########
nsel,r,s,eqv,234,2000000 ! re-select nodes with results above a value <<<
! #########
SELTOL ! selection tolerance back to default
*get,numnode,node,,count ! how many nodes with result above?
*if,numnode,gt,0,then
esln ! elements with any node selected
*get,numelem,elem,,count
*if,numelem,gt,0,then
ekill,all
*endif
*endif
allsel
*else
! if first load step, have result written to in-memory database
fini
/config,noeldb,0 ! write results into the database
/solu ! continue with solution
*endif
/com, #
/com -
May 27, 2022 at 6:18 pm
Mike Rife
Ansys EmployeePlease see the Details of the Commands Object in WB Mechanical - there is an option to chose which load step to apply the commands to. You can then write two commands objects; the first activated at the first load step, the second CO at the second load step.
Mike
-
May 30, 2022 at 12:45 pm
Ifexco
SubscriberThank you Mike. It worked!
-
- 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.
- 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
- whether have the difference between using contact and target bodies
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- User manual
- Colors and Mesh Display
- material damping and modal analysis
-
3778
-
2587
-
1831
-
1242
-
598
© 2023 Copyright ANSYS, Inc. All rights reserved.