fini /clear !/TITLE,Standard Actuator, gele = 0,1 voltage= -10 ! Applied voltage /COM -------------------- View of the model /VIEW,1,3,1,1 /vup,1,z /PREP7 ! Enter preprocessor /COM,-------------------- Define element tables ET,1,SOLID5,0 ! 8-node coupled field solid with all DOFs, for PZt /com,HD 3203,Y-polarized,,, /com,Stiffness,,,, TB,ANEL,2,1,,0 TBDATA,1,1.2299E+11,8.0159E+10,7.6220E+10, TBDATA,7,1.1213E+11,8.0159E+10,, TBDATA,12,1.2299E+11,,, TBDATA,16,1.8519E+10,,, TBDATA,19,1.8519E+10,,, TBDATA,21,2.3386E+10,,, /com,Piezo,,,, TB,PIEZ,2,,, TBDATA,2,-11.6445,,, TBDATA,5,21.5814,,, TBDATA,8,-11.6445,,, TBDATA,10,19.4444,,, TBDATA,15,19.4444,,, /com,Permittivity,, EMUNIT,EPZRO,8.85E-12, MP,PERX,2,1293 MP,PERY,2,1373 MP,PERZ,2,1293 /com,Density,, MP,DENS,2,7800 MP,MURX,2,0 ! Bogey material properties to suppress error messages MP,KXX,2,0 ! Bogey material properties to suppress error messages K,1,0,0,0 K,2,1,0,0 K,3,1,1,0 K,4,0,1,0 K,5,0,0,1 K,6,1,0,1 K,7,1,1,1 K,8,0,1,1 L,1,2 L,2,3 L,3,4 L,4,1 L,1,5 L,2,6 L,3,7 L,4,8 L,5,6 L,6,7 L,7,8 L,8,5 AL,1,2,3,4 AL,1,6,9,5 AL,2,7,10,6 AL,3,8,11,7 AL,4,5,12,8 AL,9,10,11,12 ASEL,S,AREA,,1,6 VA,ALL ALLSEL /COM -------------------- Mesh help possibilities ESIZE,gele ! Set global element edge lenght /COM -------------------- Mesh buttom volume VSEL,S,VOLU,,1 ! Select volume by volume number CM,BASE,VOLU ! Component name = BASE TYPE,1 ! Use element table type 1 for meshing MAT,2 ! Use material 1 attributes for meshing VSWEEP,1 ! Mesh all selected volumes /COM -------------------- Electrodes NSEL,S,LOC,y,0 CM,I_elec,NODE CP,1,VOLT,ALL NSEL,S,LOC,y,1 CM,II_elec,NODE CP,2,VOLT,ALL ALLSEL ! Select everything NLGEOM,on FINISH ! Exit active processor /SOLU ! Enter solution processor /COM --------------------- Boundary conditions D,I_elec,VOLT,voltage ! Assign potential to a node of left electrode D,II_elec,VOLT,0.0 ! Assign potential to a node of right electrode NSEL,S,LOC,Z,0 ! Select nodes at top of structure D,ALL,UX,,,,,UY,UZ ! Remove displacement DOFs from selected nodes NSEL,ALL ! Select all nodes SOLVE ! Solve current load step FINISH ! Exit active processor /POST1 ! Enter post processor ESEL,S,MAT,,2 !ETAB,volume,VOLU !variation1 *GET,numberOfElements,ELEM,,COUNT !variation2 elementNumber = 0 totalVolume = 0 *DO,i,1,numberOfElements elementNumber = ELNEXT(elementNumber) *GET,volume,ELEM,elementNumber,VOLU totalVolume = totalVolume + volume *ENDDO test = totalvolume !output total volume !AllSEL !variation3 !*GET,maximumElementNumber,ELEM,,NUM,MAX !*DIM,volumes,ARRAY,maximumElementNumber !*DIM,mask,ARRAY,maximumElementNumber !ESEL,S,MAT,,7 !*VGET,volumes(1),ELEM,1,GEOM !*VGET,mask(1),ELEM,1,ESEL !*VMASK,mask(1) !*VSCFUN,totalVolume,SUM,volumes(1) !CM,InkEle,ELEM !*get,testvol,ELEM,inkele,VOLU /UDOC,1,CNTR,LEFT ! Contour legend left side /PLOPTS,LOGO,OFF ! Small Ansys logo /PLOPTS,DATE,OFF ! Date off /PLOPTS,MINM,OFF ! Min-Max symbols on contour displays off /PLOPTS,LEG1,OFF ! Legend 1 off /DEVICE,FONT,1,Arial,550,10,18,10,0 ! Font: Arial... !/TRIAD,OFF ! Global XYZ coordinate off PLNSOL,U,SUM,2 ! Plot structural displacement