In the microfluidic systems, the structure of micromixer is one of the important influence factors for the mixing performance. The traditional trial-and-error method for the optimization design of micromixer structure is difficult to consider both the mixing performance and power dissipation. Here we show the topology optimization method of designing the passive micromixer with the minimum power dissipation. The micromixer structure is updated with the adjoint method and adjoint variables are solved by the continuous adjoint equation derived manually. The forward fluid problem and adjoint equation are constructed using OpenFOAM. The optimal structure of micromixer is generated at different mixing index constraint and Re in two-dimensional design problem. Furthermore, in the three-dimensional optimal design, the multiple spiral slice structures are produced along the micromixer, which generate chaotic advection. This open-source topology optimization modeling framework is effective to design optimal structure of micromixer.