Abstract
This article presents a detailed introduction to density-based topology optimisation of fluid flow problems. The goal is to allow new students and researchers to quickly get started in the research area and to skip many of the initial steps, often consuming unnecessarily long time from the scientific advancement of the field. This is achieved by providing a step-by-step guide to the components necessary to understand and implement the theory, as well as extending the supplied MATLAB code. The continuous design representation used and how it is connected to the Brinkman penalty approach, for simulating an immersed solid in a fluid domain, are illustrated. The different interpretations of the Brinkman penalty term and how to chose the penalty parameters are explained. The accuracy of the Brinkman penalty approach is analysed through parametric simulations of a reference geometry. The chosen finite element formulation and the solution method are explained. The minimum dissipated energy optimisation problem is defined and how to solve it using an optimality criteria solver and a continuation scheme is discussed. The included MATLAB implementation is documented, with details on the mesh, pre-processing, optimisation and post-processing. The code has two benchmark examples implemented and the application of the code to these is reviewed. Subsequently, several modifications to the code for more complicated examples are presented through provided code modifications and explanations. Lastly, the computational performance of the code is examined through studies of the computational time and memory usage, along with recommendations to decrease computational time through approximations.
Notes
The lower bound is chosen to avoid stagnation.
The constraint is not formulated explicitly anywhere in the paper.
\(\tau _{2}\) is for the transient case, which is traditionally numbered as number 2, and left out since steady-state flow is treated herein.
References
Aage N, Andreassen E, Lazarov BS (2015) Topology optimization using PETSc: An easy-to-use, fully parallel, open source topology optimization framework. Struct Multidisc Optim 51(3):565–572. https://doi.org/10.1007/s00158-014-1157-0
Alexandersen J (2022) Code base on GitHub. https://github.com/sdu-multiphysics/topflow
Alexandersen J, Andreasen CS (2020) A review of topology optimisation for fluid-based problems. Fluids, https://doi.org/10.3390/fluids5010029
Amir O, Stolpe M, Sigmund O (2010) Efficient use of iterative solvers in nested topology optimization. Struct Multidisc Optim 42(1):55–72. https://doi.org/10.1007/s00158-009-0463-4
Amir O, Aage N, Lazarov BS (2014) On multigrid-CG for efficient topology optimization. Struct Multidisc Optim 49(5):815–829. https://doi.org/10.1007/s00158-013-1015-5
Andreassen E, Clausen A, Schevenels M, Lazarov BS, Sigmund O (2011) Efficient topology optimization in MATLAB using 88 lines of code. Struct Multidisc Optim 43(1):1–16. https://doi.org/10.1007/s00158-010-0594-7
Bendsøe MP, Kikuchi N (1988) Generating optimal topologies in structural design using a homogenization method. Computer Methods in Applied Mechanics and Engineering 71(2):197–224. https://doi.org/10.1016/0045-7825(88)90086-2
Bendsøe MP, Sigmund O (2004) Topology optimization: theory, methods, and applications, 2nd edn. Springer, Heidelberg, https://doi.org/10.1007/978-3-662-05086-6
Borrvall T, Petersson J (2003) Topology optimization of fluids in Stokes flow. Int J Numer Methods Fluids 41(1):77–107. https://doi.org/10.1002/fld.426
Challis VJ (2010) A discrete level-set topology optimization code written in Matlab. Struct Multidisc Optim 41(3):453–464. https://doi.org/10.1007/s00158-009-0430-0
Choi KK, Kim NH (2005) Structural sensitivity analysis and optimization 1. Mechanical engineering series, Springer. https://doi.org/10.1007/b138709
Choi KK, Kim NH (2005) Structural sensitivity analysis and optimization 2. Mechanical engineering series, Springer. https://doi.org/10.1007/b138895
da Silva GA, Beck AT, Sigmund O (2019) Stress-constrained topology optimization considering uniform manufacturing uncertainties. Comput Methods Appl Mech Eng 344:512–537. https://doi.org/10.1016/j.cma.2018.10.020
Deaton JD, Grandhi RV (2014) A survey of structural and multidisciplinary continuum topology optimization: post 2000. Struct Multidisc Optim 49(1):1–38. https://doi.org/10.1007/s00158-013-0956-z
Ferrari F, Sigmund O (2020) A new generation 99 line Matlab code for compliance topology optimization and its extension to 3D. Struct Multidisc Optim 62(4):2211–2228. https://doi.org/10.1007/s00158-020-02629-w
Gersborg-Hansen A, Sigmund O, Haber RB (2005) Topology optimization of channel flow problems. Struct Multidisc Optim 30(3):181–192. https://doi.org/10.1007/s00158-004-0508-7
Høghøj LC, Nørhave DR, Alexandersen J, Sigmund O, Andreasen CS (2020) Topology optimization of two fluid heat exchangers. Int J Heat Mass Transf 163. https://doi.org/10.1016/j.ijheatmasstransfer.2020.120543
Kondoh T, Matsumori T, Kawamoto A (2012) Drag minimization and lift maximization in laminar flows via topology optimization employing simple objective function expressions based on body force integration. Struct Multidisc Optim 45(5):693–701. https://doi.org/10.1007/s00158-011-0730-z
Le C, Norato J, Bruns T, Ha C, Tortorelli D (2010) Stress-based topology optimization for continua. Struct Multidisc Optim 41(4):605–620. https://doi.org/10.1007/s00158-009-0440-y
Lundgaard C, Alexandersen J, Zhou M, Andreasen CS, Sigmund O (2018) Revisiting density-based topology optimization for fluid-structure-interaction problems. Struct Multidisc Optim 58(3):969–995. https://doi.org/10.1007/s00158-018-1940-4
Michaleris P, Tortorelli DA, Vidal CA (1994) Tangent operators and design sensitivity formulations for transient non-linear coupled problems with applications to elastoplasticity. Int J Numerical Methods Eng 37(14):2471–2499. https://doi.org/10.1002/nme.1620371408
Papadopoulos IPA, Farrell PE, Surowiec TM (2021) Computing multiple solutions of topology optimization problems. SIAM J Sci Comput 43(3):A1555–A1582. https://doi.org/10.1137/20m1326209
Pereira A, Talischi C, Paulino GH, Menezes MIF, Carvalho MS, (2016) Fluid flow topology optimization in PolyTop: stability and computational implementation. Struct Multidisc Optim 54(5):1345–1364. https://doi.org/10.1007/s00158-014-1182-z
Pironneau O (1973) On optimum profiles in Stokes flow. J Fluid Mech 59(1):117–128. https://doi.org/10.1017/S002211207300145X
Sigmund O (2001) A 99 line topology optimization code written in matlab. Struct Multidisc Optim 21(2):120–127. https://doi.org/10.1007/s001580050176
Sigmund O (2007) Morphology-based black and white filters for topology optimization. Struct Multidisc Optim 33(4):401–424. https://doi.org/10.1007/s00158-006-0087-x
Sigmund O, Maute K (2013) Topology optimization approaches. Struct Multidisc Optim 48(6):1031–1055. https://doi.org/10.1007/s00158-013-0978-6
SMOPTIT (2022) Svanberg matematisk optimering och IT AB. SMOPTIT http://www.smoptit.se/
Stolpe M, Svanberg K (2001) An alternative interpolation scheme for minimum compliance topology optimization. Struct Multidisc Optim 22(2):116–124. https://doi.org/10.1007/s001580100129
Svanberg K (1987) The method of moving asymptotes: a new method for structural optimization. International Journal for Numerical Methods in Engineering 24(2):359–373. https://doi.org/10.1002/nme.1620240207
Svanberg K (2007) MMA and GCMMA-two methods for nonlinear optimization. Report, KTH, https://people.kth.se/~krille/mmagcmma.pdf
Talischi C, Paulino GH, Pereira A, Menezes IFM (2012) PolyTop: a Matlab implementation of a general topology optimization framework using unstructured polygonal finite element meshes. Struct Multidisc Optim 45(3):329–357. https://doi.org/10.1007/s00158-011-0696-x
Wang C, Zhao Z, Zhou M, Sigmund O, Zhang XS (2021) A comprehensive review of educational articles on structural and multidisciplinary optimization. Struct Multidisc Optim 64(5):2827–2880. https://doi.org/10.1007/s00158-021-03050-7
Wei P, Li Z, Li X, Wang MY (2018) An 88-line MATLAB code for the parameterized level set method based topology optimization using radial basis functions. Struct Multidisc Optim 58(2):831–849. https://doi.org/10.1007/s00158-018-1904-8
Xia L, Breitkopf P (2015) Design of materials using topology optimization and energy-based homogenization approach in Matlab. Struct Multidisc Optim 52(6):1229–1241. https://doi.org/10.1007/s00158-015-1294-0
Zegard T, Paulino GH (2014) GRAND - Ground structure based topology optimization for arbitrary 2d domains using MATLAB. Struct Multidisc Optim 50(5):861–882. https://doi.org/10.1007/s00158-014-1085-z
Acknowledgements
This paper is dedicated to my former supervisor and colleague Ole Sigmund, the pioneer of educational topology optimisation codes and so much more. The author would like to acknowledge Yupeng Sun, for providing feedback on a close-to-finished manuscript, and Christian Lundgaard, for providing feedback on a very early draft. The author also wishes to thank the DTU TopOpt group for discussions over the many years it has taken to form the experience embodied in this article.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The author has no conflict of interest.
Reproduction of results
The code to reproduce all results is either directly provided (as supplementary material and appendices) or the required modifications are explained thoroughly in the paper. Furthermore, a detailed description of all files of the code is given as supplementary material. Upon proof-of-attempt, the code for the examples not provided directly can be obtained from the author. Manual derivations of the analytical sensitivities can be provided upon request.
Additional information
Responsible Editor: by Kurt Maute
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Topical Collection: Flow-driven Multiphysics
Guest Editors: J Alexandersen, C S Andreasen, K Giannakoglou, K Maute, K Yaji
Supplementary Information
Below is the link to the electronic supplementary material.
Appendices
Appendix A: Alternative scaling of Brinkman penalty factor
The order of magnitude of the convective term is constant due to the non-dimensional formulation of Eq. 2. Thus, the Brinkman penalty factor should no longer become smaller with increasing Reynolds number. Kondoh et al. (2012) suggested the following scaling:
which aims to ensure that the Brinkman penalty factor is large enough even for increasing Reynolds numbers. From a scaling point of view, it can be argued that \(\frac{1}{Da}\) makes sense for purely convective flow, which is recovered from the above for \(Re \longrightarrow \infty\).
Figure 28 shows the error measures as a function of Reynolds number when using Eq. 46. In practise, it is seen that the error decreases for increasing Reynolds number over 1, meaning the flow in the solid is penalised increasingly hard. It appears that the error is beginning to stagnate. However, the flow becomes non-steady for \(Re>150\) and, thus, the limit cannot be investigated presently. This is an area worth more investigation, as the community transitions to treating larger Reynolds number flows.
Appendix B: Finite element formulation
The weak form of the momentum conservation equations is derived by multiplying the strong form by the test function \(w_i\) for the velocity field, integrating over the volume, applying integration-by-parts and introducing a zero normal stress natural boundary condition:
where the last integral is the additional SUPG stabilisation terms with \(\tau\) as the stabilisation parameter. Likewise, the weak form of the mass conservation equation is derived by multiplying the strong form with the test function q for the pressure field:
where the last integral is the additional PSPG stabilisation terms with \(\tau\) as the stabilisation parameter. The diffusive term has been left out of the SUPG and PSPG stabilisation, since it is negligible for bilinear interpolation functions due to the second-order derivative.
The stabilisation parameter is computed using an approximate minimum function:
based on three limit cases:
where \(\tau _{1}\) is the convective limit, \(\tau _{3}\) is the diffusive limit and \(\tau _{4}\) is the reactive limitFootnote 4. The reactive limit \(\tau _{4}\) is very important to ensure stability in the solid domain and at the interface, especially for large Brinkman penalty parameters. The stabilisation parameters are assumed to be constant within each element and \(\tau _{1}\) is, thus, computed based on the velocity components evaluated in the element centroid.
Appendix C: Adjoint sensitivity analysis
Adjoint sensitivity analysis need not be difficult or especially derived for every type of problem. The derivation is very simply by posing the system of equations (be they uncoupled, weakly coupled or strongly coupled) as a common residual:
where \({\mathbf {A}}\) is the system coefficient matrix, \({\mathbf {s}}\) is the vector of all state variables and \({\mathbf {b}}\) is the forcing vector. To find the derivatives of a given functional f, the Lagrangian \({\mathcal {L}}\) is defined as
where \({\varvec{\lambda }}\) is the vector of adjoint variables. The total derivative with respect to a design variable \(\gamma _{e}\) is then taken of the Lagrangian:
where the total derivative is given by
due to the implicit dependence of f on the state field. Expanding the total derivative of the Lagrangian gives
which can be rewritten to
by collecting the terms multiplied by the derivative of the state field. The adjoint problem is then defined as what is inside the brackets:
When \({\varvec{\lambda }}\) is the solution to the adjoint problem, the terms inside the brackets become zero and it is avoided to compute the design sensitivities of the state field:
Since the state solution will be updated after a design change to make the residual equal to zero, the total derivative of the residual with respect to the design variable is equal to zero. Thus, the total derivative of the Lagrangian will be equal to that of the functional and Equation 53 gives
Thus, the final sensitivities of the given functional become
The above result is valid for ALL systems of equations, be they linear/non-linear or un/weakly/strongly coupled. This is the methodology laid forth in various textbooks, e.g. the “Structural Sensitivity Analysis and Optimization” series by Choi and Kim (2005a, 2005b), and papers from the 1990s Michaleris et al. (1994).
Appendix D: MATLAB code: topFlow.m
Appendix E: MATLAB code: problems.m
Appendix F: MATLAB code: postproc.m
Appendix G: MATLAB code: export.m
Appendix H: MATLAB code: analyticalElement.m
Rights and permissions
About this article
Cite this article
Alexandersen, J. A detailed introduction to density-based topology optimisation of fluid flow problems with implementation in MATLAB. Struct Multidisc Optim 66, 12 (2023). https://doi.org/10.1007/s00158-022-03420-9
Received:
Revised:
Accepted:
Published:
DOI: https://doi.org/10.1007/s00158-022-03420-9