Hey everyone,
my goal is to perform a topology optimization (TO) on 50+ geometries in ANSYS. For a single simulation my current plan is pretty straightforward: I open a new Workbench file, create a static-structural module, connect a topology optimization module to it and basically do all the neccessary steps in ANSYS Mechanical (import geometry, meshing, boundary conditions, TO parameters, solving, post-processing and so on).
Since I also use Python in the background to do some other stuff the idea was to automate this process for multiple geometries using the PyANSYS (in the form of PyMechanical to be specific) interface. For some general code ideas I was able to use the 'script recording' functionality within Mechanical. But one major issue is the setup of the two modules involved here ('static-structural' and 'TO'):
How exactly do I create them using PyMechanical and how exactly do I establish the 'connection' between these two modules (displayed by the lines in Workbench) using the Python interface?
So far the progress stops at the creation of the modules:
import ansys.mechanical.core as mech
app = mech.App(version=231)
globals().update(mech.global_variables(app))
statAnalysis = Model.AddStaticStructuralAnalysis()
topOptAnalysis = Model.AddTopologyOptimizationAnalysis()
How to go ahead from here? Or is there another way to achieve the setup mentioned at the top? Ideally I am looking for a MWE.
Thanks for your time!