For a recent explosion risk assessment, a CFD (computational fluid dynamics)-based simulation has been widely employed using a 3D geometry model for a gas dispersion and an explosion simulation. For an accurate determination of explosion design loads, extensive scenarios covering various leak locations, leak directions, leak rate, wind directions and so on are treated in the simulation. In order to reflect the results of the risk assessment into detailed topside design, the time-consuming simulations should be begun from the early stage of the detailed design. However, the congestion level of 3D geometry modeling available at the early stage is considerably different from the as-built model due to the lack of modeling of small-sized piping, pipe supports, electrical supports, detailed structural outfitting and so on. This study proposes a method to generate 3D pipe modeling to compensate for the low congestion level. A random approach is made for the generation by randomly determining a starting point of a pipe spool, pipe diameter, pipe direction, a straight pipe length, number of pipes in a pipe spool and so on. For a pipe running through a given box range, it is cut out on the box boundary and a pipe type connecting with a neighboring module is also realized. For a longitudinally long pipe rack, the inside pipe spools have different features. The generation algorithm is adjusted to realize these features. The generated method doesn't include any algorithm to avoid existing other geometric entities such as equipment or structural members. Thus, the generated pipe length is generally reduced after combining with a module containing equipment and structural members. A study is also done about how much the pipe length of the as-built model needs to be increased considering the overlap. The proposed method is verified by combining the generated pipe model with a module containing only structure & equipment, and comparing explosion analysis results with the corresponding as-built model. A dispersion simulation is also performed for the validity of the proposed model in the dispersion simulation as well.