Cellular structures are broadly applicable to lightweight design and multifunctional applications. Especially, with unprecedented fabrication freedom provided by additive manufacturing (AM), design and optimization of nonuniform cellular structures have recently attracted great research interests. Topology optimization is one of the most powerful tools to obtain the optimized material distribution, and much research have been conducted to optimize cellular structures with the help of this optimization technique. In general, the optimized cellular structure is generated based on a predefined ground structure, and thickness of each strut is then decided based on the optimization result. However, many existing studies did not consider the constraints of AM processes, such as some generated struts may be too thin to be manufactured. Besides, only load support structure was considered in these studies. Other applications, such as heat dissipation or energy absorption, were rarely researched. In this paper, a novel cellular structure design method, which considered both functionality and manufacturability, is proposed. Different from other methods, wall thickness of the structure was set as a constant. To get the optimized material distribution, variable cell sizes were applied. Because of uniform wall thickness, the smaller the unit cell is, the higher its volume fraction will be. By mapping small unit cells to high density area and large cell to low density area, the final optimized cellular structure can be generated. In addition, because smaller unit cells have higher surface-to-volume ratio, this method can also be applied to solve heat transfer problem. Two examples, minimum compliance design of a cantilever beam and maximum heat dissipation efficiency design of a CPU heat sink, were conducted to validate the proposed method.