Abstract

The pipeline layout design of nuclear power plant is to find the optimal route to meet the objectives and constraints in the 3D routing space. However, due to the intensive equipment and complex structure of the nuclear power plant, various types of pipeline systems, complex layout constraints, and a large number of pipelines, even for experienced designers, pipeline layout is a difficult and time-consuming task. In order to solve the problem of the automatic layout of pipeline in 3D routing space of nuclear power plant, a pipeline automatic routing method combining Dijkstra algorithm in large space and improved A algorithm in local space is proposed in this paper. Firstly, the method identifies the key vertices of each room in the nuclear power plant, constructs the topological routing map, and determines the preliminary passage area of the pipeline through the traditional Dijkstra algorithm. Secondly, the space of the layout area is divided into 3D grids, and then the items in the area are identified and preprocessed. Finally, the 3D pipeline routing environment is established through AABB-OBB hybrid collision detection technology. On this basis, the improved method of A evaluation function is given to satisfy the pipeline layout constraints and improve the search efficiency. Through experiments, the effectiveness of this method is proved. This method can quickly and automatically route the nuclear power pipelines that meet the requirements of the engineering, which greatly improves the efficiency of 3D pipeline layout design for the nuclear power plant.

1. Introduction

With the increasing environmental pollution problems caused by fossil energy, as clean and economical energy, nuclear energy has attracted the attention of the world. During the design and construction of the nuclear power plant, adopting advanced design technology can better improve the quality and safety of nuclear and reduce the construction cost. Pipeline design is very important during the construction of the nuclear power plant. Because of safety considerations, a nuclear power plant is constructed in a large solid concrete building. Many pipelines are constructed in the divided rooms, the density of the pipelines is very high, and the rooms are very crowded. The pipeline layout design is difficult, and the workload is large. Engineers need to spend a lot of time designing pipelines. The workload of pipeline design accounts for about 40%. Due to the rapid development of computer-aided design (CAD) technology, CAD has become indispensable for nuclear power design. Designed drawings and bills of material are perfectly produced by the CAD system. This has greatly improved the design efficiency of the pipeline layout design [1]. However, in design, it still mainly depends on the designer to observe the CAD model or drawing and combine design experience, which does not reach the level of intelligence and automation. Although the current mainstream CAD system provided a simple semi-automatic pipe layout tool, due to its limited function, it cannot meet the needs of automatic layout design. The research on automatic layout design can further improve design quality and efficiency.

Pipe routing design has been studied in various industrial fields, such as plant [2, 3], ship [4], aeroengine [5, 6], integrated circuit [7, 8], drones [9], and so forth. According to the characteristics of various industries, some automatic layout algorithms have been proposed. The improved maze algorithm and improved genetic algorithm are used for automatic routing in grid space proposed by [10]. This research provides a way of multibranch pipe routing under certain conditions. Taking the Dijkstra algorithm as the basic algorithm, a special evaluation method is designed to comprehensively evaluate the route length, the number of bends, and constraints, so as to realize the selection of the optimal route [11]. For this research, all nodes and their parameters must be defined before the algorithm runs. The effective combination of the ant colony optimization (ACO) algorithm and the genetic algorithm (GA) algorithm helps designers carry out pipeline design in the initial stage [12]. The above research is used in some specific pipeline design environment situations of shipbuilding. For the automatic layout design of the pipeline of the nuclear power plant, the pipeline layout needs to be carried out in the grid with a complex and dynamic environment. Not only the effectiveness of the algorithm but also the efficiency and feasibility of system operation and the usability for designers should be considered.

Automatic routing is the key to the automatic layout of the pipeline. In order to realize the automatic routing algorithm, relevant research has been carried out for a long time. Systematic studies in route planning have been carried out by researchers for several decades, such as Dijkstra algorithm [13], A algorithm [14], Lee algorithm [15], ant colony algorithm [16], particle swarm optimization algorithm [17], and so on. Among them, A is a heuristic algorithm. It assembles the ideas of the A algorithm and Lee’s maze algorithm. It can reduce the search of route finding space and improve search efficiency. The algorithm has been widely used in many fields of the automatic layout of pipelines [18]. In addition to the appropriate routing algorithm, the establishment of 3D routing space for routing is also one of the important contents in the automatic layout of pipelines. At present, most of them adopt the node and grid methods. The node method has clear route information. But it needs to process a large amount of data in advance, with insufficient flexibility. It is not suitable for dynamic data processing. The grid method is suitable for dynamic scenes, with more flexibility, but for large 3D routing space, there will be a very large number of grids, and the calculation speed is a problem to be solved.

