EKILL Based on NLHIST tracker
In this example we show how to kill a single spring (COMBIN14) element based on the Z deformation of a remote point my_node.
Typically, the EKILL command can be used before solving a certain load step, so in order to use EKILL at a certain substep we will
make use of the NLHIST command (see https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v241/en/ans_cmd/Hlp_C_NLHIST.html) which lets us track e.g. the Z deformation of a remote point at every substep
Stop the solution once the tracked deformation value fulfills the stop_criterion in the NLHIST command.
Restart the analysis from that perticular substep and use EKILL on the COMBIN14 element.
Bonus tip! We have also added a table defining EKILL through the ELEM and TIME primary variable, hence if you know that at a certain time you would want to kill certain elements, this can be done with this table definition.
! Commands inserted into this file will be executed just prior to the ANSYS SOLVE command.
! These commands may supersede command settings set by Workbench.
! Active UNIT system in Workbench when this object was created: Metric (mm, kg, N, s, mV, mA)
! NOTE: Any data that requires units (such as mass) is assumed to be in the consistent solver unit system.
! See Solving Units in the help system for more information.
NROPT,FULL
RESCONTROL,,ALL,LAST
*DIM,addVals,ARRAY,3,1
addVals(3,1)=1 ! TOTAL END TIME
NLHIST,NSOL,rpDist,U,Z,my_node,,,,-2.5,-1
! -2.5 [mm] Z deformation = stop_value criteron
! -1 = stop_condition (stop if deformation Z in rpDist is less than or equal -2.5 mm)
SOLVE
*GET,quitTime,ACTIVE,,SET,TIME
addVals(2,1)=quitTime
FINISH
/POST1
SET,,,,,quitTime
*Get,resSub,ACTIVE,,SET,SBST
SET,,resSub-1
*GET,resSub_neg,ACTIVE,,SET,TIME
addVals(1,1)=resSub_neg
*CFOPEN,'C:\\temp\\temp_csv',csv
*VWRITE,addVals(1,1),addVals(2,1),addVals(3,1)
(F,F,F)
*CFCLOS
FINISH
/SOLU
ANTYPE,,RESTART
NLHIST,DEL,ALL
ESEL,S,ENAME,,14
ee=ELNEXT(0)
ee_neg=ee-1
ee_pos=ee+1
*DIM,A,ARRAY,3,1
*VREAD,A(1,1),'C:\\temp\\temp_csv',csv
(F,F,F)
*DIM,kill_,TABLE,3,3,1,ELEM,TIME
*TAXIS,kill_(1),1,ee_neg,ee,ee_pos
*TAXIS,kill_(1),2,A(1,1),A(2,1),A(3,1)
kill_(2,2)=1
ALLSEL
EKILL,%kill_%
SOLVE