Abstract
The focus of this paper is to propose a novel computational approach for the solution of large-scale flow-based topology optimization problems using a graphics processing unit (GPU). A marker-and-cell method is first used to discretize a fluid flow design domain. This is followed by a finite difference method to solve the Stokes equations for steady-state incompressible fluid flow. An adjoint method is then employed to conduct design sensitivity analysis for the optimization. We use a generalized minimal residual method as the base solver for the linear system and develop an efficient geometric multigrid preconditioner on GPU in a matrix-free form. We simplify the treatment of different boundary conditions with improved accuracy based on the theory of discrete exterior calculus. Numerical results utilizing different resolutions are presented and highlight a nearly linear computational time scalability. Consequently, intricate branching flow structures may be automatically and efficiently discovered at high resolutions. Our approach is capable of solving indefinite problems (i.e., one forward solution of the Stokes equations) with over 7 million elements in three dimensions (3D) and over 16 million elements in two dimensions (2D) within two minutes using a single desktop computer. Furthermore, all numerical experiments reported in this paper are performed on a single NVIDIA Quadro RTX 8000 graphics card. We subsequently compare the optimized flow structures obtained using the newly proposed method with those obtained by commercial finite element software in an established optimization loop and find the optimized structures from both methods to be in good agreement. To highlight the advantage of GPU acceleration, a quantitative run-time comparison study with the commercial finite element software is performed. Our implementation is shown to solve fluid flow problems with orders of magnitude higher resolution using only a fraction of the computational time.
Similar content being viewed by others
References
Aage N, Poulsen TH, Gersborg-Hansen A, Sigmund O (2008) Topology optimization of large scale stokes flow problems. Struct Multidisc Optim 35(2):175–180
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
Aage N, Andreassen E, Lazarov BS, Sigmund O (2017) Giga-voxel computational morphogenesis for structural design. Nature 550(7674):84–86
Alexandersen J, Andreasen CS (2020) A review of topology optimisation for fluid-based problems. Fluids 5(1):29
Alexandersen J, Sigmund O, Aage N (2016) Large scale three-dimensional topology optimisation of heat sinks cooled by natural convection. Int J Heat Mass Transf 100:876–891
Allaire G (2015) A review of adjoint methods for sensitivity analysis, uncertainty quantification and optimization in numerical codes. Ingénieurs de l’Automobile 836:33–36
Andreasen CS, Sigmund O (2013) Topology optimization of fluid-structure-interaction problems in poroelasticity. Comput Methods Appl Mech Eng 258:55–62
Andreasen CS, Gersborg AR, Sigmund O (2009) Topology optimization of microfluidic mixers. Int J Numer Methods Fluids 61(5):498–513
Benzi M, Golub GH, Liesen J (2005) Numerical solution of saddle point problems. Acta Numerica 14:1–137
Borrvall T, Petersson J (2003) Topology optimization of fluids in stokes flow. Int J Numer Methods Fluids 41(1):77–107
Challis VJ, Guest JK (2009) Level set topology optimization of fluids in stokes flow. Int J Numer Methods Eng 79(10):1284–1308
Challis VJ, Roberts AP, Grotowski JF (2014) High resolution topology optimization using graphics processing units (GPUS). Struct Multidisc Optim 49(2):315–325
Chen L (2016) Finite difference method for stokes equations: Mac scheme
Crane K (2018) Discrete differential geometry: an applied introduction. Notices of the AMS, Communication, pp 1153–1159
Deaton JD, Grandhi RV (2014) A survey of structural and multidisciplinary continuum topology optimization: post 2000. Struct Multidisc Optim 49(1):1–38
Dede EM (2009) Multiphysics topology optimization of heat transfer and fluid flow systems. In: Proceedings of the COMSOL users conference
Dede EM (2012) Optimization and design of a multipass branching microchannel heat sink for electronics cooling. J Electron Packag 134(4)
Dede EM, Zhou Y, Nomura T (2020) Inverse design of microchannel fluid flow networks using turing pattern dehomogenization. Struct Multidisc Optim 62:2203–2210
Demidov D (2019) Amgcl: an efficient, flexible, and extensible algebraic multigrid implementation. Lobachevskii J Math 40(5):535–546
Demidov D, Mu L, Wang B (2021) Accelerating linear solvers for stokes problems with c++ metaprogramming. J Comput Sci 49:101285
Dilgen CB, Dilgen SB, Fuhrman DR, Sigmund O, Lazarov BS (2018) Topology optimization of turbulent flows. Comput Methods Appl Mech Eng 331:363–393
Du T, Wu K, Spielberg A, Matusik W, Zhu B, Sifakis E (2020) Functional optimization of fluidic devices with differentiable stokes flow. ACM Trans Graphics 39(6):1–15
Evgrafov A (2006) Topology optimization of slightly compressible fluids. J Appl Math Mech 86(1):46–62
Gersborg-Hansen A, Sigmund O, Haber RB (2005) Topology optimization of channel flow problems. Struct Multidisc Optim 30(3):181–192
Griewank A, Walther A (2008) Evaluating derivatives: principles and techniques of algorithmic differentiation. SIAM, Philadelphia
Guest JK, Prévost JH (2006) Topology optimization of creeping fluid flows using a Darcy-Stokes finite element. Int J Numer Methods Eng 66(3):461–484
Herrero-Pérez D, Castejón PJM (2021) Multi-GPU acceleration of large-scale density-based topology optimization. Adv Eng Softw 157:103006
Jiang T (1970) A first order method of moving asymptotes for structural optimization. WIT Trans Built Environ 14
John V, Tobiska L (2000) Numerical performance of smoothers in coupled multigrid methods for the parallel solution of the incompressible navier-stokes equations. Int J Numer Methods Fluids 33(4):453–473
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
Kontoleontos E, Papoutsis-Kiachagias E, Zymaris A, Papadimitriou D, Giannakoglou K (2013) Adjoint-based constrained topology optimization for viscous flows, including heat transfer. Eng Optim 45(8):941–961
Kreissl S (2011) Topology optimization of flow problems modeled by the incompressible Navier-Stokes equations. PhD thesis, University of Colorado at Boulder
Liu H, Mitchell N, Aanjaneya M, Sifakis E (2016) A scalable Schur-complement fluids solver for heterogeneous compute platforms. ACM Trans Graphics 35(6):1–12
Liu H, Hu Y, Zhu B, Matusik W, Sifakis E (2018) Narrow-band topology optimization on a sparsely populated grid. ACM Trans Graphics 37(6):1–14
Martínez-Frutos J, Herrero-Pérez D (2016) Large-scale robust topology optimization using multi-GPU systems. Comput Methods Appl Mech Eng 311:393–414
Maute K, Frangopol DM (2003) Reliability-based design of mems mechanisms by topology optimization. Comput Struct 81(8–11):813–824
Olesen LH, Okkels F, Bruus H (2006) A high-level programming-language implementation of topology optimization applied to steady-state Navier-Stokes flow. Int J Numer Methods Eng 65(7):975–1001
Papoutsis-Kiachagias EM, Giannakoglou KC (2016) Continuous adjoint methods for turbulent flows, applied to shape and topology optimization: industrial applications. Arch Comput Methods Eng 23(2):255–299
Pironneau O (1974) On optimum design in fluid mechanics. J Fluid Mech 64(1):97–110
Rozvany GI (2009) A critical review of established methods of structural topology optimization. Struct Multidisc Optim 37(3):217–237
Sá LF, Okubo CM, Silva EC (2021) Topology optimization of subsonic compressible flows. Struct Multidisc Optim 64:1–22
Schmidt S, Schulz V (2011) A 2589 line topology optimization code written for the graphics card. Comput Vis Sci 14(6):249–256
Sigmund O, Maute K (2013) Topology optimization approaches. Struct Multidisc Optim 48(6):1031–1055
Vanka SP (1986) Block-implicit multigrid solution of Navier-Stokes equations in primitive variables. J Comput Phys 65(1):138–158
Vicente W, Picelli R, Pavanello R, Xie Y (2015) Topology optimization of frequency responses of fluid-structure interaction systems. Finite Elem Anal Des 98:1–13
Wadbro E, Berggren M (2009) Megapixel topology optimization on a graphics processing unit. SIAM Rev 51(4):707–721
Wittum G (1989) Multi-grid methods for Stokes and Navier-Stokes equations. Numerische Mathematik 54(5):543–563
Wu J, Dick C, Westermann R (2015) A system for high-resolution topology optimization. IEEE Trans Vis Comput Graphics 22(3):1195–1208
Yadav P, Suresh K (2014) Large scale finite element analysis via assembly-free deflated conjugate gradient. J Comput Inf Sci Eng 14(4)
Yaji K, Ogino M, Chen C, Fujita K (2018) Large-scale topology optimization incorporating local-in-time adjoint-based method for unsteady thermal-fluid problem. Struct Multidisc Optim 58(2):817–822
Yoon GH (2010) Topology optimization for stationary fluid-structure interaction problems using a new monolithic formulation. Int J Numer Methods Eng 82(5):591–616
Zhou S, Li Q (2008) A variational level set method for the topology optimization of steady-state Navier-Stokes flow. J Comput Phys 227(24):10178–10195
Acknowledgements
This project is supported in part by Toyota Research Institute of North America (TRINA), NSF MRI-1919647, and NSF HCC-2106733.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no conflict of interest.
Replication of results
The source code is available on Github with open access at https://github.com/jyl-pages/Stokes_TO
Additional information
Responsible Editor: Joe Alexandersen.
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.
Appendix 1: Sensitivity
Appendix 1: Sensitivity
In this section, we discuss the derivative of the objective, J, with respect to the fluid design density variable, \(\rho\). The adjoint method is used to compute the sensitivity. First, we simplify the notation by defining \(\mathbf {X}=[\mathbf {u},P]^T\) as a stacked vector comprising all state variables. The linear system in (4) can be written as \(\mathcal {A}\mathbf {X}=\mathbf {b}\). Since the system matrix, \(\mathcal {A}\), depends on \(\rho\), so does the solution vector, \(\mathbf {X}\). The objective is a function of the state and design variables. Let us define the Lagrangian,
where \(\lambda\) is the vector of Lagrange multipliers. As \((\mathcal {A}\mathbf {X}-\mathbf {b})\) is zero everywhere by construction, we may choose \(\lambda\) freely such that \(J=\mathcal {L}\), and derive the gradients as follows,
If we choose \(\lambda\) so that \(\frac{\partial J}{\partial \mathbf {X}}+\lambda ^T\mathcal {A}=0\), the last term becomes zero, and we can avoid calculating \(\frac{\partial \mathbf {X}}{\partial \rho }\). This condition is the adjoint equation:
Here, \(\mathcal {A}^T=\mathcal {A}\) based on symmetry, and the state variable, \(\mathbf {X}\), is pre-computed at each iteration. Equation (11) is solved the same way as the Stokes equations using our multigrid solver, after which \(\lambda\) is substituted to (10) to get the sensitivity. The objective, J, and matrix, \(\mathcal {A}\), are linear functions of \(\alpha (\rho )\), and their partial derivatives with respect to \(\rho\) can be obtained using the chain rule by differentiating (2). Optionally, the adjoint can also be obtained by using automatic differentiation (Griewank and Walther 2008) for the state equations. Overall, this adjoint formulation is an efficient way to evaluate the sensitivity, especially when the number of design variables is large.
Once the sensitivity is computed, it is used to update the fluid design density variable, \(\rho\), of each grid cell. The updated density value is restricted to a range between 0 and 1.
Rights and permissions
About this article
Cite this article
Liu, J., Xian, Z., Zhou, Y. et al. A marker-and-cell method for large-scale flow-based topology optimization on GPU. Struct Multidisc Optim 65, 125 (2022). https://doi.org/10.1007/s00158-022-03214-z
Received:
Revised:
Accepted:
Published:
DOI: https://doi.org/10.1007/s00158-022-03214-z