The research on automatic routing for a pipeline of the nuclear power plant is in its infancy, although some achievements of other industries can be used for reference because the 3D model of the nuclear power plant has the characteristics of multiple specialties, multiple items, and multiple constraints. This leads to the large scale of spatial information such as position coordinates and geometric shapes of the model, and the layout constraints are complex. In addition to the requirement of the shortest route, the pipeline layout also requires the pipeline to be routed close to the wall, and the number of bends shall be as few as possible. The existing traditional routing algorithm and other technologies cannot meet the needs of automatic layout for a 3D pipeline of the nuclear power plant. Regarding the above points, combined with the design characteristics, an automatic layout method for a 3D pipeline of the nuclear power plant is proposed in this paper. This method divides the routing process into two levels: large space routing and local space routing. The large space routing uses the Dijkstra algorithm. For local space routing, firstly, a new method is used for grid generation, and then the 3D pipeline routing space is established by AABB-OBB [19, 20] hybrid collision detection technology. Finally, the optimized A algorithm is used for local space routing. According to the method in this paper, an intelligent 3D pipeline layout design system for the nuclear power plant is developed. Through the verification and comparison of the system, it is proved that this method can quickly and automatically route the 3D nuclear power plant pipeline satisfying the design objectives and constraints and greatly improve the efficiency and quality of pipeline layout.

2. Intelligent Routing Algorithm of 3D Pipeline

2.1. Objectives and Constraints of Pipeline Layout Design

According to the requirements in the design specification of the nuclear power plant, during the piping layout design, the requirements of system process and piping and instrument flow diagram (P&ID) shall be met first. Secondly, it shall meet the requirements of commissioning, operation, maintenance, radiation protection, and leak detection [21]. The objectives of nuclear power pipeline layout design are as follows: the pipeline connects the equipment or pipeline according to the specified starting point, target point, and direction; the pipeline shall be laid in an orthogonal direction as far as possible; the total length of the pipe shall be as short as possible; the number of bends or bends shall be as few as possible; and the pipeline layout shall be as close as possible to the wall, floor, or equipment where the support can be installed, so as to facilitate the design of pipe support. In addition to these objectives, the nuclear power pipeline layout design also needs to meet the following constraints:(i)The pipeline route shall bypass obstacles, passages, and operation space(ii)The minimum distance between two bends cannot be less than the specified value(iii)The pipeline route must pass through the routing points preset

2.2. Intelligent Layout Design Process of Pipelines

The core of intelligent layout design for a 3D pipeline of the nuclear power plant is the pipeline route planning algorithm. Among the currently mature routing algorithms, such as breadth-first algorithm, depth-first algorithm [22], Dijkstra, greedy best-first search algorithm [23], A, B [24], Lee, and so on, it is impossible to find an algorithm that obtains the optimal performance in all situations. As mentioned above, the typical characteristics of nuclear power pipeline layout design are large space scale and many items. The piping system is a large-scale system. There have been relevant studies [25] on the dimension reduction methods for the high dimension problems of a large-scale system. In order to realize the dimension reduction of large-scale space of nuclear power pipeline layout design and improve the routing efficiency, this paper divides the routing space into two levels: large space routing and local space routing. When the routing space contains multiple large spaces similar to the plant, the large space routing method is adopted. And the local space routing method is adopted in a specific space. In different scenarios, the combination of different algorithms is selected, and the constraints of nuclear power pipeline layout design are integrated to realize pipeline routing. The calculation efficiency of route planning can be improved by combining a variety of route planning algorithms.

According to the design process of the 3D piping layout of the nuclear power plant, combined with the idea of space routing, the intelligent layout design process of pipelines is shown in Figure 1. Firstly, data preparation is carried out to obtain obstacle models such as layout scenes, equipment, and rooms. Then the key vertices of each room in the nuclear power plant are identified, and the topological routing map of large space is constructed. Next, the grid space is divided according to the pipe diameter in the local space; the obstacles are identified; and the 3D routing space is established. Finally, local space route planning is carried out.

2.3. Route Planning in Large Space

In order to realize the 3D intelligent design of the nuclear power plant, we must first determine the spatial area to implement pipeline layout and transform this spatial area into a data structure that can be calculated and processed by computer. Only through the mathematical algorithm established on the computer can we realize the intelligent layout. When the starting point and ending point of the pipeline are distributed in different rooms of the nuclear power plant, the large space routing can determine which rooms are more suitable for arranging the pipeline.

2.3.1. Building Topological Mesh

The key to forming a topological mesh is to determine the connection relationship between the vertices of each room and the vertices of other rooms and the distance between each point. Firstly, the vertices of each room in the plant can be obtained according to the plant model. Then the vertices and edges are merged according to specific rules to form the plant topology mesh. The topology mesh can be regarded as an undirected graph G = {V, E}. The shortest path can be found in the G to determine the appropriate room path of the pipeline.

