Sunday 3 October 2010

Bicycle Example


Now we will return to the analysis of the bike frame. The steps which you completed in the verification example will not be explained in great detail, therefore use the verification example as a reference as required. We will be combining the use of the Graphic User Interface (GUI) with the use of command lines.
Recall the geometry and dimensions of the bicycle frame:
Bike Geometry


Preprocessing: Defining the Problem


  1. Clear any old ANSYS files and start a new fileUtility Menu > File > Clear and Start New
  2. Give the Example a Title
    Utility menu > File > Change Title
  3. Defining Some VariablesWe are going to define the vertices of the frame using variables. These variables represent the various lengths of the bicycle members. Notice that by using variables like this, it is very easy to set up a parametric description of your model. This will enable us to quickly redefine the frame should changes be necessary. The quickest way to enter these variables is via the 'ANSYS Input' window which was used above to input the command line codes for the verification model. Type in each of the following lines followed by Enter.
    x1 = 500
    x2 = 825
    y1 = 325
    y2 = 400
    z1 = 50
  4. Enter Keypoints
  5. For this space frame example, these keypoints are the frame vertices.
    • We are going to define 6 keypoints for this structure as given in the following table (these keypoints are depicted by the circled numbers in the above figure):
      keypointcoordinate
      xyz
      10y10
      20y20
      3x1y20
      4x100
      5x20z1
      6x20-z1
    • Now instead of using the GUI window we are going to enter code into the 'command line'. First, open the 'Preprocessor Menu' from the 'ANSYS Main Menu'. The preprocessor menu has to be open in order for the preprocessor commands to be recognized. Alternatively, you can type /PREP7 into the command line. The command line format required to enter a keypoint is as follows:
      K, NPT, X, Y, Z
      where, each Abbreviation is representative of the following:
      Keypoint, Reference number for the keypoint, coords x/y/z
      For a more detailed explanation, type help k into the command lineFor example, to enter the first keypoint type:
      K,1,0,y1,0
      into the command line followed by Enter.As with any programming language, you may need to add comments. The exclamation mark indicates that anything following it is commented out. ie - for the second keypoint you might type:
      K,2,0,y2,0 ! keypoint, #, x=0, y=y2, z=0 
    • Enter the 4 remaining keypoints (listed in the table above) using the command line
    • Now you may want to check to ensure that you entered all of the keypoints correctly:
      Utility Menu > List > Keypoints > Coordinates only
      (Alternatively, type 'KLIST' into the command line)
    • If there are any keypoints which need to be re-entered, simply re-enter the code. A previously defined keypoint of the same number will be redefined. However, if there is one that needs to be deleted simply enter the following code:
      KDELE,#
      where # corresponds to the number of the keypoint.
    In this example, we defined the keypoints by making use of previously defined variables like y1 = 325. This was simply used for convenience. To define keypoint #1, for example, we could have alternatively used the coordinates x = 0, y = 325, z = 0.
  6. Changing Orientation of the Plot
    • To get a better view of our view of our model, we'll view it in an isometric view:
    • Select Utility menu bar > PlotCtrls > Pan, Zoom, Rotate...'
      Pan-Zoom-Rotate
      • In the window that appears (shown left), you have many controls. Try experimenting with them. By turning on the dynamic mode (click on the checkbox beside 'Dynamic Mode') you can use the mouse to drag the image, translating and rotating it on all three axes.
      • To get an isometric view, click on 'Iso' (at the top right). You can either leave the 'Pan, Zoom, Rotate' window open and move it to an empty area on the screen, or close it if your screen is already cluttered.
  7. Create Lines
  8. We will be joining the following keypoints together:
    linekeypoint
    1st2nd
    112
    223
    334
    414
    535
    645
    736
    846

    Again, we will use the command line to create the lines. The command format to create a straight line looks like:
    L, P1, P2 
    Line, Keypoint at the beginning of the line, Keypoint at the end of line
    For example, to obtain the first line, I would write: ' L,1,2 '
    Note: unlike 'Keypoints', 'Lines' will automatically assign themselves the next available reference number.
    • Enter the remaining lines until you get a picture like that shown below.
    • Again, check to ensure that you entered all of the lines correctly: type ' LLIST ' into the command line
    • If there are any lines which need to be changed, delete the line by typing the following code: ' LDELE,# ' where # corresponds to the reference number of the line. (This can be obtained from the list of lines). And then re-enter the line (note: a new reference number will be assigned)You should obtain the following:
      Bike Frame Outline
  9. Define the Type of Element
    Preprocessor > Element Type > Add/Edit/Delete > AddAs in the verification model, define the type of element (pipe16). As in the verification model, don't forget to change Option K6 'Include Output' to obtain extra force and moment output.

  10. Define Geometric Properties
    Preprocessor > Real Constants > Add/Edit/DeleteNow specify geometric properties for the elements
    Outside diameter    OD:   25
    Wall thickness TKWALL: 2

  11. Element Material Properties
  12. To set Young's Modulus and Poisson's ratio, we will again use the command line. (ensure that the preprocessor menu is still open - if not open it by clicking Preprocessor in the Main Menu)
    MP, LAB, MAT, C0
    Material Property,Valid material property label, Material Reference Number, value
    • To enter the Elastic Modulus (LAB = EX) of 70000 MPa, type: ' MP,EX,1,70000 '
    • To set Poisson's ratio (PRXY), type ' MP,PRXY,1,0.33 '
  13. Mesh Size
  14. As in the verification model, set the element length to 20 mmPreprocessor > Meshing > Size Cntrls > ManualSize > Lines > All Lines
  15. Mesh
  16. Now the frame can be meshed.
    • In the 'Preprocessor' menu select 'Mesh' > 'Lines' and click 'Pick All' in the 'Mesh Lines' Window
    Saving Your JobUtility Menu > File > Save as...

