Open-cell foam has extensive applications including the transpiration cooling, the porous media combustion, the solid oxide fuel cell, the phase change materials for energy storage and the artificial bone tissue. However, the topology construction of open-cell foam with controlled profiles (i.e. porosity and pore diameter) is of great challenge for the available techniques. There is an urgent need to develop a new topology generation approach of open-cell foam for maximizing the working performance and minimizing the negative impacts in the fields as mentioned above. In this paper, a new method based on the periodic level surface was proposed to build the open-cell foam topology according to the inputting pore profiles. A framework, consisting of the solid matrix-pore interface type selection module, the geometry and pore parameters inputting module, the characteristic parameters of the interface equation calculation module, and the topology simplification and optimization module, was built for the generation of open-cell foam. With the generated topology, pore-scale modelling of transpiration cooling in a T-junction was carried out. A case with uniform pore topology was conducted to analyze the wall temperature and transpiration cooling efficiency.