The effect drawing of the room vertex in the plant is shown in Figure 2. The vertex set of each room in the plant can be expressed as V = {P1 (x1, y1, z1) … Pi(xi, yi, zi) … Pn(xn, yn, zn)}, where Pi (xi, yi, zi) denotes the 3D coordinate value of the vertex Pi. The set of edges is expressed as E = {(P1, P2), (P2, P3) … (Pm−1, Pm), (Pm, P1)}.

Due to the existence of walls, the common points of two adjacent rooms will be considered as multiple adjacent vertices. As shown in Figure 3, vertex 5 of room 1 and vertex 6 of room 3 will be regarded as the same topology point in the actual routing. Therefore, in a large space, vertices can be merged within a given range. This not only can improve the accuracy of path routing but also can improve the calculation speed. When the distance between the vertex of the room and the vertex of the adjacent room is less than 1 m (the general thickness of walls), these vertices can be merged into the same topology point. When the vertices of the two rooms are merged, the edges of the same vertex in the edge set are merged in turn. As shown in Figure 3, vertices 5 and 6 will be merged to form a topological point; vertices 1–4 will be merged to form a topological point; vertices 7 and 8 will be merged to form a topological point, and the four corresponding edges will also be merged into two.

Because the room model is relatively stable and does not change frequently and it takes a certain time to generate topology points, it can be generated automatically on a regular basis, and the information can be stored in the database. After the room model is updated, the local data can be updated. The topological point information is stored in the external database, which is conducive to the development of the algorithm for calculating the shortest route using a more efficient programming language.

2.3.2. Finding Shortest Route in Topological Mesh

Dijkstra is a classic shortest route algorithm. It is suitable for finding the shortest route with determined starting and ending points. Its main feature is that it takes the starting point as the center and extends outward layer by layer until it reaches the end point. Breadth-first search is used to solve the single-source shortest route problem of a weighted digraph. Finally, the algorithm obtains the shortest route tree. The time complexity is O (N^2).

2.4. Route Planning in Local Space

Before local space routing, it is necessary to build a 3D routing space for pipeline layout in the local space and then identify which spaces are obstacles and which spaces are free areas according to the items in the space (equipment, walls, etc.). Based on the constructed 3D routing space, route planning is carried out.

2.4.1. Establishment of Local 3D Routing Space of Pipeline Layout

In the establishment of local 3D routing space of pipeline layout, firstly, the grid is divided, and the 3D routing space of the design area is divided into cube grids of the same size according to the grid definition. Then, traverse the 3D model of the plant in the design area and extract the axis-aligned bounding box (AABB) and oriented bounding box (OBB) of the specified hierarchical model. Finally, the obstacles in the design area are identified by the intersection detection of AABB and OBB with the grid using the separating axis theorem.

(1) 3D Grid Generation. The current space identification methods [26] include grid method, graph method, and free space method. Among them, the grid method is convenient for expressing different pipe layout constraints by setting parameters on the grid and can convert the pipe layout problem into a pipe interface point. The routing problem in the middle can be solved by converting the piping layout problem into a mathematical algorithm, which is the method most adopted in the industry. However, because the space in the nuclear power plant is limited and complex, it is necessary to establish a set of grid division methods capable of handling this complex environment. It is necessary to ensure that this space division is sufficient to deal with the complex situation of the nuclear power plant but also to ensure that it can be handled. And the speed and efficiency should be guaranteed. Because, in the process of 3D design of nuclear power plants, items are arranged in an orthogonal manner, an orthogonal grid is considered to divide the power plant model, and model information is stored in the grid. This process of discretizing model data is similar to the process of voxelization in computer graphics, but the traditional voxelization of triangles has the disadvantages of traversing all triangles, which leads to slow speed and difficulty in data storage and utilization. To meet the needs of nuclear power engineering design, a new voxelized grid design method is proposed for the 3D model of nuclear power engineering design.

The grid division design method in this paper adopts embedded grid division. Firstly, the specified local 3D routing space is divided into multiple grid blocks. The Xdimg, Ydimg, and Zdimg are expressed as the number of blocks along the X+, Y+, and Z+ axes, respectively, and then the block is divided into multiple minimum precision grid cells. The Xdimb, Ydimb, and Zdimb are expressed as the number of blocks along the X+, Y+, and Z+ axes, respectively, number of cells in the Z+ axis direction. As shown in Figure 4, the yellow model area is divided into 3D grids. The whole 3D grid is called grid space. The grid space is divided into multiple blocks, and each block is composed of cells in the area. The grid space is only a set of grids, and the minimum unit is cell.