Solution Phase: Assigning Loads and Solving

Close the 'Preprocessor' menu and open up the 'Solution' menu (from the same 'ANSYS Main Menu').
  1. Define Analysis Type
  2. Solution > Analysis Type > New Analysis... > Static
  3. Apply Constraints
  4. Once again, we will use the command line. We are going to pin (translational DOFs will be fixed) the first keypoint and constrain the keypoints corresponding to the rear wheel attachment locations in both the y and z directions. The following is the command line format to apply constraints at keypoints.
     DK, KPOI, Lab, VALUE, VALUE2, KEXPND, Lab2, Lab3, Lab4, Lab5, Lab6
    Displacement on K, K #, DOF label, value, value2, Expansion key, other DOF labels
    Not all of the fields are required for this example, therefore when entering the code certain fields will be empty. For example, to pin the first keypoint enter:
    DK,1,UX,0,,,UY,UZ
    The DOF labels for translation motion are: UX, UY, UZ. Note that the 5th and 6th fields are empty. These correspond to 'value2' and 'the Expansion key' which are not required for this constraint. Also note that all three of the translational DOFs were constrained to 0. The DOFs can only be contrained in 1 command line if the value is the same.To apply the contraints to Keypoint 5, the command line code is:
    DK,5,UY,0,,,UZ
    Note that only UY and UZ are contrained to 0. UX is not constrained. Again, note that the 5th and 6th fields are empty because they are not required.
    • Apply the constraints to the other rear wheel location (Keypoint 6 - UY and UZ).
    • Now list the constraints ('DKLIST') and verify them against the following:List of Displacement Constraints on Keypoints
      If you need to delete any of the constraints use the following command: 'DKDELE, K, Lab' (ie 'DKDELE,1,UZ' would delete the constraint in the 'z' direction for Keypoint 1)
  5. Apply Loads
  6. We will apply vertical downward loads of 600N at the seat post location (keypoint 3) and 200N at the pedal crank location (keypoint 4). We will use the command line to define these loading conditions.
    FK, KPOI, Lab, value, value2
    Force loads at keypoints, K #, Force Label directions (FX, FY, FZ), value1, value2 (if req'd)
    To apply a force of 600N downward at keypoint 3, the code should look like this: ' FK,3,FY,-600 'Apply both the forces and list the forces to ensure they were inputted correctly (FKLIST).If you need to delete one of the forces, the code looks like this: 'FKDELE, K, Lab' (ie 'FKDELE,3,FY' would delete the force in the 'y' direction for Keypoint 3)The applied loads and constraints should now appear as shown below.[Bike Loads & Constraints]
  7. Solving the SystemSolution > Solve > Current LS

Postprocessing: Viewing the Results

