General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

how to select elements in elliptical shape in a cylinder using ansys apdl?

    • Ikram DJABROUHOU
      Subscriber

      Dear all,

      I am working on damage detection on a composite cylinder. the idea is to insert damage with an elliptical shape in a cylinder in a different location and use the buckling response as a damage indicator that later will be inserted into a CNN-based algorithm for damage detection. I have modeled the cylinder and now want to insert the elliptical shape damage (which is selecting elements in a defined elliptical shape and assigning them a low rigidity). unfortunately, I didn't succeed till now.

      Any hints or ideas are welcome
      Ps: the code I did is below

      FINISH

      FINISH

      /CLEAR, NOSTART ! NOSTART avoids reading again START.ANS
      /CWD,'D:\Damage_Detection_CNN\NewLastCode'
      /RGB,INDEX,100,100,100,0
      /RGB,INDEX,0,0,0,15
      /PREP7
      /TRIAD,LBOT
      /VIEW,1,1,1,1
      /ANGLE,1
      /VUP,,Z
      /UNITS,SI
      /ESHAPE,0
      *AFUN,DEG ! Use degrees for input and output of parameter ANGular functions
      DmageON = 1 ! 1: Damage is activated
      ! 0: Damage is Desactivated
      C*** Input data
      C*** RUN

      *SET, PI, 3.14159265359

      ! Ler variaveis externas
      PARRES, change, variaveis.txt

      Dc= 0.05 ! [m] Diameter of cylinder
      Lc= 0.3 ! [m] Length of the cylinder
      Th= 0.00012 ! [m] Wall thickness
      ElSiz = 2e-3 ! [mm] Element Size

      C*** Material proprties ************************************

      *SET,N_camadas,10
      *SET,ANG1,45.0000
      *SET,ANG2,0.0000
      *SET,ANG3,-45.0000
      *SET,ANG4,0.0000
      *SET,ANG5,45.0000
      *SET,ANG6,45.0000
      *SET,ANG7,0.0000
      *SET,ANG8,-45.0000
      *SET,ANG9,0.0000
      *SET,ANG10,45.0000

      *SET,E1,101860000000.0000
      *SET,E2,3410000000.0000
      *SET,E3,3410000000.0000
      *SET,v12,0.2900
      *SET,v23,0.2900
      *SET,v13,0.2900
      *SET,G12,7560000000.0000
      *SET,G23,1321705426.3566
      *SET,G13,7560000000.0000
      *SET,rho,1510.0000
      *SET,E_Layer,Th

      C*** Force ************************************
      *SET,Fcomp,-1

      *SET,RedictioRatio,2000

      C*** Failure Criteria ************************************
      FC,1,S,XTEN,1363.49e6
      FC,1,S,YTEN,5.86e6
      FC,1,S,ZTEN,5.86e6
      FC,1,S,XCMP,-572.27e6
      FC,1,S,YCMP,-102e6
      FC,1,S,ZCMP,-102e6
      FC,1,S,XY,200.61e6
      FC,1,S,YZ,200.61e6
      FC,1,S,XZ,200.61e6
      FC,1,S,XYCP,-1
      FC,1,S,YZCP,-1
      FC,1,S,XZCP,-1
      FC,1,EPEL,XTEN,
      FC,1,EPEL,YTEN,
      FC,1,EPEL,ZTEN,
      FC,1,EPEL,XCMP,
      FC,1,EPEL,YCMP,
      FC,1,EPEL,ZCMP,
      FC,1,EPEL,XY,
      FC,1,EPEL,YZ,
      FC,1,EPEL,XZ,

      FC,2,S,XTEN,1363.49e6
      FC,2,S,YTEN,5.86e6
      FC,2,S,ZTEN,5.86e6
      FC,2,S,XCMP,-572.27e6
      FC,2,S,YCMP,-102e6
      FC,2,S,ZCMP,-102e6
      FC,2,S,XY,200.61e6
      FC,2,S,YZ,200.61e6
      FC,2,S,XZ,200.61e6
      FC,2,S,XYCP,-1
      FC,2,S,YZCP,-1
      FC,2,S,XZCP,-1
      FC,2,EPEL,XTEN,
      FC,2,EPEL,YTEN,
      FC,2,EPEL,ZTEN,
      FC,2,EPEL,XCMP,
      FC,2,EPEL,YCMP,
      FC,2,EPEL,ZCMP,
      FC,2,EPEL,XY,
      FC,2,EPEL,YZ,
      FC,2,EPEL,XZ,


      C*** Assigne Material Proprties ************************************


      MP,EX,1,E1
      MP,EY,1,E2
      MP,EZ,1,E3
      MP,PRXY,1,V12
      MP,PRYZ,1,V23
      MP,PRXZ,1,V13
      MP,GXY,1,G12
      MP,GYZ,1,G23
      MP,GXZ,1,G13
      MP,DENS,1,rho

      E11=RedictionRatio*E1
      E22=RedictionRatio*E2
      E33=RedictionRatio*E3
      G122=RedictionRatio*G12
      G232=RedictionRatio*G23
      G132=RedictionRatio*G13

      MP,EX,2,E11
      MP,EY,2,E22
      MP,EZ,2,E33
      MP,PRXY,2,V12
      MP,PRYZ,2,V12
      MP,PRXZ,2,V12
      MP,GXY,2,G122
      MP,GYZ,2,G232
      MP,GXZ,2,G132
      MP,DENS,2,RedictionRatio*2100


      C*** Material Composite ************************************

      ET,1,SHELL281
      SECT,1,SHELL,,
      SECDATA, E_Layer,1,ANG1,3
      SECDATA, E_Layer,1,ANG2,3
      SECDATA, E_Layer,1,ANG3,3
      SECDATA, E_Layer,1,ANG4,3
      SECDATA, E_Layer,1,ANG5,3
      SECDATA, E_Layer,1,ANG6,3
      SECDATA, E_Layer,1,ANG7,3
      SECDATA, E_Layer,1,ANG8,3
      SECDATA, E_Layer,1,ANG9,3
      SECDATA, E_Layer,1,ANG10,3
      secoffset,MID
      seccontrol,,,, , , ,
      SECPLOT, 1,,,

      ET,2,SHELL281
      SECT,2,SHELL,,
      SECDATA, E_Layer,2,ANG1,3
      SECDATA, E_Layer,2,ANG2,3
      SECDATA, E_Layer,2,ANG3,3
      SECDATA, E_Layer,2,ANG4,3
      SECDATA, E_Layer,2,ANG5,3
      SECDATA, E_Layer,2,ANG6,3
      SECDATA, E_Layer,2,ANG7,3
      SECDATA, E_Layer,2,ANG8,3
      SECDATA, E_Layer,2,ANG9,3
      SECDATA, E_Layer,2,ANG10,3
      secoffset,MID
      seccontrol,,,, , , ,

      C*** Cylinder Geomtry ************************************

      K,1,0.,0.,0. ! CENT Point
      K,2,0.,0.,Lc ! AXIS Point
      K,3,0.,Dc/2,0. ! ZERO Point
      CIRCLE,1,Dc/2,2,3,360 ! CIRCLE, PCENT, RAD, PAXIS, PZERO, ARC, NSEG
      L,1,2 ! Line for Path in following ADRAG --> Line N.5 (4 Lines used for the CIRCLE)
      ADRAG,ALL,,,,,,5

      C*** Meshing (Shells) ************************************

      ASEL,ALL
      ESIZE,ElSiz
      AMESH,ALL

      C*** Damage ************************************

      !pos_z = Lc/3
      !a = 0.02
      !b = 0.01
      !theta = 10
      !r = 1

      *IF,DmageON,EQ,1,then
      LOCAL,11,1,0,Dc/2,pos_z,,,theta,r
      CSYS, 11
      ESEL, S, CENT, 0.01, 0.00001, b, , , , 0
      !ESEL, S, CENT, Y, 0, (b/(10*r)),,,,0
      EMODIF,ALL,MAT,2,,,,,,
      EMODIF,ALL,Type,2,,,,,
      EMODIF,ALL,SECT,2,,,,,
      ESEL,ALL
      !CSYS,0
      *EndIF
      Allsel,all
      Finish

      C*** Analysis ************************************

      /SOL
      Lsel,s,line,,1,4
      DL,ALL, ,ALL,
      Allsel,all
      !! Analysis
      ANTYPE,0
      Lsel,s,line,,6
      Lsel,a,line,,9
      Lsel,a,line,,11
      Lsel,a,line,,13
      NSLL, S, 1
      F,all,FZ,Fcomp

      Allsel,All

      PSTRES,1
      SOLVE
      FINISH
      /SOLUTION
      ANTYPE,1
      BUCOPT,LANB,20,0,0,CENTER
      SOLVE
      FINISH

      /POST1
      /output,
      /output,'resultado',txt

      SET,LIST
      /out



    • dlooman
      Ansys Employee

      To create an ellipsoidal volume you can first create a sphere and then scale it with vlscale.  The scale factors are in the active coordinate system so you could create a coordinate system aligned with the tilted axis you show in the sketch.  Then if you want to create an ellipsoidal cavity you could use VSBV to subtract the ellipsoidal volume from the cylindrical volume.

    • Ikram DJABROUHOU
      Subscriber

      Dear Dave,

      Thanks for the valuable feedback, I would also bother with other questions. What if I want to select a set of elements with an elliptic shape is there any method you recommend ?? 

       

    • dlooman
      Ansys Employee

      You can create an elliptical coordinate system with PAR1 and PAR2 of the LOCAL command.  I've never used an elliptical coordinate system to select entities, but you could try with a simple test model:

      csys,12   ! elliptical coordinate system

      nsel,s,loc,x,value  ! hard to say what this will do.

      esln,s,1                       ! select elements with all nodes selected

      allsel

    • Ikram DJABROUHOU
      Subscriber

      Thanks Dave,

      The idea you proposed works great. so basically I did place a local coordinate and rotate then I used Esel to select the required elements as Bellow:   

      LOCAL,12,1,0,Dc/2,pos_z,,,theta,r 
         CSYS, 12
        ESEL, S, CENT, z, -b/r,b/r
        ESEL, r, CENT, x, -b,b

      Many thanks again for your valuable feedback

       

       

    • dlooman
      Ansys Employee

      You've done something maybe no one has ever done with Ansys!  

    • Ikram DJABROUHOU
      Subscriber

      This was performed thanks to your help

Viewing 6 reply threads
  • The topic ‘how to select elements in elliptical shape in a cylinder using ansys apdl?’ is closed to new replies.