At present, the process pipeline of the nuclear power plant is mainly within the range of DN8 ∼ DN800. Considering the requirements that the pipeline can be installed and maintained, the outer wall of the pipeline is usually kept at a certain distance from other items. For relevant requirements, refer to the pipeline layout design guidelines. When the pipeline layout is abstracted as the routing problem in the grid environment, in order to meet the above pipeline size and proximity requirements, the grid scale shall be consistent with the minimum size. Considering that in the design process of the nuclear power plant, the focus on the pipes depending on the layout space is more than DN50; this paper determines that the minimum size of the grid is a cube with a side length of 50 mm.

The cell has the global coordinate sequence number [XG, YG, ZG] of the gird; the sequence number is a non-negative integer; and the starting coordinate is [0,0,0]. The cell also has the local coordinate serial number [XL, YL, ZL] of the block; the coordinate value component is a non-negative integer; and the starting coordinate is [0,0,0]. When the base point coordinates of gird in the tube and pipe space are determined, since the grid size of the cell is known, the actual coordinate value of the cell center in the tube and pipe space can be calculated according to the coordinate sequence number of the cell. As shown in Figure 4, in the block in the upper left corner, yellow is the model area. In order to ensure that the cell dimensions in all blocks are always equal after grid division, the number of cells needs to be supplemented. The supplemented cell value fills in the prohibited routing area. Grid alignment can ensure that the data volume of all blocks is the same, which is conducive to the overall access of data in memory and improve the access speed. After all block sizes are aligned, multiple threads can be evenly allocated for parallel data processing to avoid thread idleness caused by the misaligned grids.

The embedded grid division design will be optimized from three aspects. (1) When the room structure of the nuclear power plant is complex and the topology mesh cannot be generated quickly and effectively, it supports secondary routing. The routing algorithm can first conduct primary routing according to the block. For example, if the number of cells in a block area is marked as obstacles, the number of grids and the total number of cells exceed a certain percentage. Then the block is a prohibited area. (2) When the nuclear power pipeline layout needs to know the surrounding grid environment frequently, the method of storing cell data by a block will avoid the problem of large-scale jump access of data and improve the search speed of the routing algorithm. (3) The 3D grid is data-intensive, and parallel computing can be used to construct a separate environment for each block, which greatly improves the processing speed. A grid example is shown in Figure 5.

(2) Obstacle Identification. In the design space, existing 3D models need to be identified as obstacles to avoid collisions during the pipeline layout design process. The principle of obstacle identification is to collide the 3D model with the grid. The grid without collision is the free grid in which the pipeline can be arranged. The grid with a collision is the obstacle grid in which pipeline layout is not allowed.

The pipeline layout design is a static design process, and the obstacles in the plant will not change their positions in real time. The 3D model of the nuclear power plant has a definite hierarchical structure. In order to solve the problems of computing time and data storage, according to the characteristics of nuclear power pipeline layout, this paper uses a collision detection algorithm based on BVH Tree [27] and AABB-OBB hybrid bounding box to identify obstacles.(i)AABB-OBB hybrid bounding box. The 3D model has a lot of redundant geometric details. It will produce a huge amount of computation in collision detection. In this paper, the AABB-OBB hybrid bounding box is used to simplify the model and greatly improve the performance of collision detection. Geometric data of the bounding box can be directly queried from the database of 3D design software or obtained by solving the eigenvalues of the covariance matrix using the vertex coordinates of the 3D model. In order to reduce the number of the repeated query of the model database during the running of the program, the attribute data of the model node, such as specialty, radiation area, clearance distance, and so on, are collected and bound to the bounding box data. The bounding boxes of a pipeline are shown in Figure 6(a); the bounding boxes of a pump are shown in Figure 6(b); and the bounding boxes of some walls are shown in Figure 6(c).(ii)Collision detection of the AABB-OBB hybrid bounding box. In the collision detection process of AABB-OBB hybrid bounding box, the grid and AABB are first tested for collision. Then, the collision detection is performed between the colliding grid and OBB to further reduce the range of colliding grids. The schematic diagram of the collision detection process of the AABB-OBB hybrid bounding box is shown in Figure 7.In the collision detection process of AABB, assume that the x, y, and z coordinates of the minimum point of the AABB bounding box are , , ) and the x, y, and z coordinates of the largest points are , , ), the AABB can be expressed as follows:The collision detection of the OBB and grid adopts the separating axis theorem. Project the two 3D models for collision inspection into 2D graphics (XY, YZ, and XZ) of three planes, respectively. Carry out the following processing for all planes. First, find the vector group of all edges of the projected graphics [V1, V2, V3, …]. Secondly, calculate the normal vector and unit vector of all edges [E1, E2, E3, …]. Then, carry out the cyclic operation of the orientation amount E in turn to calculate the projection of the vector of each graphic projection point on the unit vector. As long as the projection of the two models does not cross, it can be considered that the two models do not collide. The projection diagram is shown in Figure 8. If all vectors overlap after multiple planes, it indicates that there must be a collision. The grid finally identified as containing obstacles is marked out and treated as obstacles in the routing process.(iii)Bounding volume hierarchy tree (BVH Tree). The collision detection algorithm of the AABB-OBB hybrid bounding box needs to traverse all bounding boxes, and its time complexity is O(N). If the scale of the 3D model is too large, collision detection will not be completed within a limited time. In this paper, the BVH tree is used to optimize the performance of AABB-OBB hybrid bounding box collision detection, and its time complexity is O(logN). The larger the scale of the 3D model, the better the optimization effect. The 3D model of the nuclear power plant has a definite hierarchical structure. Therefore, the hybrid bounding box of 3D models can be constructed as BVH Tree. A 3D model of equipment consisting of a tank, support, and an operating space is shown in Figure 9(a). D and E are the bounding boxes for the tank and support. C is the bounding box of the main body composed of them and is called the parent node. B is the bounding box of the maintenance space reserved for the device, which is independent of node C. The main body of the equipment and the maintenance space together constitute the largest bounding box A, which is the root node of the hierarchical bounding box tree.(iv)AABB-OBB hybrid collision detection process optimized by BVH tree. The collision detection process of the AABB-OBB hybrid bounding box optimized by the BVH tree is shown in Figure 10. Firstly, the proposed method starts from the root node of the BVH tree to detect whether the AABB of the current node collides with the grid. If there is a collision, the SAT is used to detect whether the OBB of the node collides with the current grid. If there is a collision, the next level nodes of the BVH tree are traversed in the same way. Once there is no collision, collision detection is stopped, and the grid is identified as a free grid. If the grid finally collides with the node in the last level, the grid is identified as an obstacle grid. This method can identify free grids and obstacle grids efficiently. In order to enable the pipe routing algorithm to quickly query the attribute data of the 3D model, the attribute data is referenced to the obstacle grid during obstacle grid identification.

