TAGGED: ansys-mechanical, hull, matlab, matlab-toolbox, volume
-
-
April 30, 2021 at 2:15 pm
LaraDlg
SubscriberHello,
Starting in Ansys, I wanted to export the matrix of nodes of my deformed geometry (shell of an opened skull) into Matlab in order to compute the volume of a convex hull and then send the result back to Ansys to use the volume value as a parameter.
Is there a way to achieve that?
Or is it possible to compute the volume of a convex hull directly in APDL?
Many thanks in advance for your help!
May 11, 2021 at 11:46 am1shan
Ansys EmployeeIs the volume of hull same as volume of the deformed mesh, or is it something different that needs further processing? If its the same you may use the volume result https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v211/en/wb_sim/ds_volume_result.html to calculate and parameterize the volume of deformed body. I haven't used it but there is a way to link ANSYS and Matlab using AnsysAAS (check this /forum/discussion/633/download-matlab-toolbox-ansysaas). For your case you might want to define the expressions as parameters in excel - https://www.youtube.com/watch?v=_mMpBe5IEtM, and link it to your analysis which might be easier.
Regards Ishan.
May 11, 2021 at 11:55 amLaraDlg
Subscriber
Volume hull is supposed to be an approximation because I didn't find a way to compute it in Ansys (my deformed geometry is opened)
Right now I'm exporting the mesh for each design point of my DoE into matlab, calculate the volume and then import the results in a .csv file back in the DoE in a new project in Ansys to analyse the response surface.
I don't know if I'm clear enough but do you think it would work?
Many thanks
Lara
May 11, 2021 at 12:30 pmpeteroznewman
SubscriberIn 's other discussion /forum/discussion/26920/how-to-parametrized-the-boundary-box-of-the-deformed-geometry#latest
I described a method to measure the volume using Fluid elements. Do you think that would work?
May 11, 2021 at 12:44 pmMay 13, 2021 at 3:49 pm1shan
Ansys EmployeeThanks for the suggestion. It looks like the geometry needs to be fully enclosed in order to use hydrostatic elements. However, I saw this example - https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v194/ans_str/strhydroexample.html, where negative volume elements have been used to model an open piston cylinder geometry. Not sure if this "trick" could be used for the above model. I'll have to check.
I'm exporting the mesh for each design point of my DoE into matlab, calculate the volume and then import the results in a .csv file back in the DoE in a new project in Ansys to analyse the response surface" - this could work but it will be a manual process! You could automate it by using python scripts (which calculates the hull volume) in ANSYS(https://www.youtube.com/watch?v=oX5hDU0Qg-Q). The Customization Suite 2021 R1 contains all required information about this. Check this Example which shows how to use external solver to get the output for inputs from the workbench.
Also, have you tried correlating the spring length with the volume change? It looks like the slot in the skull will be opening and closing about the corner (like a pivot). You can easily find out the cross section area (and its centroid) in a cad tool and then use the "Pappus Theorem for Volume of Revolution" to calculate volume it spans during deformation. You could parameterize the spring length, send it to excel calculate the volume and send this as an output parameter. This is obviously an approximation (so is the volume of hull) bit it will be easier to implement and automate for DOE study. You could compare it with the volume of hull obtained using MATLAB and check whether they are close or not.
Regards Ishan
May 13, 2021 at 3:58 pmLaraDlg
Subscriber
Thank you for your reply! I'm going to look into the Python method.
As for your second proposition, we thought about it too but unfortunately it would not work for the whole population as some models have a more complicated opening and also expand laterally.
Many thanks for your help Lara
May 14, 2021 at 3:11 pmLaraDlg
Subscriber
I tried to open the links that you suggested but I can't log in, is there a way to find them from the customer e portal?
Thank you Lara
May 16, 2021 at 3:52 pmMay 16, 2021 at 4:34 pmLaraDlg
SubscriberThank you for the tips!
May 19, 2021 at 8:55 amLaraDlg
Subscriber
I have been looking into the Python option you gave me (I'm a beginner).
I understood that I have to create an ACT extension in order to calculate my volume in an object result (using Scipy it's a little bit more complicated than I thought)
To compute the hull volume, I need to use a matrix containing the x-y-z coordinates of the deformed mesh (previously I just wrote 3 columns in a txt files and did the post processing in matlab)
My question is : can I get such matrix as an output of APDL and then call it in my extension files?
I tried using *DIM, *VCUM, *VFILL but I didn't manage to have my matrix (or vector) as an output in the first place
Many thanks!
Viewing 10 reply threads- The topic ‘How Can I create a link between Ansys and Matlab?’ is closed to new replies.
Ansys Innovation SpaceTrending discussionsTop Contributors-
3892
-
1414
-
1256
-
1118
-
1015
Top Rated Tags© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-