General Mechanical

General Mechanical

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

Help regarding a portion of the code used in example in ANSYS APDL

    • watchdog23
      Subscriber

      "


       


      yc = 0.0


      xc = 5.0


      nsel, s, loc, x,   0  , xc


      esln,s,


      esel, r, cent, y, -1e-3, 1e-3


       


      cm, cenelem, elem


      nelem = 1000


      iel = 0


      Phi = 0.0


      Psi = 0.0


      *do, i, 1, nelem, 1


       iel = elnext(iel)


       *if, iel, ne, 0, then


        *do, j, 1, 4, 1


          nd = nelem(iel,j)


          Phi = ny(nd) - yc


          Psi = nx(nd) - xc


          xfdata, ENRICH1, LSM, iel, nd, Phi, Psi


        *enddo


       *endif


      *enddo "


       


      This a code of an XEFM based stationary crack analysis in ANSYS APDL. I couldn't understand this looping section of the code and would mean a lot if someone could explain what is it this portion of the code does. 

    • jpasquerell
      Ansys Employee

      parameter iel is the element number to be processed for that loop.  It is initialized to 0 before the loop.  This is a method to loop thru a set of numbers that may not be sequential (1,2,3,4) or not be equally spaced (2,4,6,8). It will do up to 1000 loops and if there are less than 1000 elements the elnext get function will return 0 if there are no higher element numbers/


      Apparently xfdata is a macro file (as I do not recognize it as an ANSYS command) so each loop calls xfdata with the current parameter values of ENRICH1, LSM, iel, nd, Phi, and Psi.

    • sk_cheah
      Subscriber

      Looks like Phi and Psi are relative coordinate values (ref for NY and NX). XFDATA is documented here.


      Kind regards,
      Jason

Viewing 2 reply threads
  • The topic ‘Help regarding a portion of the code used in example in ANSYS APDL’ is closed to new replies.