! Commands inserted into this file will be executed immediately after the Ansys /POST1 command. ! Active UNIT system in Workbench when this object was created: U.S. Customary (in, lbm, lbf, s, V, A) temperature units of F !contact area macro !This macro extracts the contact area from a group of elements !The resulting value is listed in the command object in the solution branch ! !User must have a named selection called cnt_press_edges, scoped to one or more edges !These faces must have contact elements otherwise the results will return zero !If user is using program controlled for contact behavior, ANSYS may internally flip the contact and target (auto symmetric). If this happens, the results will be returned as zero !In this case the user has to make sure that edges picked for the named selection have contact elements. !Here are some options; !If behavior is set to program controlled and results come back as zero, then go to the named selection and pick the opposing face !If behavior is set to asymmetric, then just make sure the named selection points to the same faces as contact faces in the contact definition !If behavior is set to symmetric, then run and record the contact area, save this number, then in the named selection, select the opposing face instead, !rerun, extract the contact area, add to the first contact area from the prior step, and divide by two. This will give an average of the contact area ! !Sean Harvey - ANSYS Inc. !Rev 1.0 - Original release 11/4/2013 !user assumes all responsbility from use of the macro resume set,last !set the last results, change as needed!!! Especially if multi results sets allsel *get,num_el,elem,0,count !get number of contact elements selected *get,start_id,elem,0,num,min !get id of first contact element *dim,cnt_area,array,num_el !dimension the contact area array cmsel,s,cnt_press_edges !select nodes of interest. Need face name selection on area of interest esln,s,1 !select elements attached to these nodes esel,r,ename,,172 !reselect the contact elements *vget,elem_sel,elem,start_id,esel !create mask vector of selected 1=selected -1=not selected allsel *vabs,1 *vmask,elem_sel !turn on mask *vmask,elem_sel !turn on mask *vscfun,elem_tot_area,sum,elem_area !sum the area of the contact elements *vmask,elem_sel !turn on mask etable,carea,nmisc,27 !get the contact area *vmask,elem_sel !turn on mask *vget,cnt_area,elem,start_id,etab,carea !store in array *vmask,elem_sel !turn on mask *vscfun,tot_area,sum,cnt_area !sum the contact area my_contact_area = tot_area !output variable tot_area