Through the grid generation method and obstacle identification method mentioned in this paper, the 3D routing space can be established efficiently. The 3D routing space generation of a plant is shown in Figure 11. Comparison of the 3D routing space generation method is shown in Table 1, the method in this paper greatly reduces the time and space complexity of 3D routing space generation, improves the grid performance, and can effectively solve the time and space consumption caused by complex 3D models of the nuclear power plant.

2.4.2. Local Space Routing

Local space routing is to route in the grid. The larger the grid size, the more computing time is consumed, so the time complexity of the routing algorithm must be low enough. This paper proposes the improved A algorithm and integrates the design rules of nuclear power pipeline layout to implement pipeline layout routing.

(1) The Original AAlgorithm. A algorithm is a typical heuristic search algorithm, which obtains the expansion cost of each point from the evaluation function, and selects the minimum cost point for expansion. The evaluation function of node n is as follows:where G(n) is the cost from start node s to node n and H(n) is the estimated cost from node n to the target node. A algorithm maintains open and closed lists. The open list is used to store evaluated but not extended nodes. The closed list is used to hold nodes that have expanded and do not need to be checked again. The original A algorithm is described as follows:

Step 1. Add the start node to the open list.

Step 2. If the open list is not empty, go to step 3; otherwise, stop the search.

Step 3. If the node n with the minimum F(n) value in the open list is the target node, the route search is successful; otherwise, go to step 4.

Step 4. Traverse neighbor nodes n' of current node n. If n′ is new, add it to the open list, set its parent node as n, and go to step 2. If n′ already exists in the closed list, do nothing and go to step 2. If n′ already exists in the open list, go to step 5.

