Post

PyFEM - topology optimization

PyFEM

I developed PyFEM, a finite element method (FEM) code specifically designed for topology optimization this time. The main goal behind creating this code is to provide a straightforward and practical tool for readers and learners who want to deepen their understanding of the finite element method. Implemented in Python using basic libraries and NumPy for numerical computations, PyFEM aims to simplify the complexities of FEM simulations, making it especially accessible for those interested in topology optimization.

For readers unfamiliar with the code, you can refer to the previous article for an introduction.

Topology optimization

Topology optimization seeks to identify the most efficient distribution of material within a structure, ensuring it meets its functional requirements while minimizing material usage. This approach is essential for enhancing efficiency and reducing costs.

For instance, consider the scenario of 3D-printing an arm cast in a spaceship (Figure 1). In this context, minimizing weight is critical, as every kilogram launched into space significantly increases costs. Therefore, using a traditional HEAVY gypsum cast would be impractical and expensive. The optimized design not only protects the injured area effectively but also contributes to overall weight reduction, making it a more viable solution for space missions.


Figure 1. 3D printing a cast in the SF movie "Stowaway"

In this article, we adopt the approach of using a pseudo-density function that takes values between 0 and 1, representing the material density at different points. The topology optimization problem involves finding an optimal distribution of this pseudo-density by considering the objective function, such as minimizing compliance or weight, while fulfilling design constraints like volume fraction limits.

To find the optimal material distribution, we penalize intermediate density values (those between 0 and 1) to encourage a clear 0/1 material distribution, thereby avoiding intermediate states that have low structural efficiency. The optimization process relies on calculating the gradient of the objective function with respect to the material volume, which involves iteratively updating the pseudo-density to find an optimal solution that meets the requirements of the problem .

Messerschmitt-Bölkow-Blohm (MBB) beam problem


Figure 2. Schematics of MBB beam problem"

input

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
*Title
MBB_beam_15201_30000

*Mesh
./Mesh/MBB_beam/MBB_beam_15201_30000

*ConstitutiveLaw
Solid
linearelasticity
1.0	0.3

*BCFile
BDC.BC_MBB_beam

*Plane
PlaneStress	1.0

*PlasticModel
PlasticModel.LinearElastic

*ResultDirectory
./Result/result_MBB_beam/15201_30000

Result

Reference

This code is implementd based on this paper.

This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.