


{"id":36255,"date":"2019-06-30T09:52:00","date_gmt":"2019-06-30T09:52:00","guid":{"rendered":"\/forum\/forums\/topic\/apdl-for-average-values\/"},"modified":"2019-06-30T09:52:00","modified_gmt":"2019-06-30T09:52:00","slug":"apdl-for-average-values","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/apdl-for-average-values\/","title":{"rendered":"APDL for average values"},"content":{"rendered":"<p>Hello,<\/p>\n<p><\/p>\n<p>I&#8217;m trying to find the average stress value on a face in Static Structural (the maximum value is the design criterion but for this application, I also need to report the average value). I&#8217;ve never used APDL before so I found this code online for a command:<\/p>\n<p><\/p>\n<pre id=\"code\" class=\"brush: text; plain-text\" style=\"margin-top: 0px; margin-bottom: 0px; padding: 10px; white-space: pre-wrap; overflow-wrap: break-word; color: #000000; font-size: 12px;\">!   Commands inserted into this file will be executed immediately after the ANSYS \/POST1 command.<br \/>\n<br \/>\n!   Active UNIT system in Workbench when this object was created:  U.S. Customary (in, lbm, lbf, s, V, A)<br \/>\n!   NOTE:  Any data that requires units (such as mass) is assumed to be in the consistent solver unit system.<br \/>\n!                See Solving Units in the help system for more information.<br \/>\n<br \/>\n\/post1<br \/>\nallsel,all<br \/>\n<br \/>\nset,last\t\t\t! Read result set<br \/>\ncmsel,s,face_01,node\t\t! Select the node group<br \/>\nAtot=0.0                  \t! Reset total area value.<br \/>\ntot_stress=0.0            \t! Reset total volume times stress value.<br \/>\n*GET,NNUM,NODE,0,COUNT  \t! Get total number of nodes in the name selection<br \/>\nncounter = 0 \t\t\t! Node number counter reset to zero<br \/>\n<br \/>\n*DO,I,1,NNUM,1\t\t\t\t\t! Loop over all the selected nodes<br \/>\nncounter = ndnext(ncounter)\t\t! Acess the next node in the selection<br \/>\nnarea = arnode(ncounter)\t\t! Calculate the area associated with this node<br \/>\n*GET,vonmises,NODE,ncounter,s,EQV\t! Calculate the stress at this node.<br \/>\ntot_stress = tot_stress + narea*vonmises<br \/>\nAtot = narea + Atot<br \/>\n*ENDDO<br \/>\nmy_avestress1=tot_stress\/Atot               \t! Calculate average stress.<br \/>\nfini<\/pre>\n<p><\/p>\n<p>And I defined the face of interest as &#8220;face_01&#8221;:<\/p>\n<p><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/us.v-cdn.net\/6032193\/uploads\/attachments\/e7f5a72f-c3b3-485b-ad5f-aa79017a02cd\/2f75bfac-193b-480a-8f49-aa7c009fa5d3_zz.jpg?width=690&amp;upscale=false\" alt=\"\"><\/p>\n<p><\/p>\n<p>But there is no solution&#8230; I think the problem is to&nbsp;access the result set but I don&#8217;t know why it does not work.&nbsp;<\/p>\n<p><\/p>\n<p>I also tried using the probe but it does not give average values.<\/p>\n","protected":false},"template":"","class_list":["post-36255","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_old_topic_id":["8427"],"_bbp_old_topic_author_name_id":["Anonymous"],"_bbp_old_is_topic_anonymous_id":["false"],"_bbp_old_closed_status_id":["publish"],"_bbp_author_ip":[null],"_bbp_old_sticky_status_id":["normal"],"_bbp_likes_count":["0","0"],"_btv_view_count":["3835"],"_bbp_subscription":["241027"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["36255"],"_bbp_forum_id":["27791"],"_bbp_engagement":["240","49550","238693"],"_bbp_voice_count":["3"],"_bbp_reply_count":["4"],"_bbp_last_reply_id":["229523"],"_bbp_last_active_id":["229523"],"_bbp_last_active_time":["2021-11-02 05:51:45"]},"test":"97b26285be36cffb89250ea2490390f4a1c17239"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/36255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/36255\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=36255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}