Step 5. If the new F(n) is smaller than the old F(n), update the F(n) value and point its parent node to n. Otherwise, do nothing, add n′ to the closed list, and go to step 2.
The heuristic function H(n) has an important influence on routing speed and quality. The basic heuristic function generally uses the distance from the current node to the target point as the evaluation function, and the commonly used ones are Euclidean distance, Manhattan distance, and Chebyshev distance. Manhattan distance is used as the length evaluation in this paper.
(2) Improved AAlgorithm with Routing Constraints. The main difference between the pipe route algorithm and route-finding algorithm is that the latter is only responsible for searching possible route, while the former needs to integrate pipeline layout objectives and constraints, and the layout results must meet these constraints and achieve the design objectives as far as possible. By combining the design objectives and constraints of the nuclear power pipeline layout with the pipe routing algorithm, a nuclear power pipe routing algorithm is proposed. For the five design objectives and three design constraints in the nuclear power pipeline layout mentioned above, the implementation method of this paper is as follows:(a)Connect pipes and equipment (objective). A algorithm has been widely used in graph search. As long as two different nodes in the graph are determined, the algorithm can be used to search the possible route between nodes. Therefore, if there is a possible route between the start and target of the pipeline, A algorithm can ensure that at least one possible route is found.(b)Arrange pipes and rigid structures orthogonally (objective). The grid in this paper is a 3D orthogonal grid, and the algorithm only allows extended search from six orthogonal directions. Therefore, the generated route must be orthogonal.(c)Minimize the route length as much as possible (objective). When only this objective is activated, it must be the shortest route if there exists a route. When working with other rules, if there is interference between rules, other rules with higher priority will be guaranteed first.(d)Minimize the number of bends as much as possible (objective). The rule is implemented by adding the turning penalty factor in the real cost function G(n). Each time the algorithm expands, it will detect the position of the current grid and the first two grids. If it is found not in the same direction, a penalty factor, namely the bend cost CB(n), will be added to the real cost function so that the route is evaluated as “worse.” The route can also be optimized by postprocessing program.(e)Route pipes along the surface of walls, floors, or equipment for better support (objective). Similar to the rule of reducing the number of bends, this rule adds a factor to the real cost function G(n). The difference is that the former adds a penalty factor to avoid turning, while this rule requires routing close to the wall. Therefore, this rule adds an incentive factor to the real cost function G(n), that is, the cost close to the wall CC(n). When it is close to the wall, the real cost function subtracts CC(n), which makes the route “better” to the pipeline layout.(f)Avoid obstacles, passages, and operating spaces (constraint). Firstly, the BVH tree is constructed from the 3D model of the nuclear power plant in the design area. In each expansion process of the routing algorithm, the bounding box collision detection algorithm is used to check whether the expanded body of the current grid collides with any existing obstacle. If the collision occurs, the current node will be skipped, so as to ensure that the distance between the pipeline and obstacle is greater than the minimum value.(g)Satisfy the minimum length requirement between two adjacent bends (constraint). There is a minimum distance rule between two adjacent bends. The algorithm first divides the preset minimum distance value by the grid size to calculate the minimum number of grids between two adjacent bends. After that, the algorithm will count the number of grids passed since the last bend in each expansion process. If the minimum number of grids is satisfied, the direction is allowed to change; otherwise, the route can only move forward.(h)Routing points (constraint). Routing points are points through which a pipeline will pass. The algorithm implements this constraint by the piecewise route method. After a routing point is inserted, the algorithm divides the original route into two segments, and the target of the first segment is reset to the routing point and reset the routing point as the starting point of the second segment. Then the algorithm performs a continuous routing process and finally combines the two segments into one route. If there are N routing points are added, the algorithm will perform N + 1 routing processes and then merges the results into a complete route.We improved A algorithm by reconstructing the real cost function G(n) and heuristic function H(n) to implement the above design objectives and constraints. For A algorithm, there is a subtle relationship between G(n), H(n), and the result. The smaller the value of H(n), the less heuristic information, the larger the search range and the slower the search speed, but the more promising it is to get the shortest route. If H(n) is always zero, it is equivalent to no heuristic information; then A algorithm degenerates into Dijkstra algorithm; the search range is the largest; and the shortest route must be obtained. The larger the value of H(n), the more heuristic information and the smaller the search range, but it may not get the shortest route. When H(n) is much larger than G(n), G(n) can be ignored, then A algorithm evolves into greedy best-first search algorithm that has the fastest speed, but it may not be able to get the shortest route.
(1) The Improved Real Cost Function. The real cost function G(n) evaluates the cost from the start node to node n. The improved real cost function is defined as follows:where CL(n), CB(n), and CC(n) are the real distance cost, bend cost, and close to wall cost from the start node to node n, respectively. The cost functions are defined as follows:where (xs, ys, zs) and (xn, yn, zn) are the indexes on the coordinate axis of start node and node n, respectively; is the distance cost factor, wG>0; abs(.) is a function to compute an absolute value; b is bend cost factor; and c is close to the wall cost factor.
(2) The Improved Heuristic Function. The heuristic function H(n) of the original Aalgorithm estimates the cost from node n to the target. Adding weight factor to the original heuristic function H(n) to change the proportion of the heuristic function in the whole evaluation function can reduce the invalid search area and improve the search efficiency. The weight factor adopts the logarithmic function of the Euclidean distance between the current node and the target node. The improved heuristic function is defined as follows:where (xt, yt, zt) and (xn, yn, zn) are the indexes on the coordinate axis of the target node and node n, respectively, and (Xt, Yt, Zt) and (Xn, Yn, Zn) are the coordinates of the target node and node n, respectively.
(3) The Improved Evaluation Function. Based on the definitions of G(n) and H(n), the evaluation function F(n) is defined as follows:Some examples of the improved A algorithm implementing design rules in a two-dimensional map are shown in Figure 12.
(4) Optimizing the Open List with Priority_Queue. In the search process of A algorithm, nodes need to be added in real time to the open list. After each round of search scope expansion, nodes with the minimum F value need to be taken out from the open list. Assuming that there are N nodes in the open list, the original A algorithm obtains the node with the minimum F value through traversing the whole open list, and its time complexity is O(N).
The improved A algorithm in this paper uses the Priority_Queue implemented by the minimum binary heap as the container of the open list. A minimum binary heap is a sorted complete binary tree in which the data value of any non-terminal node is not greater than the value of its left and right children. Therefore, the minimum binary heap root has the lowest key value of all heap nodes. The Priority_Queue sorts the open list by key value each time an element is added or deleted. The time complexity of the add and delete operations is O(logN). In this process, the element with the minimum key value is always kept at the top of the queue, so the time complexity of extracting the maximum value point is O(1). In conclusion, after Priority_Queue optimization, the time complexity of removing the minimum F value node from the open list is reduced to O(logN). The larger the list size is, the more obvious the optimization effect is.
(5) Optimizing the Closed List by 3D table (3D array). The nodes in the closed list are those that have been searched in the expansion process of A algorithm. Each time the algorithm searches for a new node, it must first confirm that the node is not in the closed list. If the node is already in the closed list, it will be skipped. Because the list is only used to avoid repeated searches, the nodes in the close list are similar to obstacle nodes. This paper uses a binary 3D array to mark the grid nodes added to the close list. Assuming that the scale of the close list is N nodes, the time complexity of the original A algorithm to take out a node through traversing the close list is O(N). Since data can be read and written directly from a 3D array, the time complexity of the improved algorithm is always O(1).

