Small pressurized water reactors (SPWRs) have emerged as one of the most promising nuclear energy technologies, as they can simultaneously meet current decarbonization goals and the demands of flexible load operation. The nuclear steam supply system (NSSS) is the heart of an SPWR. Traditional text-based modeling approaches lack sufficient modularity, depth, and visualization capabilities. Modelica, which features equation-based, non-causal, object-oriented, and hierarchical modeling, enables rapid, visual, and reusable simulation of nuclear energy systems. Leveraging these advantages, this paper developed a modular, hierarchical dynamic simulation model library to support the rapid modeling and optimal design of SPWRs. Based on the system topology, an SPWR NSSS simulation model was quickly constructed using the developed library, and a corresponding control system was also developed. The accuracy of the modeling method is verified through typical load-change transients.