Grasshopper

generative modeling for Rhino

Coupling Grasshopper with ANSYS to obtain real-time feedback on the mechanical performance of the structure.

Galapagos is used to run an evolutionary optimization of the structural topology. Maximum displacement is the fitness function (optimization parameter).

Comment

You need to be a member of Grasshopper to add comments!

Join Grasshopper

Comment by Przemyslaw Kolodziej on October 29, 2012 at 12:59pm

Thanks a lot!

Comment by Riccardo La Magna on October 29, 2012 at 6:41am

Huh, I don't seem able to upload the file on the forum, weird.

Anyway Przemek, here you can download the Python code to automatically update the geometry and run the analysis on it.

In a Grasshopper script component you need to add the ANSYS Process object through which you fire the program and run the above Python script. It would look somewhat like this (in C#):

System.Diagnostics.Process ANSYS = new System.Diagnostics.Process();
ANSYS.StartInfo.FileName = "YourPathToANSYS\\runwb2.exe";
ANSYS.StartInfo.Arguments = "-B -R YourPathToPythonScript\\AutomaticUpdate.py";
ANSYS.Start();

..and that's basically it.

Comment by Riccardo La Magna on October 26, 2012 at 7:10am

Hi Przemek

Sure I can share the script. I just need to find it somewhere on my hard drive, as it's been quite a while since I last used it. By the way the GH script just fires ANSYS in batch mode, which in turn executes a Python script (which is the Workbench's scripting language) that starts the analysis. No more, no less. The rough part lies rather on the ANSYS side, as it's not so trivial to find the right setup to make it do the right calculations.

Anyway, as I said I'll send you the script. As soon as I find it..


Cheers,

r

Comment by Przemyslaw Kolodziej on October 18, 2012 at 6:25am

Hi Riccardo, 

Well done! Is it possible to share yours GH ANSYS plugin? It'll help me a lot on my phd research. 

Best, 

Przemek

Comment by Riccardo La Magna on September 6, 2011 at 10:42am
I'm sure it can be done.
I would suggest starting to build your model in ANSYS (I'm giving for granted you're using ANSYS Workbench. I hope that's the case) and setting up the whole simulation process.
Once you've done this you need to write the APDL macro to export all the pressure values you're interested into, either to an Excel table, a *.*txt file or whatever format you feel more comfortable with (in the video I'm exporting to a text file). Most of my time I've spent it finding the right ANSYS command lines to export the displacement values, I bet this is the tricky part.
At this point you can setup your GH + Galapagos model, linking the Fitness Input to the exported values. Remember that you'll need some post-processing of the global values, as Galapagos accepts only single numbers as optimization parameter.
To finish off you link everything with the script component which fires ANSYS and invokes the Python script at each simulation. Moreover you need to pause Galapagos during each simulation, or else it will continue to output solutions while you're still waiting for the old simulation in ANSYS to finish. I did this by (rudimentarily) imposing a Thread.Sleep() until the export data isn't updated. I hope David may have more elegant solutions for this. David, anything?

Well, I think that's about it. If you need any further advice let me know.

Cheers,
r
Comment by Amaury THOMAS on September 6, 2011 at 8:45am

Yes i understand your process, it's very clear and logical. thank you very much for sharing. I would like to make uniform the wind pressure on the skin of a building. Do you think it possible with ANSYS,GH,Galapagos ? I would be very glad to get some advise to achive it.

Comment by Riccardo La Magna on September 6, 2011 at 6:16am

Hi Thomas,

 

theoretically yes, you can couple any type of analysis you want to optimize. But this will depend on ANSYS, not on GH. To be more explicit, what the script does is 1) exporting the geometry on which you want to perform your structural (CFD, thermal, etc.) analysis, 2) firing ANSYS and invoking a Python script which runs the simulation on the new geometry. The optimization parameter is then automatically exported from ANSYS with a post-processing APDL Macro and read in GH.

Hope I made it clear enough.

 

Cheers,

r

Comment by Amaury THOMAS on September 6, 2011 at 3:57am

Great,

Could we use your GH ANSYS link to analyse wind in real feedback, and use galapagos to optimise a geometry ?

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

© 2013   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service