! St2LM_1 - program for ANSYS ! Structural analysis(St) ! 2D problem(2) ! Linear analysis(L) ! Modal analysis(M) ! ! Test problem: computation of natural frequencies and mode shapes (modal analysis) ! for the system of linear elasticity equations ! (plane stress) ! ! Geometry of the domain - double T-region ! Domain consists of two different materials /FILNAME,St2LM_1 ! change jobname to St2LM_1 /TITLE, Modal Analysis of a Double-T Region F_R='Mod_ANS_1' ! file name for text output NFREQ=4 ! number of natural frequencies to compute /PREP7 H=0.02 ! Thickness B=0.16 ! half height L=0.05 ! half width ! Parameters for finite element mesh DH=1 KFE=H /OUTPUT,F_R,rez ! define file name and extension for text output *VWRITE ! write to file (1X,' MODE-FREQUENCY ANALYSIS (Block Lanczos, Plane2)') ! use FORTRAN FORMAT conventions, 1x stands for one horizontal space !specify real fortran format for nfreq value: Fw.d !W = width of field, d = number of digits to the right of the decimal point *VWRITE,NFREQ (1X,' NFREQ= ',F2.0) /OUTPUT ! finish text output *DIM,FR,ARRAY,NFREQ ! array for natural frequencies ! Parameters for material properties of steel RO1=7.86e3 ! density E1=2e11 ! Young's modulus NU1=0.29 ! Poisson's ratio ! Parameters for material properties of copper RO2=8.9e3 ! density E2=1.2e11 ! Young's modulus NU2=0.33 ! Poisson's ratio ! Set material properties for the first material (steel) MP,DENS,1,RO1 ! set density MP,EX,1,E1 ! set Young's modulus MP,NUXY,1,NU1 ! set Poisson's ratio ! Set material properties for the second material (copper) MP,DENS,2,RO2 ! set density MP,EX,2,E2 ! set Young's modulus MP,NUXY,2,NU2 ! set Poisson's ratio !ET,1,PLANE2 ! finite element PLANE2: 6-Node Triangular Structural Solid ET,1,PLANE82 ! finite element PLANE82: 2D 8-Node Structural Solid mshape,1 ! triangular option for PLANE82 ! Keypoints of the plate boundary: point number and coordinates K,1,H/2,0 K,2,H/2,B-H K,3,L,B-H K,4,L,B K,5,-L,B K,6,-L,B-H K,7,-H/2,B-H K,8,-H/2,0 K,9,H/2,-B+H K,10,L,-B+H K,11,L,-B K,12,-L,-B K,13,-L,-B+H K,14,-H/2,-B+H ! Define lines 1-7 L,1,2 \$ L,2,3 \$ L,3,4 \$ L,4,5 L,5,6 \$ L,6,7 \$ L,7,8 \$ L,8,1 AL,1,2,3,4,5,6,7,8 ! Define area 1 by lines 1-8 ! Define lines 9-15 L,1,9 \$ L,9,10 \$ L,10,11 \$ L,11,12 L,12,13 \$ L,13,14 \$ L,14,8 AL,8,9,10,11,12,13,14,15 ! Define area 2 by lines 8-15 ! Define parameters for finite element mesh ! KESIZE Specifies the edge lengths of the elements nearest a keypoint KESIZE,ALL,KFE !LESIZE,8,,,DH ! Divide line 8 by DH segments ASEL,S,AREA,,2 ! Select area 2 AATT,2,,1 ! Associate element attributes (MAT=2,TYPE=1) with the selected area ASEL,ALL ! Select all areas AMESH,ALL ! Mesh all areas *GET,EL_MAX,ELEM,,COUNT ! EL_MAX - number of elements *GET,ND_MAX,NODE,,COUNT ! ND_MAX - number of nodes /OUTPUT,F_r,rez,,append ! Open file F_r.rez and continue output *VWRITE,EL_MAX,ND_MAX ! Write the values of el_max and nd_max in the file (3X,' NEL_MAX=',F6.0,' ND_MAX=',F6.0) ! use fortran format for output, 3x stands for 3 horizontal spaces ! use real format Fw.d: W = width of field, d = number of digits to the right of the decimal point ! Add comments to output file /com, /COM, i ! Frequency in Hz (ANSYS) /OUTPUT ! Finish text output SAVE FINISH /SOLU ANTYPE,MODA ! Modal analysis (natural frequencies and mode shapes) MODOPT,LANB,NFREQ ! Options for the solver: Block Lanczos solver, number of natural frequencies (NFREQ) NSEL,S,LOC,Y,-B ! Select all nodes with Y=-B D,ALL,UX,0 ! For all selected nodes set UX=0 D,ALL,UY,0 ! For all selected nodes set UY=0 NSEL,ALL ! Select all nodes OUTRES,ALL,ALL ! write solution results for every substep SOLVE SAVE FINISH /POST1 ! Write the values of natural frequencies to the file *DO,I,1,NFREQ ! do-loop for data sets from 1 to nfreq SET,,I ! data set to be read from the results file *GET,FR(I),MODE,I,FREQ !Retrieves a value of FREQ for the entity MODE and stores it part of an array parameter FR FRI=FR(I) /OUTPUT,F_r,rez,,append ! continue text output to the file *VWRITE,I,FRI ! write the values of natural frequencies (1X,F2.0,' ',E12.5) ! use real format Fw.d for I and real format with exponent notation Ew.d for FRI /OUTPUT *ENDDO