3. Experiments and Results

At present, 3D plant design software such as PDMS or PDS/S3D is widely used for pipeline design in nuclear power plants. Based on the method in this paper, an intelligent 3D layout design system for pipeline design of nuclear power plant has been developed, and the performance of this method is verified. All experiments are implemented in the same environment. The operating system is 64 bit Windows 10. The version of PDMS is 12.0.sp6. The hardware environment is an Intel Core 4 3.4 GHz CPU and 8 GB of memory.

3.1. Simulation Verification of Large Space Routing

In the verification of large space routing, we chose two-story civil structure. The first floor consists of rooms 11–17, with seven rooms in total; equipment 1 and 2 are located in rooms 11 and 16, respectively. The second floor consists of rooms 21–29, with nine rooms in total; equipment 3 is located in room 28. The room plane of the second floor is shown in Figure 13. The experiment will take equipment 1 as the starting point, equipment 2 as the end point, equipment 1 as the starting point, and equipment 3 as the end point.

Through the Dijkstra algorithm, in the same layer routing, the route as shown in Figure 14(a) is generated, starting from the starting point, passing through rooms 11, 12, 14, and 16 to the end point. In cross-layer routing, a route as shown in Figure 14(b) is generated, starting from the starting point, passing through rooms 11, 12, 27, and 28 to the end point.

3.2. Simulation Verification of Local Space Routing

In the verification experiments of local space routing, this paper selects a virtual scene similar to that in nuclear power engineering design for automatic pipeline layout. The scene is in the same room, including two storage tanks, two equipment, and two pumps for gas transmission. The connection relationship is that the inlet of pump 1 is connected to the bottom nozzle of storage tank 1 that must pass through equipment 1, the top nozzle of tank 1 is connected to the top nozzle of tank 2, and the outlet of pump 1 is connected to the inlet of pump 2, which must pass through equipment 2. The system diagram of pipelines is shown in Figure 15.

According to the proposed meshing method, 29  23  20 large grids and 145  115  100 small grids in the large grid are divided. Through collision detection, the 3D routing space can be obtained as shown in Figure 16. The sequence, connection relationship, diameter, coordinates of pipelines are shown in Table 2.

3.2.1. Original A Algorithm

In the 3D routing space, the pipeline layout design scheme obtained by the original A algorithm is shown in Figure 17.

Some design objectives can be achieved in the pipeline layout design scheme, such as connecting equipment or pipelines, laying pipelines in orthogonal directions, and shortening pipelines as far as possible. However, there are many problems in the pipelines that do not meet the objectives and constraints of pipeline layout. As shown in Figure 18, there are a large number of unnecessary bends; some pipelines are not laid against the wall; passages and operation space are not bypassed; and the constraints of the minimum distance between bends and c also cannot be met.

Original A algorithm can only achieve the basic routing function, and the complex design objectives and constraints cannot be satisfied. On the whole, the design results of original A cannot be used in engineering design.