To begin Postprocessing, open the 'General Postproc' Menu
  1. DeformationPlot Results > Deformed Shape... 'Def + undef edge'[Bike Deflection]
    • You may want to try plotting this from different angles to get a better idea what's going on by using the 'Pan-Zoom-Rotate' menu that was earlier outlined.
    • Try the 'Front' view button (Note that the views of 'Front', 'Left', 'Back', etc depend on how the object was first defined).
    • Your screen should look like the plot below:
    [Bike Deflection - side view]
  2. Deflections
  3. Now let's take a look at some actual deflections in the frame. The deflections have been calculated at the nodes of the model, so the first thing we'll do is plot out the nodes and node numbers, so we know what node(s) we're after.
    • Go to Utility menu > PlotCtrls > Numbering... and turn on 'Node numbers'. Turn everything else off.
    • Note the node numbers of interest. Of particular interest are those nodes where the constraints were applied to see if their displacements/rotations were indeed fixed to zero. Also note the node numbers of the seat and crank locations.
    • List the Nodal Deflections (Main Menu > General Postproc > List Results > Nodal Solution...'). Are the displacements and rotations as you expected?
    • Plot the deflection as well.General Postproc > Plot Results > (-Contour Plot-) Nodal Solution select 'DOF solution' and 'USUM' in the window
    • Don't forget to use more useful intervals.
  4. Element Forces
  5. We could also take a look at the forces in the elements in much the same way:
    • Select 'Element Solution...' from the 'List Results' menu.
    • Select 'Nodal force data' and 'All forces' from the lists displayed.
    • Click on 'OK'.
    • For each element in the model, the force/moment values at each of the two nodes per element will be displayed.
    • Close this list window when you are finished browsing.
    • Then close the 'List Results' menu.
  6. StressesAs shown in the cantilever beam example, use the Element Table to gain access to derived stresses.
    • General Postproc > Element Table > Define Table ...
    • Select 'Add'
    • Select 'Stress' and 'von Mises'
    • Element Table > Plot Elem Table
    • Again, select appropriate intervals for the contour plot

  7. Bending Moment Diagrams
  8. As shown previously, the bending moment diagram can be produced.Select Element Table > Define Table... to define the table (remember SMISC,6 and SMISC,12)And, Plot Results > Line Elem Res... to plot the data from the Element Table

    ANSYS Command Listing

    ! Command File mode of 3D Bicycle Space Frame

    /title,3D Bicycle Space Frame

    /prep7 ! Enter the pre-processor

    ! Define Some Parameters

    x1 = 500 ! These parameters are not required; i.e. one could
    x2 = 825 ! directly enter in the coordinates into the keypoint
    y1 = 325 ! definition below.
    y2 = 400 ! However, using parameters makes it very easy to
    z1 = 50 ! quickly make changes to your model!

    ! Define Keypoints

    K,1, 0,y1, 0 ! k,key-point number,x-coord,y-coord,z-coord
    K,2, 0,y2, 0
    K,3,x1,y2, 0
    K,4,x1, 0, 0
    K,5,x2, 0, z1
    K,6,x2, 0,-z1

    ! Define Lines Linking Keypoints

    L,1,2 ! l,keypoint1,keypoint2
    L,2,3
    L,3,4
    L,4,1
    L,4,6
    L,4,5
    L,3,5 ! these last two line are for the rear forks
    L,3,6

    ! Define Element Type

    ET,1,pipe16
    KEYOPT,1,6,1

    ! Define Real Constants

    ! (Note: the inside diameter must be positive)
    R,1,25,2 ! r,real set number,outside diameter,wall thickness
    R,2,12,1 ! second set of real constants - for rear forks

    ! Define Material Properties

    MP,EX,1,70000 ! mp,Young's modulus,material number,value
    MP,PRXY,1,0.33 ! mp,Poisson's ratio,material number,value

    ! Define the number of elements each line is to be divided into
    LESIZE,ALL,20 ! lesize,line number(all lines),size of element

    ! Line Meshing
    REAL,1 ! turn on real property set #1
    LMESH,1,6,1 ! mesh those lines which have that property set
    ! mesh lines 1 through 6 in steps of 1
    REAL,2 ! activate real property set #2
    LMESH,7,8 ! mesh the rear forks

    FINISH ! Finish pre-processing

    /SOLU ! Enter the solution processor

    ANTYPE,0 ! Analysis type,static

    ! Define Displacement Constraints on Keypoints (dk command)

    DK,1,UX,0,,,UY,UZ ! dk,keypoint,direction,displacement,,,direction,direction
    DK,5,UY,0,,,UZ
    DK,6,UY,0,,,UZ

    ! Define Forces on Keypoints (fk command)

    FK,3,FY,-600 !fk,keypoint,direction,force
    FK,4,FY,-200

    SOLVE ! Solve the problem

    FINISH ! Finish the solution processor

    SAVE ! Save your work to the database

    /post1 ! Enter the general post processor

    /WIND,ALL,OFF
    /WIND,1,LTOP
    /WIND,2,RTOP
    /WIND,3,LBOT
    /WIND,4,RBOT
    GPLOT


    /GCMD,1, PLDISP,2 !Plot the deformed and undeformed edge
    /GCMD,2, PLNSOL,U,SUM,0,1



    ! Set up Element Table information
    ! Element tables are tables of information regarding the solution data
    ! You must tell Ansys what pieces of information you want by using the
    ! etable command:
    ! etable,arbitrary name,item name,data code number

    ! The arbitrary name is a name that you give the data in the table
    ! It serves as a reference name to retrieve the data later
    ! Use a name that describes the data and is easily remembered.

    ! The item name and data code number come off of the tables provided.

    ! Examples:

    ! For the VonMises (or equivalent) stresses at angle 0 at both ends of the
    ! element (node i and node j);

    etable,vonmi0,nmisc,5
    etable,vonmj0,nmisc,45

    ! For the Axial stresses at angle 0

    etable,axii0,ls,1
    etable,axij0,ls,33

    ! For the Direct axial stress component due to axial load (no bending)
    ! Note it is independent of angular location.

    etable,diri,smisc,13
    etable,dirj,smisc,15

    ! ADD OTHERS THAT YOU NEED IN HERE...

    ! To plot the data, simply type
    ! plls, name for node i, name for node j
    ! for example,

    /GCMD,3, PLLS,vonmi0,vonmj0
    /GCMD,4, PLLS,axii0,axij0

    /CONT,2,9,0,,0.27
    /CONT,3,9,0,,18
    /CONT,4,9,-18,,18

    /FOC,ALL,-0.340000,,,1

    /replot

    PRNSOL,DOF,

0 comments:

Post a Comment