-->

Automated Design in CAD, Analysis in FEA, and Opti

2019-04-02 10:19发布

问题:

I would like to optimize a design by having an optimizer make changes to a CAD file, which is then analyzed in FEM, and the results fed back into the optimizer to make changes on the design based on the FEM, until the solution converges to an optimum (mass, stiffness, else).

This is what I envision:

  • create a blueprint of the part in a CAD software (e.g. CATIA).
  • run an optimizer code (e.g. fmincon) from within a programming language (e.g. Python). The parameters of the optimizer are parameters of the CAD model (angles, lengths, thicknesses, etc.).
  • the optimizer evaluates a certain design (parameter set). The programming language calls the CAD software and modifies the design accordingly.
  • the programming language extracts some information (e.g. mass).
  • then the programming language extracts a STEP file and passes it a FEA solver (e.g. Abaqus) where a predefined analysis is performed.
  • the programming language reads the results (e.g. max van Mises stress).
  • the results from CAD and FEM (e.g. mass and stress) are fed to the optimizer, which changes the design accordingly.
  • until it converges.

I know this exists from within a closed architecture (e.g. isight), but I want to use an open architecture where the optimizer is called from within an open programming language (ideally Python).

So finally, here are my questions:

  • Can it be done, as I described it or else?
  • References, tutorials please?
  • Which softwares do you recommend, for programming, CAD and FEM?

回答1:

Yes, it can be done. What you're describing is a small parametric structural sizing multidisciplinary optimization (MDO) environment. Before you even begin coding up the tools or environment, I suggest doing some preliminary work on a few areas

  1. Carefully formulate the minimization problem (minimize f(x), where x is a vector containing ... variables, subject to ... constraints, etc.)
  2. Survey and identify individual tools of interest
  3. How would each tool work? Input variables? Output variables?
  4. Outline in a Design Structure Matrix (a.k.a. N^2 diagram) how the tools will feed information (variables) to each other
  5. What optimizer is best suited to your problem (MDF?)
  6. Identify suitable convergence tolerance(s)

Once the above steps are taken, I would then start to think MDO implementation details. Python, while not the fastest language, would be an ideal environment because there are many tools that were built in Python to solve MDO problems like the one you have and the low development time. I suggest going with the following packages

  • OpenMDAO (http://openmdao.org/): a modern MDO platform written by NASA Glenn Research Center. The tutorials do a good job of getting you started. Note that each "discipline" in the Sellar problem, the 2nd problem in the tutorial, would include a call to your tool(s) instead of a closed-form equation. As long as you follow OpenMDAO's class framework, it does not care what each discipline is and treats it as a black-box; it doesn't care what goes on in-between an input and an output.
  • Scipy and numpy: two scientific and numerical optimization packages

I don't know what software you have access to, but here are a few tool-related tips to help you in your tool survey and identification:

  • Abaqus has a Python API (http://www.maths.cam.ac.uk/computing/software/abaqus_docs/docs/v6.12/pdf_books/SCRIPT_USER.pdf)
  • If you need to use a program that does not have an API, you can automate the GUI using Python's win32com or Pywinauto (GUI automation) package
  • For FEM/FEA, I used both MSC PATRAN and MSC NASTRAN on previous projects since they have command-line interfaces (read: easy to interface with via Python)
  • HyperSizer also has a Python API
  • Install Pythonxy (https://code.google.com/p/pythonxy/) and use the Spyder Python IDE (included)
  • CATIA can be automated using win32com (quick Google search on how to do it: http://code.activestate.com/recipes/347243-automate-catia-v5-with-python-and-pywin32/)

Note: to give you some sort of development time-frame, what you're asking will probably take at least two weeks to develop.

I hope this helps.