3.2.2. Improved A Algorithm Combined with Design Rules

The pipeline layout design results of the improved A integrating design rules introduced in this paper are shown in Figure 19.

The improved A algorithm not only achieves the design objectives realized by the original A algorithm but also can solve the shortcomings of the A algorithm in a nuclear power pipeline layout. The details are as follows:

(1) Minimize the Number of Bends. As shown in Figure 20(a), there are only 16 bends in the layout result of the improved A algorithm, which is greatly optimized compared with the original A algorithm. The bends in the scheme are all necessary; the number of bends is optimized; and the design objective is realized.

(2) The pipelines Laid Close to the Wall, Plate, or Equipment Where Supports Can Be Installed. As shown in Figure 20(b), the 1st pipeline of the improved A algorithm is laid near the wall.

(3) Minimum Distance between Bends. As shown in Figure 20(c), the minimum distance between bends in the improved A algorithm is greater than the set value, and the design constraints work normally. It realizes the functions that the original A algorithm cannot meet and fully meets the design objective.

(4) Through the Routing Points. As shown in Figure 20(d), after device 1 is set as a routing point before routing, and the improved A algorithm can pass through device 1 in the routing scheme to meet the design objective.

3.2.3. The Performance Comparison between the Improved A Algorithm and the Original A Algorithm

In order to verify the effectiveness of the proposed method, we compare this method with manual pipeline layout design, the original A in detail. The effect pairs of each algorithm in terms of target and constraint satisfaction are shown in Table 3. Because the original A cannot set the routing point (the routing points are skipped), the total length of the pipeline is shorter. If the pipeline section connecting equipment 1 and 2 is added, the pipeline length will exceed the pipeline length of the method in this paper. Similarly, the pipeline layout scheme obtained by manual design also wastes the length of the pipeline. In terms of the number of bends, this method obtains the same effect as the manual design and is much better than the original A algorithm. The original A algorithm is easy to produce unnecessary bends due to the inherent defects of the grid search form. The proposed method not only maintains the advantage of the shortest pipeline of the original A but also realizes the design objectives and constraints that the original A cannot achieve, such as removing unnecessary bends, arranging close to the wall, satisfying the shortest distance between bends, and setting routing points.

Due to the complex scene of the nuclear power plant, the time consumption of pipeline layout is also an important factor to be considered. The improved A algorithm proposed in this paper uses Priority_Queue, 3D table, and improved heuristic function optimization, which greatly optimizes time consumption and significantly outperforms the original A algorithm. Table 4 shows the average time consumption of simulated routing tests using different algorithms in grids of different sizes (1  103, 1  106, and 5  106). The path routing speed of the proposed algorithm is greatly better than that of the original A algorithm. As the grid scale becomes larger, the advantages of this method will become more obvious.

4. Conclusion

Based on the current 3D digital layout design of the nuclear power pipeline, the research of intelligent pipeline layout technology is of great significance to improve the efficiency and ability of 3D digital design of nuclear power. Through the research on the key technologies of the 3D pipeline intelligent layout design, this study establishes an efficient routing space grid structure, improves the collision inspection method of obstacles, and optimizes the routing algorithm. The unique 3D layout and routing of nuclear power pipeline, the grid construction method of the 3D plant model, and the collision inspection of items can assist designers to complete the pipeline layout design quickly and efficiently. The accuracy and efficiency of the 3D pipeline layout design of the nuclear power plant are greatly improved by using the current advanced computer artificial intelligence technology to replace the traditional manual work. This method is applicable to the 3D layout design specialty of the nuclear power plant, such as cable tray, warm ventilation pipe, and so on. At present, the nuclear power intelligent 3D pipeline layout design system developed based on this method has been put on trial in the HPR1000 nuclear power plant project. The system has received good feedback from users and effectively improved the design efficiency. The research of this system provides great support for the improvement of design efficiency of the HPR1000 nuclear power plant project.

Future work will focus on the follows: (a) standardize the pipeline layout that is to analyze the characteristics and reasons of pipeline layout according to the historical data of functions, main equipment, and layout environment of each nuclear power system; (b) study the intelligent strategy of multipipeline and multibranch routing sequence; (c) verify and optimize the routing algorithm model through more cases; and (d) realize the rapid solution of large-scale problems by using GPU and other parallel technologies.

Data Availability

The data used to support the findings of this study are available upon request to the authors.

Conflicts of Interest

The authors declare that they have no conflicts of interest to report regarding the present study.

Acknowledgments

The authors thank China Nuclear Power Design Co. Ltd., for agreeing to use related engineering data. This research was supported by a grant International Cooperative Research Project (no. GJHZ20200731095602008) from Science and Technology Innovation Commission of Shenzhen Municipality.