General Mechanical

General Mechanical

Pressure load using APDL command

TAGGED: 

    • Anirudh Thantry
      Subscriber

      I have created a 3D wing with its half span as a parameter in Design modeler. Now i want to apply pressure load with elliptical distribution on the bottom surface of the wing. I am not much familiar with APDL scripting, so can somebody help me with this... 

    • Bill Bulat
      Ansys Employee

      The APDL commands below are from an input file that defines an elliptical pressure patch that acts on the top face of a block and is then incrementally relocated along the x direction. Try copying them into a text file, then read that text file into MAPDL with the /INPUT command. I hope this helps you get started. Mind you, it looks like I created this back in 2017 and I haven't tested it to see if it still works, but my hunch is that it does.

      Best,

      Bill

       

       

      finish
      /clear
       
      /sys,del file*.png
       
      /vup,1,z ! VIEW SETTINGS. SPECIFIES GLOBAL CARTESIAN
      ! COORDINATE SYSTEM REFERENCE ORIENTATION.
      ! THIRD FIELD DEFINES Z VERTICAL UPWARD,
      ! Y HORIZONAL TO THE RIGHT, X OUT OF THE SCREEN
      ! YOU SHOULD USE A VIEW OTHER THAN THE /VIEW
      ! DEFAULT OF (0,0,1).
      /view,1,1,3,1 ! DEFINES VIEWING DIRECTION FOR THE DISPLAY
      /vscale,1,2.5 ! SCALES THE LENGTH OF DISPLAYED VECTORS
       
      C***************
      C*** PARAMETERS
      C***************
       
      r_ellipse=1 ! ELLIPTICAL BOUNDARY (MAJOR) RADIUS 101717 
      !r_ellipse=0.4 ! ELLIPTICAL BOUNDARY (MAJOR) RADIUS 102017
       
      a=1.5 ! BLOCK EDGE LENGTH
      t=0.2 ! BLOCK THICKNESS
       
      ratio=0.5 ! ELLIPTICAL RATIO OF MINOR & MAJOR DIAMETERS 101717
      !ratio=0.75 ! ELLIPTICAL RATIO OF MINOR & MAJOR DIAMETERS 102017
       
      esz=a/25 ! MESH SIZE 101717 (RESULTED IN 392 CONTACT ELEMENTS)
      !esz=a/37 ! MESH SIZE 102017 (RESULTED IN 200 CONTACT ELEMENTS?)
       
      pmax=100 ! MAX PRESSURE AT MIDDLE OF ELLIPTICAL CONTACT PATCH 101717
      !pmax=40000 ! MAX PRESSURE AT MIDDLE OF ELLIPTICAL CONTACT PATCH 102017
       
      !*dim,ellip_coor_num,array,392,2,1 ! DIMENSION ARRAY TO CHECK COORDINATES
      ! AND ELEMENT NUMBERS 101717
       
       
      C**********
      C*** MODEL
      C**********
      /prep7
       
      wpcsys,-1,0 ! DEFINES WORKING PLANE LOCATION AND ORIENTATION
      ! BASED ON AN EXISTING COORDINATE SYSTEM.IF 2ND FIELD
      ! (WINDOW NUMBER) IS NEGATIVE, THE VIEWING DIRECTION 
      ! WILL NOT BE MODIFIED. 3RD FIELD IS COORDINATE SYSTEM NUMBER.
       
      cswpla,11,1,ratio ! DEFINES / CREATES A LOCAL ELLIPTICAL COORDINATE  
      ! SYSTEM AT THE ORIGIN OF THE WORKING PLANE.
       
      blocK,-a,a,-a,a,,-t ! CREATES BLOCK VOLUME BASED ON WORKING PLANE COORDINATES.
       
      et,1,185 ! MESH IT WITH SOME ELEMENTS
      esize,esz
      vmesh,all ! GENERATED NODES AND VOLUME ELEMENTS W/I VOLUMES.
       
      et,2,154 ! CREATE SURFACE EFFECT ELEMENTS ON ENTIRE z=0 SURFACE
      nsel,s,loc,z
      type,2
      esurf
       
      alls
      /shr,0.05 ! "SHRINK" ELEMENTS SLIGHTLY TO SEE SURF154s
      /ann,dele
      /tla,-0.25,0.90,Plate with SURF154 on Entire Surface
      eplot ! PLOT ELEMENTS TO CHECK
      /sho,png $eplo $/sho,close $/wait,1.5 ! HARD COPY OF SAME (IMAGE FILE)
      /shr ! TURN OFF SHRINK
       
      /wait,2
       
       
      C*******************************************************************
      C*** CREATE MACRO TO DEFINE ELLIPTICAL LOAD @ X LOCATION (ARG1)
      C*** MACRO NAME: mvng_elptcl_prs,mac
      C*** ARGUMENTS:
      C*** ARG1: X COORDINATE OF CENTER OF ELLIPTICAL PRESSURE DISTRIBUTION
      C*******************************************************************
      *cre,mvng_elptcl_prs,mac
       
      wpcs,-1,0 ! WP @ GLOBAL ORIGIN
      wpof,arg1 ! OFFSET WP ALONG ITS X AXIS (SPECIFIED BY ARGUMENT ARG1)
      cswp,11,1,ratio ! DEFINE ELLIPTICAL COORDINATE SYSTEM @ WP ORIGIN
       
      esel,s,ename,,154 ! SELECT SURFACE EFFECT ELEMENTS
      nsle ! AND THEIR NODES
      sfed,all,,pres ! DELETE PREEXISTING PRESSURE LOADS IF ANY
      nsel,r,loc,x,0,r_ellipse ! RESELECT NODES WITHIN ELLIPTICAL BOUNDARY
      esln,r,1 ! RESELECT SURF154s HAVING ALL THEIR NODES SELECTED
       
      *get,nelems,elem,,count ! nelems = # OF SELECTED SURF154 ELEMENTS
      elm=0 ! INITIALIZE ELEMENT NUMBER
      *do,i,1,nelems ! LOOP OVER ELEMENTS
       elm=elnext(elm) ! elm = NEXT HIGHEST ELEMENT NUMBER ABOVE WHAT elm WAS PREVIOUSLY
       *get,r_csys11,elem,elm,cent,x ! GET ELEMENT elm's "ELLIPTICAL" COORDINATE
       sfe,elm,,pres,,pmax*(1-(r_csys11/r_ellipse)**2) ! APPLY PRESSURE TO ELEMENT elm
      *enddo ! END DO LOOP
       
      alls ! SELECT ENTIRE MODEL BEFORE PROCEEDING
       
      *end ! END MACRO CREATION
       
      /psf,pres,,2 ! SHOW PRESSURES AS ARROWS
       
       
      *do,j,0,0.4,0.1 ! LOOP OVER X COORDINATE OF ELLIPTICAL PRESSURE DISTRIBUTION
       /ann,dele ! NEW ANIMATION FOR UPCOMING PLOT
       /tla,-0.25,0.90,elliptical pressure load centered at x = %j%
       mvng_elptcl_prs,j ! INVOKE MACRO (LOOP VARIABLE j PASSED TO MACRO TO LOCATE ELLIPTICAL PRESSURE DISTRIBUTION)
       eplo ! PLOT ELEMENTS w/PRESSURE ARROWS SHOWN
       /sho,png $eplo $/sho,close $/wait,1.5 ! HARD COPY OF SAME (IMAGE FILE)
      *enddo ! END DO LOOP

       

Viewing 1 reply thread
  • You must be logged in to reply to this topic.