Models - Opt.mbb Beam Optimization
Models - Opt.mbb Beam Optimization
This model is licensed under the COMSOL Software License Agreement 5.6.
All trademarks are the property of their respective owners. See www.comsol.com/trademarks.
Introduction
Topology optimization in a structural mechanics context can answer the question: Given
that you know the loads on the structure, which distribution of the available material
maximizes stiffness? Or, conversely, how much material is necessary to obtain a predefined
stiffness, and how should it be distributed? Such investigations typically occur during the
concept design stages.
The conflicting goals of stiffness maximization and mass minimization lead to a continuum
of possible optimal solutions, depending on how you balance the goals against each other.
This topology optimization example demonstrates how to use a penalization method
(SIMP) to obtain an optimal distribution of a fixed amount of material such that stiffness
is maximized. Changing the amount of material available leads to a different solution
which is also Pareto optimal, representing a different balance between the conflicting
objectives.
Model Definition
The model studies optimal material distribution in the beam, which consists of a linear
elastic material, structural steel. The dimensions of the beam region — 6 meters by 1 meter
by 0.5 meters — means an original total weight of 23,550 kg. The beam is symmetric
about the plane x = 3. Both its ends rest on rollers while an edge load acts on the top
middle part (Figure 1).
The optimality criterion is defined by the objective function, which is chosen to be the
total strain energy in this example. Note that the strain energy exactly balances the work
done by the applied load, so minimizing the strain energy minimizes the displacement
induced at the points where loads are applied, effectively minimizing the compliance of the
structure — maximizing its stiffness. The other, conflicting, objective is minimization of
total mass, which is implemented as an upper bound on the mass of the optimized
structure.
The design can be described with a artificial material volume factor, θc which acts as
control variable in the optimization problem. In structural mechanics, convention dictates
that it is 0 in void domains and 1 in solid domains. In order to make the problem
formulation well-posed one has to limit the complexity of the design; otherwise the
optimization will just tell us that the optimal structure is a composite with infinitesimal
features, which cannot be resolved with any mesh. The detail of the design can be limited
using a filter that produces another field, θf which is guaranteed to be free of features
smaller than some set value, Rmin because it is computed as a solution to a Helmholtz
equation (see Ref. 1):
The equation essentially just smears out the design as illustrated below with and θc and θf
to the left and right, respectively.
Figure 2: The material volume factor (right) has a lot of gray scale.
This filtered design variable can then be projected to reduce the extent of the gray scale
region. COMSOL supports projection based on the hyperbolic tangent function, see
Ref. 2:
( tanh ( β ( θ f – θ β ) ) + tanh ( βθ β ) )
θ = -----------------------------------------------------------------------------------
( tanh ( β ( 1 – θ β ) ) + tanh ( βθ β ) )
This is illustrated for θβ = 0.5 and β = 8 below with θf and θ to the left and right.
Figure 3: The (projected) material volume factor shown to the right has no visible gray scale.
High values of β are associated with strong projection and less gray scale, but also slows
down the optimization process, so initially we will not use it and thus set θ = θf.
To prevent a completely solid design, we impose an overall limit Vfrac on the fraction θavg
of the domain area occupied by solid material
To guarantee a binary solution we use the SIMP penalization method (see Ref. 3) to
define the penalized field
p
θ p = θ min + ( 1 – θ min )θ ( x )
E ( x ) = E0 θp
Since the stiffness must for numerical reasons not vanish completely anywhere in the
model, the relative minimum Young’s modulus, θmin, has been introduced. The exponent
p ≥ 1 is a penalty factor which makes intermediate densities provide less stiffness compared
to what they cost in weight. Increasing p therefore forces θc toward either of its bounds
leading to a sharper solution.
Ideally, the topology of the resulting designs should be mesh independent and for designs
with moderate complexity this can be achieved, but if the optimal design is very complex,
other designs with slightly different topologies perform only marginally worse, so the
optimization problem has many local minima, and it is likely that a slightly sub-optimal
design is identified.
Finally, it is worth noting that the problem of finding a stiff design can be quite different
from finding a design that does not break and it is generally advised to use shape or
parameter optimization to ensure that the design is free of excessive stress concentrations.
Only the left half of the beam geometry must be modeled, because of the assumed
symmetry, which is implemented as a Roller condition on the symmetry plane. Plots for
postprocessing and inspection of the solution while solving are set up using a Mirror data
The optimization solver is selected and controlled from an Optimization study step. For
topology optimization, either the MMA or the SNOPT solver can be used. They have
different merits and weaknesses. MMA tends to be braver in the beginning, proceeding
quickly toward an approximate optimum, while SNOPT is more cautious but also
converges more efficiently close to the final solution thanks to its second-order
approximation of the objective.
This example demonstrates a strategy based on using MMA with a limited number of
iterations on successively finer meshes. It quickly and reliably produces trustworthy
topologies showing good improvement of the objective function value. These solutions
are not necessarily globally optimal, which may, however, be of less importance in practice.
References
1. B.S. Lazarov and O. Sigmund, “Filters in topology optimization based on Helmholtz-
type differential equations,” International Journal for Numerical Methods in
Engineering, vol 86, pp. 765–781, 2011.
2. F. Wang, B.S. Lazarov and O. Sigmund, “On projection methods, convergence and
robust formulations in topology optimization,” Structural and Multidisciplinary
Optimization, vol 43, pp. 767–784, 2011.
Modeling Instructions
From the File menu, choose New.
NEW
In the New window, click Model Wizard.
GLOBAL DEFINITIONS
Parameters 1
1 In the Model Builder window, expand the Component 1 (comp1)>Definitions node, then
click Global Definitions>Parameters 1.
2 In the Settings window for Parameters, locate the Parameters section.
3 In the table, enter the following settings:
GEOMETRY 1
Rectangle 1 (r1)
1 In the Geometry toolbar, click Rectangle.
2 In the Settings window for Rectangle, locate the Size and Shape section.
3 In the Width text field, type a.
4 In the Height text field, type b.
Point 1 (pt1)
1 In the Geometry toolbar, click Point.
2 In the Settings window for Point, locate the Point section.
Point 2 (pt2)
1 In the Geometry toolbar, click Point.
2 In the Settings window for Point, locate the Point section.
3 In the x text field, type a-L1/2.
4 In the y text field, type b.
5 In the Geometry toolbar, click Build All.
Load Boundary
1 In the Geometry toolbar, click Selections and choose Box Selection.
2 In the Settings window for Box Selection, type Load Boundary in the Label text field.
3 Locate the Geometric Entity Level section. From the Level list, choose Boundary.
4 Locate the Box Limits section. In the x minimum text field, type a-L1/1.999.
5 In the y minimum text field, type b*0.999.
6 Locate the Output Entities section. From the Include entity if list, choose
Entity inside box.
Symmetry y
1 In the Geometry toolbar, click Selections and choose Box Selection.
2 In the Settings window for Box Selection, type Symmetry y in the Label text field.
3 Locate the Geometric Entity Level section. From the Level list, choose Boundary.
4 Locate the Box Limits section. In the x maximum text field, type a*0.001.
5 In the y maximum text field, type L1*1.001.
6 Locate the Output Entities section. From the Include entity if list, choose
Entity inside box.
Symmetry x
1 In the Geometry toolbar, click Selections and choose Box Selection.
2 In the Settings window for Box Selection, type Symmetry x in the Label text field.
3 Locate the Geometric Entity Level section. From the Level list, choose Boundary.
4 Locate the Box Limits section. In the x minimum text field, type a*0.999.
5 Locate the Output Entities section. From the Include entity if list, choose
Entity inside box.
6 In the Geometry toolbar, click Build All.
MATERIALS
Roller 1
1 In the Model Builder window, under Component 1 (comp1) right-click
Solid Mechanics (solid) and choose Roller.
2 In the Settings window for Roller, locate the Boundary Selection section.
3 From the Selection list, choose Symmetry x.
Prescribed Displacement 1
1 In the Physics toolbar, click Boundaries and choose Prescribed Displacement.
2 In the Settings window for Prescribed Displacement, locate the Boundary Selection
section.
3 From the Selection list, choose Symmetry y.
4 Locate the Prescribed Displacement section. Select the Prescribed in y direction check
box.
This is effectively a roller condition along the x-axis, but it is applied on a vertical
boundary to avoid bending stiffness.
Boundary Load 1
1 In the Physics toolbar, click Boundaries and choose Boundary Load.
2 In the Settings window for Boundary Load, locate the Boundary Selection section.
3 From the Selection list, choose Load Boundary.
0 x
-100 [kN] y
MESH 1
Size
1 In the Model Builder window, under Component 1 (comp1) right-click Mesh 1 and choose
Edit Physics-Induced Sequence.
2 In the Settings window for Size, locate the Element Size section.
3 Click the Custom button.
4 Locate the Element Size Parameters section. In the Maximum element size text field, type
meshsz.
GLOBAL DEFINITIONS
Parameters 1
1 In the Model Builder window, under Global Definitions click Parameters 1.
2 In the Settings window for Parameters, locate the Parameters section.
3 In the table, enter the following settings:
Add a density topology feature, which can be used to distinguish between void and solid
regions. This variable is coupled back to the Solid Mechanics interface via the Young’s
modulus. The filter radius should not be smaller than the mesh element size, so the default
will work, but a fixed value has to be chosen to make the result of the optimization mesh
independent.
OPTIMIZATION
1 In the Model Builder window, click Study 1.
2 In the Settings window for Study, type Optimization in the Label text field.
3 Locate the Study Settings section. Clear the Generate default plots check box.
Parametric Sweep
1 In the Study toolbar, click Parametric Sweep.
2 In the Settings window for Parametric Sweep, locate the Study Settings section.
3 Click Add twice.
4 In the table, enter the following settings:
RESULTS
In the Model Builder window, expand the Results node.
Mirror 2D 1
1 In the Model Builder window, expand the Results>Datasets node.
2 Right-click Results>Datasets and choose More 2D Datasets>Mirror 2D.
3 In the Settings window for Mirror 2D, locate the Axis Data section.
4 In row Point 1, set X to a.
5 In row Point 2, set X to a.
6 Locate the Data section. From the Dataset list, choose Optimization/
Parametric Solutions 1 (sol2).
7 Click to expand the Advanced section. Select the Define variables check box.
Mirror 2D 2
1 Right-click Mirror 2D 1 and choose Duplicate.
2 In the Settings window for Mirror 2D, locate the Data section.
3 From the Dataset list, choose Optimization/Solution 1 (sol1).
Topology
1 In the Results toolbar, click 2D Plot Group.
2 In the Settings window for 2D Plot Group, locate the Data section.
3 From the Dataset list, choose Mirror 2D 1.
4 In the Label text field, type Topology.
Surface 1
1 Right-click Topology and choose Surface.
2 In the Settings window for Surface, locate the Expression section.
3 In the Expression text field, type if(mir1side,dtopo1.theta_c,dtopo1.theta_f).
4 Select the Description check box.
5 In the associated text field, type theta_c (left) and theta_f (right).
6 Locate the Coloring and Style section. From the Color table list, choose GrayScale.
7 Select the Reverse color table check box.
Topology 2
1 In the Model Builder window, right-click Topology and choose Duplicate.
2 In the Settings window for 2D Plot Group, locate the Data section.
Surface 1
1 In the Model Builder window, expand the Topology 2 node, then click Surface 1.
2 In the Settings window for Surface, locate the Expression section.
3 In the Expression text field, type if(mir1side,dtopo1.theta_f,dtopo1.theta).
4 In the Description text field, type theta_f (left) and theta (right).
Add the Topology Optimization study step, select a solver, limit the number of iterations and
switch on plotting while solving.
OPTIMIZATION
Topology Optimization
1 In the Model Builder window, under Optimization click Topology Optimization.
2 In the Settings window for Topology Optimization, locate the Optimization Solver section.
3 In the Maximum number of iterations text field, type 50.
4 Locate the Constraints section. In the table, enter the following settings:
5 Locate the Output While Solving section. Select the Plot check box.
6 From the Plot group list, choose Topology 2.
In general it is best to scale the objective function with the initial value, but in this case
the scale is close enough to 1 that it is unnecessary.
7 In the Home toolbar, click Compute.
RESULTS
Topology 2
Plotting the projected field gives a sharper and fairer picture of the topology, as seen by
the Solid Mechanics interface.