


{"id":427753,"date":"2025-04-02T16:13:19","date_gmt":"2025-04-02T16:13:19","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/reaction-forces-and-moments-along-an-axis\/"},"modified":"2025-04-02T16:13:19","modified_gmt":"2025-04-02T16:13:19","slug":"reaction-forces-and-moments-along-an-axis","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/reaction-forces-and-moments-along-an-axis\/","title":{"rendered":"Reaction Forces and Moments along an axis."},"content":{"rendered":"<p>&lt;p&gt;Hi, I am doing some structural analysis of a cantilever wing (as of now a simple structure), with imported pressure loads. The analysis can run well, that&#8217;s not an issue at all. However, due to the nature of the task, I need to model the reaction forces and moments along the z-axis into a .csv or similar file (i.e. creating an array with Fx, Fy and Fz for each value of z, that can be plotted into 2D graphs such as in MatLab).&lt;\/p&gt;&lt;p&gt;The &#8220;manual&#8221; way to do it would be creating several coordinate systems, generating a construction surface for each, and finally using the probe tool for the reactions at each surface. Then, the data for each would be extracted and can be plotted. See the figure below.&lt;\/p&gt;&lt;p&gt;<img decoding=\"async\" src=\"https:\/\/preview.redd.it\/reaction-forces-and-moments-along-an-axis-v0-lypgsmxi0gse1.png?width=1918&amp;format=png&amp;auto=webp&amp;s=08355b15c0134ed6e3f06722d1737e31d7801d01\" alt=\"CDN media\" \/>&lt;\/p&gt;&lt;p&gt;However, this is not practical if many tests have to be done, which is why I was wondering if there is any way to do get the values automatically by just setting up the problem and then clicking solve to get a .csv file in a specified directory. I have attempted with APDL and Python scripts (with the help of AI tools, as I am very unfamiliar with this), but have been unsuccessful. The closest i&#8217;ve gotten is, through the APDL code below, to retrieve the values for z=0 correctly (as contrasted to a probe), but the rest simply output small numbers with no sense (see image). I assume they correspond to the nodes, instead of computing a (interpolated?) sum for the plane.&lt;\/p&gt;<\/p>\n<pre>Z_MIN = 0        \nZ_MAX = 3000     \nZ_STEP = 20       \nOUTPUT_FILE = 'C:\\ANSYS_Results\\Z_Reactions_2.csv'  \n\/POST1          \nSET,LAST         \n*CFOPEN,OUTPUT_FILE,csv\n*VWRITE,'Z (mm)','FX (N)','FY (N)','FZ (N)','MX (Nmm)','MY (Nmm)','MZ (Nmm)'\n%13s,%13s,%13s,%13s,%13s,%13s,%13s\n*DO,Z_POS,Z_MIN,Z_MAX,Z_STEP\n  NSEL, S, LOC, Z, Z_POS-0.5, Z_POS+0.5   ! Select nodes in a slice around the Z position\n  ESEL, S, LOC, Z, Z_POS-0.5, Z_POS+0.5   ! Select elements in that slice\n  FSUM             ! Force summation\n  *GET,FX,FSUM,,ITEM,FX\n  *GET,FY,FSUM,,ITEM,FY\n  *GET,FZ,FSUM,,ITEM,FZ\n  *GET,MX,FSUM,,ITEM,MX\n  *GET,MY,FSUM,,ITEM,MY\n  *GET,MZ,FSUM,,ITEM,MZ\n  *VWRITE,Z_POS,FX,FY,FZ,MX,MY,MZ\n  %13.6f,%13.6f,%13.6f,%13.6f,%13.6f,%13.6f,%13.6f\n  ALLSEL\n*ENDDO\n*CFCLOS                  ! Close output file\nCSYS,0                   ! Return to global CS\n*STATUS                  ! Show parameter status\nALLSEL\nFSUM\n*GET,TOTFX,FSUM,,ITEM,FX\n*GET,TOTFY,FSUM,,ITEM,FY\n*GET,TOTFZ,FSUM,,ITEM,FZ\n*MSG,UI,TOTFX,TOTFY,TOTFZ\nTotal Model Reactions: FX=%G, FY=%G, FZ=%G<\/pre>\n<p>&lt;p&gt;<img decoding=\"async\" src=\"https:\/\/preview.redd.it\/reaction-forces-and-moments-along-an-axis-v0-i183oon13gse1.png?width=640&amp;format=png&amp;auto=webp&amp;s=8506d7f5a179f7af5b7a17e3756467cad28709df\" alt=\"r\/ANSYS - Output from the code\" \/>&lt;\/p&gt;&lt;p&gt;Any help would be appreciated. Thanks.&nbsp;&lt;\/p&gt;<\/p>\n","protected":false},"template":"","class_list":["post-427753","topic","type-topic","status-publish","hentry","topic-tag-automation","topic-tag-force-reaction","topic-tag-forces","topic-tag-mechanical"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_forum_id":["27791"],"_bbp_topic_id":["427753"],"_bbp_subscription":["510027","58821"],"_bbp_author_ip":["77.231.178.128"],"_bbp_last_reply_id":["428325"],"_bbp_last_active_id":["428325"],"_bbp_last_active_time":["2025-04-08 16:55:11"],"_bbp_reply_count":["2"],"_bbp_reply_count_hidden":["0"],"_bbp_voice_count":["2"],"_bbp_engagement":["510027","58821"],"_btv_view_count":["234"],"_bbp_topic_status":["unanswered"],"_bbp_notification_enabled":["510027"],"_bbp_likes_count":["1"]},"test":"ivan-redradogmail-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/427753","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\/427753\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=427753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}