This tutorial was completed using ANSYS 7.0 The purpose of this tutorial is to introduce a method of solving design optimization problems using ANSYS. This will involve creating the geometry utilizing parameters for all the variables, deciding which variables to use as design, state and objective variables and setting the correct tolerances for the problem to obtain an accurately converged solution in a minimal amount of time. The use of hardpoints to apply forces/constraints in the middle of lines will also be covered in this tutorial.
A beam has a force of 1000N applied as shown below. The purpose of this optimization problem is to minimize the weight of the beam without exceeding the allowable stress. It is necessary to find the cross sectional dimensions of the beam in order to minimize the weight of the beam. However, the width and height of the beam cannot be smaller than 10mm. The maximum stress anywhere in the beam cannot exceed 200 MPa. The beam is to be made of steel with a modulus of elasticity of 200 GPa.
/prep7 /title, Design Optimization *set,H,20 ! Set an initial height of 20 mm *set,W,20 ! Set an initial width of 20 mm K,1,0,0 ! Keypoint locations K,2,1000,0 L,1,2 ! Create line HPTCREATE,LINE,1,0,RATI,.75, ! Create hardpoint 75% from left side ET,1,BEAM3 ! Element type R,1,W*H,(W*H**3)/12,H,,,, ! Real consts: area,I (note '**', not '^'),height MP,EX,1,200000 ! Young's modulus MP,PRXY,1,0.3 ! Poisson's ratio ESIZE,100 ! Mesh size LMESH,ALL ! Mesh line FINISH /SOLU ANTYPE,0 ! Static analysis DK,1,UX,0 ! Pin keypoint 1 DK,1,UY,0 DK,2,UY,0 ! Support keypoint 2 FK,3,FY,-2000 ! Force at hardpoint SOLVE FINISH /POST1 ETABLE,EVolume,VOLU, ! Volume of single element SSUM ! Sum all volumes *GET,Volume,SSUM,,ITEM,EVOLUME ! Create parameter 'Volume' for volume of beam ETABLE,SMAX_I,NMISC,1 ! Create parameter 'SMaxI' for max stress at I node ESORT,ETAB,SMAX_I,0,1,, *GET,SMAXI,SORT,,MAX ETABLE,SMAX_J,NMISC,3 ! Create parameter 'SMaxJ' for max stress at J node ESORT,ETAB,SMAX_J,0,1,, *GET,SMAXJ,SORT,,MAX *SET,SMAX,SMAXI>SMAXJ ! Create parameter 'SMax' as max stress LGWRITE,optimize,txt,C:\TEMP ! Save logfile to C:\Temp\optimize.txt /OPT OPANL,'optimize','txt','C:\Temp\' ! Assign optimize.txt as analysis file OPVAR,H,DV,10,50,0.001 ! Height design variable, min 10 mm, max 50 mm, tolerance 0.001mm OPVAR,W,DV,10,50,0.001 ! Width design variable, min 10 mm, max 50 mm, tolerance 0.001mm OPVAR,SMAX,SV,195,200,0.001 ! Height state variable, min 195 MPa, max 200 MPa, tolerance 0.001 MPa OPVAR,VOLUME,OBJ,,,200 ! Volume as object variable, tolerance 200 mm^2 OPTYPE,FIRS ! First-order analysis OPFRST,30,100,0.2, ! Max iteration, Percent step size, Percent forward difference OPEXE ! Run optimization PLVAROPT,H,W ! Graph optimation data /AXLAB,X,Number of Iterations /AXLAB,Y,Width and Height (mm) /REPLOT