Shape optimization of mechanical systems in
COMSOL Multiphysics 4.4
Thomas Agger (s113357)DTU Mechanical Engineering
Department of Mechanical Engineering Technical University of Denmark
Nils Koppels Allé Building 404
2800 Kongens Lyngby, Denmark Phone +45 4525 1960
[email protected] www.mek.dtu.dk
This paper investigates parametric shape optimization in COMSOL Multiphysics. The strengths and weaknesses of the parametric and non-parametric methods are discussed. Furthermore, three classic shape optimization problems are parameterized and analyzed with the use of COMSOL. The models investigated are a beam, a hole in a plate under biaxial stress and a fillet on a bar.
The results of these optimizations are compared to analytical work as well as numerical work from other shape optimization methods. Furthermore the difficulties regarding shape optimiza-tion in COMSOL are discussed.
This bachelor’s thesis was prepared at the Department of Mechanical Engineering at the Tech-nical University of Denmark in fulfillment of the requirements for acquiring a B.Sc.Eng. degree in Mechanical Engineering. The project was realized in the period between the 4th February and 24th June 2014 with the supervision of Ole Sigmund and Niels Aage. The project is credited 20 ECTS points.
Kongens Lyngby, December 2, 2014
First and foremost I would like to thank my two supervisors, Professor Ole Sigmund and Researcher Niels Aage, for their support and help throughout my thesis.
Furthermore I would like to thank Rune Westin and Thure Ralfs from COMSOL for their support when COMSOL was misbehaving.
Abstract i Preface iii Acknowledgements v Contents vii 1 Introduction 1 2 Theory 3 2.1 Shape optimization . . . 3
2.2 Parameter free shape optimization . . . 3
2.3 Parametric shape optimization . . . 5
3 Optimizing the shape of a cantilever beam 7 3.1 Model definition . . . 7
3.2 Results and discussion . . . 11
3.3 Modeling instructions . . . 16
4 Optimization of a plate with a hole 23 4.1 Model definition . . . 23
4.2 Results and discussion . . . 27
4.3 Modeling instructions . . . 33
5 Optimizing the shape of a fillet 43 5.1 Model definition . . . 43
5.2 Results and discussion . . . 44
5.3 Modeling instructions . . . 50
6 Conclusion 59 6.1 Future work . . . 59
Appendix A Cantilever Beam 61 A.1 Standard . . . 61
A.2 One summation . . . 64
A.3 Two summations . . . 68
A.4 Three summations . . . 72
A.5 Four summations . . . 76
viii Contents
Appendix B Plate with a hole 87
B.1 Tensile ratio of 1 . . . 87 B.2 Tensile ratio of 2 . . . 92 B.3 Tensile ratio of 3 . . . 97 Appendix C Fillet 105 C.1 Standard . . . 105 C.2 One summation . . . 107 C.3 Two summations . . . 112 C.4 Three summations . . . 117 C.5 Four summations . . . 122 C.6 Five summations . . . 127 Bibliography 133
Abbrevation Meaning
σvM von Mises Stress
Disp. Displacement
C Stress optical coefficient,
compli-ance
U Elastic strain energy
CHAPTER
1
Introduction
The 27th of November 2013 COMSOL released a new version of their FEM software. With COMSOL Multiphysics 4.4 they offered new opportunities for doing shape and topology opti-mization. With version 4.4 they introduced two new optimization solvers: BOBYQA, which is a gradient-free optimization solver, and MMA, which is gradient-based; thus giving new abilities for optimization solving.For a long time COMSOL have had great capabilities for doing topology optimization, but has been lacking in the area of shape optimization. As of right now is are only one model in COMSOL’s model library that shows how to do shape optimization, but this model is very limited in its application to more complex problems as well as mechanical problems. The model shows how the sound pressure from a horn can be optimized for a given angle by parameter-izing one boundary. However, there is no good documentation on geometric parameterization in COMSOL and the complexity rises when more than one boundary has to be parameterized. Therefore the main goal of this project has been to explore the strengths and weaknesses for shape optimization, map the capabilities for doing shape optimization and apply these capa-bilities to mechanical problems in COMSOL.
The first focus of the project is to optimize the shape of a cantilever beam. A simple problem that is much more troublesome than anticipated. The first real obstacle is to figure out how to configure the parameterizations using prescribed mesh displacement when having more than one boundary. Another obstacle is figuring out the right scale factors in such a way that inverted elements do not occur in the model.
The next focus of the project is to investigate a more advanced problem. A plate with a hole in the middle is to be investigated and benchmarked in accordance with former analytical studies .
The last focus of the project will be to look at a 3D model. The object will be to opti-mize the shape of a fillet on a 2D axisymmetric bar. The parameterization technique will be similar to the one used in the two other models, but will be able to produce results in 3D.
A question that might arise is ”why is it so interesting to do shape optimization in COMSOL when there is a lot of other software capable of doing the same thing?”
The other shape optimization software around typically has a lot of limitations compared to COMSOL. For instance, some of the software only has 2D capabilities, whereas COMSOL offers both 2D and 3D shape optimization. COMSOL also offers built-in CAD tools. This enables the user to create 1D, 2D and 3D models directly in the software. If the user have an advanced geometry it is also possible to import CAD models from separate CAD software. In addition to this COMSOL also offers very good options for topology optimization which a lot of other software also lacks, which is a huge advantage seeing as it can be interesting to do both shape and topology optimization on the same model. Furthermore COMSOL has the ability to combine multiple physics, hence the name COMSOL Multiphysics. This means that while doing shape optimization on a mechanical structure it is also possible to see how other physics will affect the model, e.g. COMSOL is capable of doing FE calculations for acoustics, electrochemistry, heat transfer, and many other branches of physics.
CHAPTER
2
Theory
2.1 Shape optimization
Structural shape optimization can be formulated with mathematical terms by the following equation [1]: min x∈Rnf (x) with { xl≤ x ≤ xu g(x)≤ 0
Here f (x) is the objective function, meaning the parameter sought to be either minimized or maximized in the optimization. For mechanical problems it is common practice to minimize the objective function for the total volume or the total strain energy of the model. By minimizing the total strain energy, the compliance is minimized, thus increasing the stiffness. The vector,
x, is made up of the design variables, xj, which control the size, shape and topology of the model. These design variables are optimized to get the best structure within their constraints. The design variables’ constraints are defined by a lower and upper bound, xl and xu, respec-tively. Behavior inequality constraints, g(x), are typically used for applying limitations on stresses, deflections, and natural frequencies or to make sure the structure meets its demands. Shape optimization is divided into two main groups, which deal with the change of the shape in different ways; parametric and non-parametric shape optimization. They both have their strengths and weaknesses which will be looked into in this chapter.
2.2 Parameter free shape optimization
There are a lot of variations to the parameter free approach, but the general idea is that it uses FE-based data as design variables, for instance nodal coordinates, nodal thickness, element thickness etc.
The advantage of using the non-parametric approach is that it allows the greatest degree of freedom regarding the shape change; it is independent of the function describing the boundaries to be optimized. Another advantage is that the user completely avoids parameterizing the boundaries, which can be very time-consuming and demands thorough knowledge of geometric functions and linear combinations when optimizing complex structures.
The main weakness of this method is its lack of a length scale control [2]. Without a length scale control the method doesn’t produce any meaningful results seeing as the boundaries become jagged, see Figure 2.1. These jagged boundaries are neither optimal nor desirable as they result in immense stress concentrations that are very sensitive to the local shape change. Furthermore the shape seen in Figure 2.1(a) isn’t a realistic shape for manufacturing.
(a) The jagged boundaries when length scale control is not applied
(b) When using the length scale control the jagged boundaries are smoothed out
Figure 2.1: Illustrations borrowed from [2]
Another problem occurs when using the nodal coordinates as design variables. The design updates can change the mesh of the structure without changing the shape of the structure [1, Fig. 1]. This makes the solution of the optimization problem non-unique seeing as a surface can be represented by an infinite number of finite element meshes [1].
However, both of these problems can be solved using regularization. The problem with non-uniqueness can be solved by achieving a regular mesh without element distortions; to achieve this in-plane regularization is used. Laplace regularization is widely used for mesh regulariza-tion. The way that Laplace regularization works is by attempting to change the mesh in such a way that the mesh will consist of square elements with the same area content. This is done by iteratively moving each mesh node to the center of gravity for its adjacent nodes [1][3]. The problem with the smoothness of the boundaries are solved with out-of-plane regularization (sensitivity filtering). The out-of-plane regularization controls the local curvature of the result, thus giving the boundary the smoothness required. The jagged boundaries occurs because of the discretization errors from the sensitivity fields. In short these sensitivity errors are filtered by modifying the response gradients. This is where the use of a length scale control comes in. Despite its problems, parameter-free optimization still has its strengths. This approach is able to explore a large number of solutions with a considerable degree of freedom for changing the model while greatly reducing the time required for modeling the structure.
2.3 Parametric shape optimization 5
2.3 Parametric shape optimization
In this approach, instead of using the FE data as design variables, the boundaries of the original geometry is parameterized such that the shape of the structure can be changed by adjusting a set of parameters. To avoid long computational time it is preferred to describe the geometry with as few parameters as possible, but with a parameterization that gives the geometry the greatest degree of freedom for shape change. A number of different parameterization methods exist but the basis is the same; describing the boundaries by means of geometric functions with parameters that can be tweaked. A few of the methods will be described below.
Discrete approach
This approach uses the coordinates of the boundary points as design variables, see Figure 2.2. This approach gives a great degree of freedom seeing as it is only limited by the design variables describing the structure. In addition to this it is also easy to implement.
Figure 2.2: An airfoil described using the boundary points. Illustration borrowed from [4]
The disadvantages of using this approach are that for complex structure a large number of design variables are necessary to describe the geometry thus leading to high computational time, moreover the smoothness of the geometry is hard to obtain if using too few design variables. The smoothness problem can be solved by using multi-point constraints [4] which makes it possible to ”connect” different nodes and degrees of freedom [5] and by adding dynamic adjustments of the upper and lower bounds.
Natural design approach
A varitation of the discrete approach is the natural design approach. The natural approach uses an auxiliary structure similar to the original structure. Fictitious loads are then added to the auxiliary structure and the mesh is updated by adding the auxiliary nodal displacement to the current nodal coordinates. These fictitious shape loads are chosen using nonlinear programming methods [6], e.g. Pedersen et. al [7] use eigenvectors from a fictitious modal analysis to define orthogonal shape basis functions [2].
Polynomial and spline approach
With the use of polynomial and spline functions the number of design variables can be greatly reduced compared to the discrete and natural design approach seeing as they can describe a whole boundary; this makes them particularly suitable for shape optimization. The optimiza-tion parameters are incorporated in the expressions, and therein there is no other need for design variable constraints than the ones set for the optimization parameters.
One of the advantages of this approach is that a nice smooth boundary is obtained. The poly-nomial has a very compact form for describing geometries. Unfortunately it’s only good for describing simple curves seeing as it has a tendency for round-off errors when the coefficients have too large variation.
The Bézier curves are based of on Bernstein polynomials [8] and are very similar, in a math-ematical point of view, to the polynomial form. A general form for a Bézier curve is given by: B(t) = n ∑ i=0 Pibi,p(t) s∈ [0, 1] (2.1)
Pi are denominated the control points and act as design variables in the optimization, n is the number of control points, and bi,p(t)are the Bernstein polynomials of the pth degree. Despite their resemblance, the Bézier curves are a much better representation than the polynomial form, and the control points used in the expression are very closely related to the curve positioning, which is beneficial when setting the geometric constraints [4]. The Bézier curve is great for shape optimization for simple geometries, like the polynomial form. The more complex a curve is, the higher the degree of the Bernstein polynomials needs to be in order to describe it properly. Unfortunately the round-off error increases when the degree of the Bernstein polynomials increases, on top of that the computational time for high-degree Bézier curves is high [9].
A better way to describe complex curves is to use a series of low-degree Bézier curves called Basis spline, or B-spline. The advantages of these splines is their ability to describe complex curves accurately and efficiently.
The weakness of the polynomial and spline approach is its inability to describe complex 3D structures entirely from polynomial forms and splines as they need a lot of control points. The strengths, however, are numerous: it has the ability to handle surfaces; to handle large geometry changes; to handle local shape changes; and to give a smooth surface/boundary.
CAD-based approach
The CAD-based approach uses the benefits of having the structure already drawn and is a fully integrated solution saving time from geometric modeling. The CAD part can be an integrated part of the FE software or a separate program and is either based on boundary representation or a constructive solid geometry method to represent the physical, solid object [4]. In the CAD software it is possible to describe the boundaries or the surfaces of the structure with linear combinations of basic functions. Some of the parameters of these functions are then used as design variables for the optimization procedure. The use of the CAD approach allows for optimization for both 2D and 3D, and it’s limitations are dependent on the user’s ability to parameterize. In order to get good results when parameterizing this way, it is crucial that the initial guess of the basic functions is good, seeing as the basic functions can be what limits the optimization. Another strength of this method is that the smoothness of the boundary is such that you get smooth boundaries with little effort. The drawback is that it can be quite time consuming to implement the linear combinations, and the optimization is greatly reliable on how good the initial guess for shape function is.
CHAPTER
3
Optimizing the shape of a cantilever beam
This model shows how to apply boundary shape optimization to a cantilever beam. The model will focus on optimization when more than one boundary has to be parametrized. Optimal objective function and the use of probes will also be investigated.3.1 Model definition
The cantilever beam is a classic mechanical problem. It is a beam anchored at one end and carries the load along its length or in the other end. Thus the upper half of the beam is sub-jected to tensile stress whereas the lower half is subsub-jected to a compression. It’s a structure that is mostly employed in construction; among these are especially cantilever bridges and balconies. The beam to be studied is made of a linear elastic material; structural steel. The dimen-sions of the beam are 10 m×1 m×0.5 m, meaning it has a total weight of 39,250 kg. The beam is fixed at x = 0 and has a boundary load in x = a with a total magnitude of P = 1000 kN, see Figure 3.1.
P
a
b
Figure 3.1: The beam with dimensions a× b × d
The parameterization of the upper part of the beam is going to be described by the following function from [10]: dy = N ∑ i=1 qicisin(iπx) (3.1)
Where x is the parameterization parameter that varies from 0 to 1 along the boundary, ci are scale factors and qi are the optimization variables. By increasing the number of optimization variables the optimization obtains a higher degree of freedom to optimize, thus potentially achieving a better value of the objective function. However, this will also increase sensitivity and if the scale factors aren’t right the solution can continue into the undefined region, thus creating an unfeasible model. The magnitude of the scale factors depend on how many terms from equation 3.1 are included, but generally speaking ci should beR ∈ [0, 1]. If i → ∞ then
ci → 0 meaning that the parameterization becomes more and more sensitive when more terms are included, thus the terms have to be scaled more to make sure that the model is still feasible.
Equation (3.1) will be modified slightly to fit the situation in question. The parameterization describes the change in the y-direction for the upper boundary, for simplicity N = 1 and the scale factors ci are removed to begin with, thus equation (3.1) becomes:
dy = q1sin(πx) (3.2)
The boundaries to be parametrized can be seen on Figure 3.2. This figure also shows the name and direction of the parameterizations.
0 10 10 1 1 0 s 1(x) s3(x) s2(x) s 4(x)
Figure 3.2: Boundaries to be parametrized and the direction of the parameterization
param-eters
In order to make the height of parameterization s2(x) change according to the height of pa-rameterization s1(x)and s3(x) the terms (1− x)s1(1) + xs3(0) are added to equation 3.2. In Figure 3.2 the boundaries to be parametrized can be seen plus the direction of the param-eterization parameters. The boundary s4(x)isn’t to change during the optimization therefore the parameterization will be s4(x) = 0. The parameterization of the four boundaries can be seen below:
s1(x) = p1x (3.3)
s2(x) = (1− x)s1(1) + xs3(0) + q1sin(πx) (3.4)
s3(x) = p2(1− x) (3.5)
s4(x) = 0 (3.6)
With the optimization parameters set to p1 = p2 = q1 = 0 the model will be a regular beam. By changing the parameters to p1 = q1 = 1and p2 = 0the beam seen in Figure 3.3 will appear. It is quite obvious that this beam has an increase in the area. Whereas the original had an area of 10 m2 this new beam has an area of 21.4 m2.
3.1 Model definition 9
Before the optimization can begin the objective function has to be defined. The objective function is what defines the criterion for optimality. In this model the goal is to minimize the displacement of the beam in the y-direction. The displacement can be minimized through the total elastic strain energy in the point where the total load is acting on, since the equation for strain energy is equal:
U = 1
2P δ (3.7)
Where P is the force acting in the end and δ is the displacement produced by the force . It can be seen that the elastic strain energy is directly proportional to the displacement, therefore by minimizing the strain energy the compliance of the structure is minimized, thus maximizing the stiffness.
Another condition for the optimization is an area constraint. If an area constraint isn’t applied to the model, the optimization parameters will just reach their upper bound as that would give the strongest structure, but also the heaviest. The area constraint for this model will be the original area, a· b = 10 m2. If the wish was to get a lighter structure and still maintain the strength, that could be accommodated by multiplying the constraint with a scale factor. In the model the parameterizations are implemented by the use of the prescribed boundary displacement in the Deformed Geometry interface. The beam is set to have free deformation. In order to avoid inverted elements in the model when it changes form due to the optimization, a mapped quad mesh is used instead of a tri mesh seeing as quad and mapped meshes are less likely to become inverted [11, p. 471]. Another thing to help avoiding inverted mesh elements are the scale factors, ci, when using a higher order summation. It is also necessary to take great care when setting the boundaries for the optimization variables; if given too much freedom inverted elements will occur.
The Deformed Geometry interface is primarily used to study how the physics of the model change when the geometry of the model changes; it is therefore ideal for shape optimziation. It is worth noticing that the model isn’t remeshed when using the Deformed Geometry interface, instead the mesh is deformed. Typically when looking at multiple versions of the same model, a new mesh is created per each new iteration, but by using Deformed Geometry the mesh elements are instead being ”stretched”. The original mesh can be seen on Figure 3.4 whereas the morphed mesh of Figure 3.2 can be seen on Figure 3.5.
Figure 3.4: The original mesh of the standard beam
Figure 3.5: The original mesh of the standard beam morphed to fit the new model
The advantage of deforming the mesh elements, instead of remeshing, is speed. For this particular model the difference between remeshing and morphing isn’t so distinct, but for larger models and models with finer meshing there is a notable difference seeing as creating a new mesh each time can be quite time-consuming.
However, if the deformations in the mesh becomes too large, inverted mesh elements can occur. There are a number of ways to avoid this[11, p. 861]:
• Changing the mesh. A good method for changing the mesh is to use a predefined mesh and then changing the maximum element size. As stated earlier it is also useful to use quad meshes to prevent inverted mesh elements.
• Another mesh smoothing type can also be used. By standard it is set to Laplace smooth-ing which is the least time-consumsmooth-ing to use seesmooth-ing as it is linear and uses one uncoupled equation for each coordinate direction. This mesh smoothing type is most suitable for small, linear deformations.
The other smoothing types are non-linear and use a single coupled system of equations for all coordinate directions; this makes it more demanding for computational power, they are nevertheless better at avoiding inverted mesh elements.
3.2 Results and discussion 11
• One of the advantages of the Deformed Geometry is that it isn’t necessary to remesh. However, the mesh quality can become too poor, if the mesh deformations become suf-ficiently large, thus making it necessary to remesh. This can be done with an ”adaptive mesh refinement” in COMSOL, but the use of this feature also eliminates the use of mapped quad meshes seeing as it only works on tri meshes.
3.2 Results and discussion
By changing the shape of a standard beam without altering the volume, the displacement of the right end can be lowered by 65%. In addition to this the distribution of the stresses will be more evenly spread out and the peak value of the stresses will be only half as big!
On Figure 3.6 the standard beam can be seen. It is quite clear that the stresses are highly concentrated at the end where the beam is fixed, whereas the stresses in the other end are a fraction of that.
Figure 3.6: Standard beam with no optimization done, q1 = q2 = p1= 0
Table 3.7 shows the key values from the solution of the standard beam, these values will set a benchmark for the optimizations. The main goal of the optimization is to increase stiffness and decrease stress peaks.
σvM,max [MPa] U [J/m3] Utot [J] Area [m2] Y-disp. [m]
137.78 3580 17900 10 -0.036
Table 3.7: Values for the standard beam, reference points for the optimization
Figure 3.8 shows an optimized beam with optimization parameters p1 = 0.33, q1 = 0.44 and
p2 = −0.9. The parameterization of the upper boundary only has one summation (N = 1) meaning it’s a single sine curve.
Figure 3.8: Optimized beam with one summation and p1= 0.33, q1 = 0.44 and p2=−0.9
From the scale of the von Mises stress it is obvious that the peak stress has decreased con-siderably, it is in fact 89% lower. By comparing Table 3.9 and Table 3.7 it can also be see that the elastic strain energy has been reduced a great amount, which comes to show in the displacement which has been reduced by almost 56%. Another thing worth noticing is that the stress is much more evenly distributed on Figure 3.8. The stress along the axis of the beam is almost constant ensuring that the fixed end isn’t exposed to stresses significant higher than at the other end.
σvM,max [MPa] U [J/m3] Utot [J] Area [m2] Y-disp. [m]
73.01 2298 11490 10 -0.023
Table 3.9: Values for a optimized beam with N = 1, p1= 0.33, q2 = 0.44and p2 =−0.9
It should also be noted that there are stress singularities at the corners of the fixed end (larger versions of the stress plots can be found in Appendix A). The reason for stress singularities is that the area of the corners is very small and approaching zero meaning that the stresses are approaching infinite. These singularities will not appear in the real world because when a beam is fixed, the material will still yield a bit and/or the support material will move slightly to allow the point stress to remain finite [12].
To see if the beam can be optimized further with the sine parameterization, the optimiza-tion has been run for N = [1, 5], where N ∈ Z. When going higher than N = 1, it is necessary to remember the scale factors, otherwise there’s a high possibility that the model will go out of bounds and return an unfeasible solution. Figure 3.10 shows the solution to the optimization when N = 5. The plot doesn’t look that much different to Figure 3.8, and it’s a bit hard to see all five sine curves but the stresses are lower. In Table 3.11 the key values of all optimizations are compared.
3.2 Results and discussion 13
Figure 3.10: Optimized beam with five summations and p1 = 0.47, p2 =−0.84, q1 = 0.27,
q2 =−0.61, q3 = 0.36, q4=−0.17, and q5 = 0.13
σvM,max [MPa] U [J/m3] Utot [J] Area [m2] Y-disp. [m]
Std. 137.78 3580 17900 10 -0.036 N = 1 73.01 2298 11490 10 -0.023 N = 2 71.13 2161 10806 10 -0.022 N = 3 69.73 2156 10781 10 -0.022 N = 4 69.73 2154 10771 10 -0.022 N = 5 70.53 2153 10765 10 -0.022
Table 3.11: Comparison of key values for optimized beams
As mentioned earlier there’s a big difference between the standard beam and the first optimiza-tion with N = 1. The difference between one summaoptimiza-tion and five summaoptimiza-tions for the param-eterization of the upper boundary shows an improvement of 6,7%. However, the improvement from N = 2 to N = 5 is only 0,4% which shows it is a bit excessive to have multiple sine curves. Figure 3.12 and Figure 3.13 support the von Mises stress surface plots seen on Figure 3.6, 3.8, and 3.10 and give a clearer image of how the stress is distributed along the upper bound-ary. The stress on the standard beam, Figure 3.12, shows a very high stress singularity at
x = 0m and then a drop before slightly increasing again, the stress then decreases linearly until it reaches x = 10 m with a magnitude of ≈ 2 − 3 MPa.
Figure 3.12: von Mises stress along the upper boundary for the standard beam
Figure 3.13 shows the von Mises stress along the upper boundary too. The same stress sin-gularity can be seen, but the peak stress is approximately 90% lower. Another thing worth noticing is that stress along the boundary is almost constant, if excluding the ends. The stress varies from≈ 45 − 50 MPa, which is a great improvement compared to before where it varied from ≈ 10 − 100 MPa.
Figure 3.13: von Mises stress along the upper boundary for an optimized beam with five
summation and p1 = 0.47, p2 = −0.84, q1 = 0.27, q2 = −0.61, q3 = 0.36,
q4 =−0.17, and q5= 0.13
In appendix A the stresses along the upper boundary can be found for the standard beam and the beams with N = 1..5 in higher resolution. The higher the order, the more constant the stress variation becomes, which makes sense seeing it has more ”degrees of freedom” to change. The results found for this model also make sense according to Pedersen’s work regarding beams’ analytic optimal designs [13]. For a beam similar to the one examined in this project, Pedersen was able to reduce the compliance to 65%, see Figure 3.14.
3.2 Results and discussion 15
Figure 3.14: Left: optimal design with obtained compliance. Right: the corresponding
can-tilever elementary load cases. Illustration and text borrowed from [13]
The compliance of the COMSOL model was also 65%. However, there are a few differences between Pedersen’s analytical work and this model. Pedersen uses a point load at the end, whereas in this model a boundary load has been used. Pedersen also parameterizes both the upper and lower boundary; this model only focuses on the upper.
3.3
Modeling instructions
The following will describe how to create the model. From the File menu, choose New
NEW
1 In the New window, click the Model Wizard button
MODEL WIZARD
1 In the Model Wizard window, click the 2D button
2 In the Select Physics tree, select Mathematics>Deformed Mesh>Deformed Geom-etry (dg).
3 Click the Add button
4 In the Select Physics window, select Structural Mechanics>Solid Mechanics (solid). 5 Click the Add button
6 In the Select Physics tree, select Mathematics>Optimization and Sensitivity>Optimization (opt).
7 Click the Add button. 8 Click the Study button
9 In the tree, select Preset Studies for Selected Physics>Stationary 10 Click the Done button
GLOBAL DEFINITIONS
Parameters
1 On the Home toolbar, click Parameters
2 In the Parameters settings windows, locate the Parameters section 3 Click Load from file
4 Browse to find the file called beam_shape_optimization_parameters.txt and double-click
it to load the parameters
GEOMETRY 1
3.3 Modeling instructions 17
1 In the Model Builder window, right-click Geometry 1 and choose Rectangle 2 In the Rectangle settings window, locate the Size section
3 In the Width edit field, type a 4 In the Height edit field, type b 5 Click the Build All Objects button
MATERIALS
Add material
1 Go to the Add Material window
2 In the tree, select Built-In>Structural Steel
3 In the Add material window, click Add to Component and choose Component 1
SOLID MECHANICS (SOLID)
Fixed Constraint 1
1 On the Physics toolbar, click Boundaries and choose Fixed Constraint 2 Select Boundary 1 only.
Boundary Load 1
1 On the Physics toolbar, click Boundaries and choose Boundary Load 2 Select Boundary 4 only.
3 In the Boundary Selection window, locate the Force section 4 Under Load type, change it to Total force
5 Let the x component remain 0, but change the y component to -F_T
DEFORMED GEOMETRY (DG)
Free Deformation 1
2 Select Domain 1.
Prescribed Mesh Displacement 2
1 On the Physics toolbar, click Boundaries and choose Prescribed Mesh Displacement 2 Select Boundary 1 only.
3 In the Prescribed Mesh Displacement settings window, locate the Prescribed Mesh Displacement section
4 In the dY field type q1*s
Prescribed Mesh Displacement 3
1 On the Physics toolbar, click Boundaries and choose Prescribed Mesh Displacement 2 Select Boundary 3 only.
3 In the Prescribed Mesh Displacement settings window, locate the Prescribed Mesh Displacement section
4 In the dY field type q1*(1-s)+q3*s+q2*sin(pi*s)
Prescribed Mesh Displacement 4
1 On the Physics toolbar, click Boundaries and choose Prescribed Mesh Displacement 2 Select Boundary 4 only.
3 In the Prescribed Mesh Displacement settings window, locate the Prescribed Mesh Displacement section
4 In the dY field type q3*(1-s)
MESH 1
Free Quad 1
1 In the Model Builder window, under Component 1 (comp1) right-click Mesh 1 and
choose Free Quad
2 In the Free Quad settings window, locate the Domain Selection section 3 From the Geometric entity level list, choose Domain
3.3 Modeling instructions 19
4 Select Domain 1
Size
1 In the Model Builder window, under Component 1 (comp1)>Mesh 1 click Size 2 In the Size settings window, locate the Element size section
3 Under Predefined, select Extra fine from the list 4 Click the Build All button
STUDY 1
Before starting the actual optimization it can be a good idea to check the model by solving for the default parameters. In this way you have a good reference point when doing the optimiza-tion later.
Solver 1
1 On the Study toolbar, click Show Default Solver
2 In the Model Builder window, expand the Study 1>Solver Configurations node 3 In the Model Builder window, expand the Solver 1 node, then click Stationary Solver
1
4 In the Stationary Solver settings window, locate the General section 5 From the Linearity list, choose Nonlinear
6 On the Home toolbar, click Compute
RESULTS
von Mises Stress
The default plot in the main window shows the von Mises stress surface distribution in the beam. Note that stress reaches its maximum near the fixed constraint and is practically zero where we apply the force. This is as expected.
Right now the deformation is being displayed as well for the stress plot, to disable this do the following
1 In the Model Builder window, locate Results>Stress (solid)
2 Right-click Stress (solid) and click Rename, rename it to ”von Mises stress, solution
3 Expand the von Mises stress, solution 1 node, then the Surface 1 node
4 Right-click Deformation 1 and click delete. The plot should automatically be replotted
without showing the deformation
Displacement
1 On the Results toolbar, click 2D Plot Group
2 Right-click the new 2D Plot Group and click Rename. Change the name to Y-displacement,
solution 1
3 Right-click the plot group and click Surface
4 The Surface window will open, locate the Expression section. The standard expression is
solid.disp, change this to v either by editing the field or by cliking the button Replace
expression and then navigating to Solid Mechanics>Displacement>Displacement Field (material)>Displacement Field, Y component (v)
5 To show the actual deformation (although scaled), right-click Y-displacement, solution 1>Surface 1 and click Deformation. The Deformation window will show the scaling
factor under the section Scale
ADD STUDY
1 To add a new study for the optimization, go to the Home toolbar and click Add Study 2 Go to the Add Study window
3 Find the Studies subsection. In the tree, select Preset Studies>Frequency Domain 4 In the Add study window, click Add study
5 On the Home toolbar, click Add Study to close the Add Study window
STUDY 2
Optimization area constraint
1 On the Physics toolbar, click Optimization
2 Locate the Domains button, and click Integral Inequality Constraint 3 In the Integral Inequality Constraint window, select Domain 1
3.3 Modeling instructions 21
5 Locate the Bounds section, don’t change the Lower Bound, but edit the Upper Bound,
type a*b
6 The Integral Inequality Constraint will automatically be added to the optimization in Study 2
Optimization
1 On the Study toolbar, click Optimization. This will add the Optimization module to Study 2
2 In the Optimization settings window, locate the Optimization Solver section 3 From the Method list, choose SNOPT
4 In the Optimality tolerance edit field, type 1e-4
5 In the Maximum number of objective evaluations edit field, type 200 6 Locate the Objective Function section. In the table, enter following settings:
Expression Description
comp1.solid.Ws_tot Total elastic strain energy
7 Locate the Control Variables and Parameters section. Click Load from File 8 Browse to find the file called beam_shape_optimization_control_parameters.txt 9 Locate Output While Solving section and make sure that Plot is checked
Solver 2
1 On the Study toolbar, click Show Default Solver
2 In the Model Builder window, expand the Study 2>Solver Configurations>Solver 2>Optimization Solver 1 node, then click Stationary 1
3 In the Stationary settings window, locate the General section 4 In the Relative tolerance edit field, type 1e-6
5 From the Linearity list, choose Automatic
RESULTS
Plots
The plots from solution 1 can be duplicated relatively easy thus avoiding the same procedure all over again.
1 In the Model Builder window under Results, locate the von Mises stress, solution 1 2 Right-click it and choose Duplicate
3 Right-click the new plot group and rename it to von Mises stress, solution 2 4 In the 2D Plot Group window, locate the Data section
5 In the drop down menu change it from Solution 1 to Solution 2 6 Click Plot
7 Follow the same procedure for the Y-displacement
Probes
It is possible to see the parameter values for each iteration by using probes. In addition it’s also possible to show the values of stresses, displacement and the total elastic strain energy.
1 In the Model Builder window under Component 1, locate the Definitions menu 2 Right-click it and choose Probes>Domain Probe
3 The Domain Probe window will open, locate the Expression section. The expression will
by default be set to solid.disp, change this to solid.mises, which is the von Mises stress
4 Right-click Domain Probe 1 and click Rename 5 Rename the probe to von Mises
6 Repeat step 1-5 for the following parameters: strain energy, total strain energy, displacement
(Displacement field, Y component (v)), q1, q2 and q3.
Area Probe
1 In order to create an Area Probe, first right-click Definitions, choose Component Cou-plings>Integration
2 The Integration window will open, select Domain 1
3 Now create a new Domain Probe using the steps from above. Rename it Area 4 In the Expression field type intop1(1)
CHAPTER
4
Optimization of a plate with a hole
This model will investigate how to apply boundary shape optimization to a simple bracket. The model will focus on shape optimization when more than one boundary has to be parameterized in both the x and the y direction.4.1
Model definition
The quadratic plate with a hole in the middle and biaxially loaded is a typical problem within shape optimization. The model can be seen in Figure 4.1(a), it has dimensions S× S × d = 10m× 10 m × 0.1 m and radius, r = 4 m. The plate is made in structural steel meaning it has a total weight of 68633 kg. The boundaries are loaded with σ1 in the x direction and σ2 in the
y direction in such a way that they both experience tensile stress.
In this model a survey of how the relation between the stresses σ1 and σ2 will influence the shape optimization parameters will be conducted. First for σ2/σ1 = 1, then for σ2/σ1 = 2 and at last for σ2/σ1 = 3. It is expected for the first case, σ1 = σ2, that the shape is already optimal.
In geometric modeling it is only necessary to model a quarter of the model because of symmetry, see Figure 4.1(b). The boundaries, where the cut is made, is replaced with rollers to represent the missing sides. Figure 4.1(b) also shows which sides are to be parameterized.The left side,
s1(y) and s3(x) are only to parameterized in one direction, respectively the y and x direction, whereas s2(x, y) is to be parameterized in both directions. The parameterization will change the shape of the hole by changing the curve of the hole and by changing the coordinates of the endpoints of the curve.
The parameterizations describing s1 and s3 are very similar to the parameterizations of the beam in Chapter 3:
s1,y(s) = p1(1− s)
s3,x(s) = p3s (4.1)
Where p1 and p3 are both optimization parameters and s∈ [0, 1]. The boundary, s2, is a bit more difficult to parameterize. At first a parameterization similar to the one from Chapter 3 was used, but with the addition of a parameterization in the x direction:
s2,x(s) = p3(1− s)
s2,y(s) = s1,y(0)s + p2sin(πs) (4.2)
This solution, however, proved unsuccessful due to slope at the end points which created unfeasible results. This can be seen in Figure 4.2, the stress concentration for this result was evenly distributed but the transition between the joints was not smooth. Therefore the resulting hole looked the number 8, which is not desirable and created high stress peaks at the joints.
S S σ2 σ1 r σ2 σ1 Symmetry S ymmetr y
(a) Mechanical analysis setup with dimensions
S = 10m, r = 4 m, and d = 0.1 m σ2 σ1 s1(y) s2(x,y) s3(x) S/2 S/2
(b) Shape optimization setup. Due to symmetry only 1/4 of the plate needs to be analysed
Figure 4.1: Plate with a hole
Figure 4.2: v. Mises stress showing the parameterization of the plate with equation (4.2) and
σ2/σ1
In order to get a nice transition between the joints, the curve needs to have zero slope at both endpoints. The equation for the dY displacement will be found first. The slope at the ends must be zero, meaning that the derivative of the parameterization must be zero at s = 0 and
4.1 Model definition 25
end point equal to p1 when s = 1. These demands can be expressed mathematically in the following way: s2,y(0) = 0 s2,y(1) = p1 s′2,y(0) = 0 s′2,y(1) = 0 (4.3)
In order to get zero slope at the end points a cosine curve forms the basis of the parameteriza-tion. In order to get the curve to begin and end in the same y-coordinate only equal integers enter in the first cosine term, furthermore the whole term is subtracted from 1 to shift the whole function above y = 0. This equals the following expression where p2/2 controls the height of the curve:
p2
2 (1− cos(nks))
In the above expression k = 2π, n∈ Z, and p2 is an optimization parameter.
The left end point of s2,y needs to match its y-coordinate with the s1,y(s) expression from equation (4.1). This can be done by adding the expression p1
2(1− cos(πs)). When combining the terms the following equation is generated:
s2,y(s) =
p2
2(1− cos(nks)) +
p1
2(1− cos(πs)) (4.4) Where k = 2π, n∈ Z, and p1 and p2 are both optimization parameters.
The boundary, s2,x was at first parameterized with the expression p3(1− s), although this expression did not yield zero slope due to the fact that the parameterization in COMSOL is a parameterization of the boundary arc length and not the original x-coordinate. Therefore it was necessary to make a transformation to a trigonometric expression. The problem is outlined in Figure 4.3.
s=0, ϕ=0
s=1, ϕ = π/2
s
r
ϕ
x(
ϕ)
y(ϕ)
Figure 4.3: Illustration of the transformation of the x-coordinates radial to the boundary
The boundary curve can be described in terms of s with equation (4.5) and the x-coordinate can be described in terms of ϕ with equation (4.6). By combining these two equations the
transformation for describing the x-coordinate in terms of s is complete: ϕ(s) = πs 2 (4.5) x(ϕ) = rcos (ϕ) (4.6) x(s) = rcos(πs 2 ) (4.7) By combining the above with the parameterization of s2,x(s)it becomes:
s2,x(s) = p3cos(πs 2
)
(4.8) So to repeat, the whole parameterization of the model is:
s1,y(s) = p1(1− s) s2,x(s) = p3cos(πs 2 ) s2,y(s) = p2 2(1− cos(nks)) + p1 2(1− cos(πs)) s3,x(s) = p3s (4.9)
Figure 4.4 shows the comparison between the original mesh and the mesh after the parame-terization. The figure also illustrates that there are now zero slope at the end points of the curve.
(a) The mesh of the orignal plate with parameters p1=
0, p2= 0, and p3= 0
(b) The mesh after the parameterization, here with parameters p1= 1, p2= 0.5, and p3=−3
Figure 4.4:
The objective function for this model will also be the total elastic strain energy seeing as the stiffest design is equal to the design with lowest stress concentration[14].
4.2 Results and discussion 27
4.2
Results and discussion
In this section the results of the optimization will be presented and discussed. Three different cases will be looked into; σ2/σ1 = 1, σ2/σ1 = 2, and σ2/σ1 = 3. The objective of the shape optimization is to even out the stresses and reduce the peak stress without increasing the area. Throughout the analysis an integral inequality constraint will be used to make sure the area doesn’t exceed the original area domain.
First case: σ2/σ1=1
In the first case the plate is loaded with stress of the same magnitude on the right and upper boundary in the x and y direction, respectively. When the tension rate is equal to 1, the optimal shape is expected to be a circular hole to have evenly distributed stresses. Reference values for the non-optimized solution can be found in Table 4.5, and the stress distribution can be seen on Figure 4.6.
σvM,max [MPa] U [J/m3] Utot [J] Area [m2]
2.12 4.08 35.69 87.43
Table 4.5: Reference values for the plate with σ1 = σ2= 1000kN
Figure 4.6: Standard plate with σ2/σ1 = 1
As seen on Figure 4.6 the stress is already evenly distributed. The optimization solver should return the optimization parameters p1 = p2 = p3 = 0, this is however not the case. The parameters are slightly optimized but still practically zero. The reason for this is due to numerical approximation and is explained in the third case.
Second case: σ2/σ1 =2
The results for the non-optimized plate can be seen on Table 4.7 and Figure 4.8. The right boundary is loaded with 1000 kN and the upper boundary with 2000 kN.
σvM,max [MPa] U [J/m3] Utot [J] Area [m2]
6.20 12.32 107.70 87.43
Table 4.7: Reference values for the plate with σ1 = 1000kN and σ2 = 2000kN
Figure 4.8: Standard plate with σ2/σ1= 2
It is quite clear from Figure 4.8 that the shape of the hole is not optimal when the tensile ratio is 2. The shape optimization is performed resulting in Table 4.9 and Figure 4.10. Complete tables, log files and higher-resolution plots can be found in Appendix B.2.
σvM,max [MPa] U [J/m3] Utot [J] Area [m2]
3.27 11.10 97.05 87.43
Table 4.9: Optimized values for the plate with σ1 = 1000kN and σ2 = 2000kN with opti-mization parameters p1 = 3.01, p2 = 0.40, and p3 = 2.09
4.2 Results and discussion 29
(a) The circular hole has become an ellipse and the von Mises stress is now evenly distributed along the bound-ary
(b) The von Mises stress as a function of the arc length for s2. The blue curve is the original design and the
green is the optimized shape
Figure 4.10: Optimized plate with optimization parameters p1 = 3.01, p2 = 0.40, and p3 = 2.09
By comparing the peak stresses of the original model and the optimized one it can be seen that the peak stress has been reduced by 89.6% without increasing the area. From Figure 4.10(a) it can be seen that the stress concentration in the top of the hole has been distributed along the boundary of the hole. Figure 4.10(b) shows how the stress has changed from being a ”linear function” to being almost constant.
Take note of the form of the hole, it has changed from being circular to being an ellipse. In Pedersen’s analytical results [13] of holes subjected to biaxial stress he finds out that the relationship between the tensile stresses is equal to the relationship between the vertices of the ellipse.
Third case: σ2/σ1=3
Table 4.11 and Figure 4.12 shows the non-optimized results when the tensile ratio is 3. The upper boundary is loaded with 3000 kN and the right boundary with 1000 kN. The stress plot is very similar to Figure 4.8 but due to the higher load the stress concentration has become even higher.
σvM,max [MPa] U [J/m3] Utot [J] Area [m2]
10.41 28.86 252.34 87.43
Figure 4.12: Standard plate with σ2/σ1 = 3
Table 4.13 and Figure 4.14 show the optimized results. According to [13] the ratio of the vertices for the elliptic should be equal to the ratio of the tensile stresses. This is not the case though. By looking at Figure 4.14(a) the vertex ratio does not seem to match with 3. When investigating further it turns out that the vertex ratio is a/b = 6.56 m/2.49 m = 2.63. The reason for this is because the analytical solution from [13] is based on a hole in an infinite plane domain which is subjected to stress far away from the hole. This is supported by numerical results, if the sides of the plate is changed from 10 m to 100 m, thus making the domain closer to infinite and moving the loads farther way, the vertex ratio increases to a/b = 6.94 m/2.34 m = 2.97. By making the domain larger and larger, the more close the numerical method gets to the analytical method. This explanation follows for approximation error for all three cases.
σvM,max [MPa] U [J/m3] Utot [J] Area [m2]
4.48 24.01 209.94 87.43
Table 4.13: Optimized values for the plate with σ1 = 1000kN and σ2 = 3000kN with opti-mization parameters p1 = 5.12, p2= 0.75, and p3=−3.02
4.2 Results and discussion 31
(a) The circular hole has become an ellipse and the von Mises stress is now evenly distributed along the bound-ary
(b) The von Mises stress as a function of the arc length for s2. The blue curve is the original design and the
green is the optimized shape
Figure 4.14: Optimized plate with optimization parameters p1 = 5.12, p2 = 0.75, and p3 =
−3.02
In this case the maximum equivalent stress has been reduced from 10.41 MPa to 4.48 MPa, a reduction of 132%. As in case 2, not only have the peak stresses been lowered, but the stress is evenly distributed along the arc boundary. This is also clearly show in Figure 4.14(b) which shows little variation in the stress; it only spans from 4.12 MPa to 4.48 MPa.
Other cases
In order to save material and therein cost it is possible to use a lower upper limit for the area constraint by multiplying with a constant. E.g. how does the plate look if the material cost is to be cut down by 20%? In Figure 4.15 the results of this reduction can be seen. The model has become 13727 kg lighter and the maximum equivalent stress has still been reduced from 6.20 MPa to 5.61 MPa (10.5%). The result, however, is not optimal. The stress is evenly distributed, but a large stress concentration at the top left corner is not desirable. The whole design domain should be larger in order to distribute the stresses better in the domain.
(a) Stress is still evenly distributed along the boundary, but the design is not optimal. The design domain should be larger
(b) The von Mises stress as a function of the arc length for s2. The blue curve is the original design and the
green is the optimized shape
Figure 4.15: Optimized plate with a 20% reduction in material and optimization parameters
p1= 8.58, p2 = 0.80, and p3 = 1.67
This model shows that COMSOL Multiphysics 4.4 currently has some scaling problems. This model was originally supposed to be 25 mm×25 mm with a hole with a radius of 10 mm, but due to these scaling problems when COMSOL tried to optimize the shape of the plate it stopped after one iteration. This problem occurred even though the model was setup with various scaling factors in the parameterizations to take this into account. The COMSOL support has been contacted and normally they’re rather quick at responding (usually less than 24 hours), but they have been working on this problem for more than a week.
4.3 Modeling instructions 33
4.3
Modeling instructions
The following will describe how to create the model. From the File menu, choose New
NEW
1 In the New window, click the Model Wizard button
MODEL WIZARD
1 In the Model Wizard window, click the 2D button
2 In the Select Physics tree, select Mathematics>Deformed Mesh>Deformed Geom-etry (dg).
3 Click the Add button
4 In the Select Physics window, select Structural Mechanics>Solid Mechanics (solid). 5 Click the Add button
6 In the Select Physics tree, select Mathematics>Optimization and Sensitivity>Optimization (opt).
7 Click the Add button. 8 Click the Study button
9 In the tree, select Preset Studies for Selected Physics>Stationary 10 Click the Done button
GLOBAL DEFINITIONS
Parameters
1 On the Home toolbar, click Parameters
2 In the Parameters settings windows, locate the Parameters section 3 Click Load from file
4 Browse to find the file called bracket_shape_optimization_parameters.txt and
double-click it to load the parameters
GEOMETRY 1
1 In the Model Builder window, right-click Geometry 1 and choose Square 2 In the Square settings window, locate the Size section
3 In the Side length edit field, type s 4 Click the Build All Objects button
Circle 1
1 In the Model Builder window, right-click Geometry 1 and choose Circle 2 In the Circle settings window, locate the Size and Shape section
3 In the Radius edit field, type r 4 Click the Build All Objects button
Difference 1
1 In the Model Builder window, right-click Geometry 1 and choose Boolean Opera-tions>Difference
2 In the Difference settings window, locate the Objects to add section
3 Activate the Object to add window by clicking Activate, and then click on the square
(Square 1)
4 In the Difference settings window, locate the Objects to subtract section
5 Activate the Object to subtract window by clicking Activate, and then click on the circle
(Square 1)
6 Click the Build All Objects button
MATERIALS
Add material
1 Go to the Add Material window
2 In the tree, select Built-In>Structural Steel
4.3 Modeling instructions 35
SOLID MECHANICS (SOLID)
Roller 1
1 On the Physics toolbar, click Boundaries and choose Roller 2 Select Boundary 1 and 3 only.
Boundary Load 1
1 On the Physics toolbar, click Boundaries and choose Boundary Load 2 Select Boundary 2 only.
3 In the Boundary Selection window, locate the Force section 4 Under Load type, change it to Total force
5 Let the y component remain 0, but change the x component to P1
Boundary Load 2
1 On the Physics toolbar, click Boundaries and choose Boundary Load 2 Select Boundary 4 only.
3 In the Boundary Selection window, locate the Force section 4 Under Load type, change it to Total force
5 Let the x component remain 0, but change the y component to P2
DEFORMED GEOMETRY (DG)
Free Deformation 1
1 On the Physics toolbar, click Domains and choose Free Deformation 2 Select Domain 1.
Prescribed Mesh Displacement 2
2 Select Boundary 1 only.
3 In the Prescribed Mesh Displacement settings window, locate the Prescribed Mesh Displacement section
4 In the dY field type p1*(1-s)
Prescribed Mesh Displacement 3
1 On the Physics toolbar, click Boundaries and choose Prescribed Mesh Displacement 2 Select Boundary 5 only.
3 In the Prescribed Mesh Displacement settings window, locate the Prescribed Mesh Displacement section
4 In the dX field type p3*cos(pi*s/2)
5 In the dY field type p2*(1-cos(k*s))/2+p1*(1-cos(pi*s))/2
Prescribed Mesh Displacement 4
1 On the Physics toolbar, click Boundaries and choose Prescribed Mesh Displacement 2 Select Boundary 3 only.
3 In the Prescribed Mesh Displacement settings window, locate the Prescribed Mesh Displacement section
4 In the dX field type p3*s
MESH 1
Free Quad 1
1 In the Model Builder window, under Component 1 (comp1) right-click Mesh 1 and
choose Free Quad
2 In the Free Quad settings window, locate the Domain Selection section 3 From the Geometric entity level list, choose Domain
4 Select Domain 1
4.3 Modeling instructions 37
1 In the Model Builder window, under Component 1 (comp1)>Mesh 1 click Size 2 In the Size settings window, locate the Element size section
3 Under Predefined, select Extra fine from the list 4 Click the Build All button
STUDY 1
Before starting the actual optimization it can be a good idea to check the model by solving for the default parameters. In this way you have a good reference point when doing the optimiza-tion later.
Solver 1
1 On the Study toolbar, click Show Default Solver
2 In the Model Builder window, expand the Study 1>Solver Configurations node 3 In the Model Builder window, expand the Solver 1 node, then click Stationary Solver
1
4 In the Stationary Solver settings window, locate the General section 5 From the Linearity list, choose Nonlinear
6 On the Home toolbar, click Compute
RESULTS
von Mises Stress
The default plot in the main window shows the von Mises stress surface distribution in the plate. Note that the stress is concentrated at the right end of arc boundary. This is as ex-pected. The peak stress for the model is 6.22 MPa.
Right now the deformation is being displayed as well for the stress plot, to disable this do the following
1 In the Model Builder window, locate Results>Stress (solid)
2 Right-click Stress (solid) and click Rename, rename it to ”von Mises stress, solution
1”
3 Expand the von Mises stress, solution 1 node, then the Surface 1 node
4 Right-click Deformation 1 and click delete. The plot should automatically be replotted
ADD STUDY
1 To add a new study for the optimization, go to the Home toolbar and click Add Study 2 Go to the Add Study window
3 Find the Studies subsection. In the tree, select Preset Studies>Frequency Domain 4 In the Add study window, click Add study
5 On the Home toolbar, click Add Study to close the Add Study window
STUDY 2
Optimization area constraint
1 On the Physics toolbar, click Optimization
2 Locate the Domains button, and click Integral Inequality Constraint 3 In the Integral Inequality Constraint window, select Domain 1
4 Locate the Constraint section and under Constraint expression type 1
5 Locate the Bounds section, don’t change the Lower Bound, but edit the Upper Bound,
type sideˆ2-pi*rˆ2/4
6 The Integral Inequality Constraint will automatically be added to the optimization in Study 2
Optimization stress constraint
1 On the Physics toolbar, click Optimization
2 Locate the Domains button, and click Global Inequality Constraint 3 In the Global Inequality Constraint window, select Domain 1
4 Locate the Constraint section and under Constraint expression type 1
5 Locate the Bounds section, don’t change the Lower Bound, but edit the Upper Bound,
type 3[MPa]
6 The Global Inequality Constraint will automatically be added to the optimization in Study 2
4.3 Modeling instructions 39
Optimization
1 On the Study toolbar, click Optimization. This will add the Optimization module to Study 2
2 In the Optimization settings window, locate the Optimization Solver section 3 From the Method list, choose SNOPT
4 In the Optimality tolerance edit field, type
5 In the Maximum number of objective evaluations edit field, type 200 6 Locate the Objective Function section. In the table, enter following settings:
Expression Description
comp1.solid.Ws_tot Total elastic strain energy
7 Locate the Control Variables and Parameters section. Click Load from File 8 Browse to find the file called bracket_shape_optimization_control_parameters.txt 9 Locate Output While Solving section and make sure that Plot is checked
Solver 2
1 On the Study toolbar, click Show Default Solver
2 In the Model Builder window, expand the Study 2>Solver Configurations>Solver 2>Optimization Solver 1 node, then click Stationary 1
3 In the Stationary settings window, locate the General section 4 In the Relative tolerance edit field, type 1e-6
5 From the Linearity list, choose Automatic
6 Right-click Study 2 and press the Compute button
RESULTS
Plots
The plots from solution 1 can be duplicated relatively easy thus avoiding the same procedure all over again.
2 Right-click it and choose Duplicate
3 Right-click the new plot group and rename it to von Mises stress, solution 2 4 In the 2D Plot Group window, locate the Data section
5 In the drop down menu change it from Solution 1 to Solution 2 6 Click Plot
1D Plots
It can also be interesting to see the stress as a function of the boundary. This can be done in the following
1 In the Model Builder window, right-click Results and locate 1D Plot Group, click it 2 The 1D Plot Group window will open, locate the Data section, under Data set choose
None
3 Right-click the 1D Plot Group under Results, click Line Graph to add a graph 4 The Line Graph window will open, under Data set choose Solution 1
5 Locate the Selection section, toggle the on/off switch and select Boundary 5
6 Locate the y-Axis Data section and replace the expression with solid.mises, also change
the Unit from N/mˆ2 to MPa
7 In order to compare the value with Study 2, right-click Line Graph 1 and click Duplicate 8 In the new Line Graph window, change the Data set to Solution 2
Probes
It is possible to see the parameter values for each iteration by using probes. In addition it’s also possible to show the values of stresses, displacement and the total elastic strain energy.
1 In the Model Builder window under Component 1, locate the Definitions menu 2 Right-click it and choose Probes>Domain Probe
3 The Domain Probe window will open, locate the Expression section. The expression will
by default be set to solid.disp, change this to solid.mises, which is the von Mises stress
4 Right-click Domain Probe 1 and click Rename 5 Rename the probe to von Mises
6 Repeat step 1-5 for the following parameters: strain energy, total strain energy, q1, q2 and
4.3 Modeling instructions 41
Area Probe
1 In order to create an Area Probe, first right-click Definitions, choose Component Cou-plings>Integration
2 The Integration window will open, select Domain 1
3 Now create a new Domain Probe using the steps from above. Rename it Area 4 In the Expression field type intop1(1)
CHAPTER
5
Optimizing the shape of a fillet
This model will look into how COMSOL can be used for 3D shape optimization. The focus of the optimization will be of a fillet on a bar in tension. The model will show how to model a axisymmetric geometry and will look into some of the problems that may arise when performing shape optimization in COMSOL.5.1 Model definition
This model investigates the optimization of a fillet in the transition region of a bar in tension. The bar is modeled in structural steel, has a volume of 39573 m3 and thereby a total weight of 310,648 tonne. The model can be seen on Figure 5.1 with dimensions.
σ
10 12 .5 27 .5 5 17.5 s 1 s 2 s 3 5 Axis of rota tio nFigure 5.1: The bar with dimensions
The figure is rotational symmetric around the left boundary. When modeling in 2D axisymme-try in COMSOL the axis of rotation is automatically replaced with roller boundary conditions. The upper boundary is loaded with a uniaxial tension, σ, with a magnitude of σ = 1000 MN.