Next Article in Journal
A Theoretical and Experimental Analysis of the Time-Domain Characteristics of a PRBS Phase-Modulated Laser System
Previous Article in Journal
Machine Learning Accelerated Design of High-Temperature Ternary and Quaternary Nitride Superconductors
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Visual Modeling Method for Ship Piping Network Programs in Engine Simulators

1
College of Marine Engineering, Dalian Maritime University, Dalian 116206, China
2
Department of Navigation, Shandong Transport Vocational College, Weifang 261206, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2024, 14(20), 9194; https://doi.org/10.3390/app14209194 (registering DOI)
Submission received: 11 September 2024 / Revised: 3 October 2024 / Accepted: 8 October 2024 / Published: 10 October 2024

Abstract

:
Nowadays, engine room simulators have become an important tool for maritime training, but programming engine room simulators often involves handling large amounts of data, making the process inefficient. This paper proposes an innovative visual modeling method for the ship pipeline network program in engine room simulators, aimed at addressing the heavy programming tasks associated with traditional text-based design and calculation methods when dealing with complex and large-scale pipeline systems. By creating Scalable Vector Graphics (SVG) images and using Windows Presentation Foundation (WPF) to place controls, an intuitive graphical user interface is built, allowing programmers to easily operate through the graphical interface. Subsequently, You Only Look Once version 5 (YOLOv5) object detection technology is used to identify the completed SVG images and WPF controls, generating corresponding Comma-Separated Values (CSV) files, which are then used as data input via C# (C Sharp). Through automated data processing and equipment recognition, compared to traditional manual design processes (such as using Matlab or C++ for pipeline design), this method reduces human errors and improves programming accuracy. Customization of key pipeline characteristics (such as maximum flow and flow direction) enhances the accuracy and applicability of the pipeline network model. The intuitive user interface design also allows nonprofessional users to easily design and optimize pipeline systems. The results show that this tool not only improves the efficiency of data processing and calculation but also demonstrates excellent performance and broad application prospects in the design and optimization of ship pipeline systems. In the future, this tool is expected to be more widely promoted in ship pipeline network education and practical applications, driving the field towards more efficient and intelligent development.

1. Introduction

In the 1970s, the aviation industry introduced simulators for crew training to reduce accidents caused by human error, significantly improving the skill level and decision-making ability of crew members [1]. The success of aviation simulators attracted the attention and emulation of other transportation fields. Since the 1990s, simulators have been widely applied in the maritime industry for training purposes [2].
Among these, the importance of marine engine simulators is particularly prominent [3]. These simulators can vividly reproduce the operation of ship engines and related equipment, providing trainees with a safe and controlled environment where they can practice under various simulated scenarios, experiencing the real feel of a ship [4], including mimicking the engine room and audiovisual effects [5,6]. This not only allows trainees to master complex engine system operations but also enhances their ability to respond to emergencies. Additionally, marine engine simulators can simulate various potential malfunctions and abnormal situations, enabling trainees to remain calm when facing real failures, thereby effectively reducing mechanical failures and losses due to operational errors [7].
Through marine engine simulator training, trainees can fully understand the operating principles and processes of engine systems without boarding a real ship [8]. This training method not only saves time and costs but also avoids potential dangers during actual operations. Furthermore, marine engine simulators allow for repeated training, enabling trainees to accumulate experience quickly and improve their skills in a short time [9].
An essential component of the marine engine simulator is the ship’s piping system. The piping system serves as the “nervous system” connecting various critical components of the ship, including the fuel pipelines, cooling water pipelines, and compressed air pipelines [10]. Their reliable operation is fundamental to ensuring the normal navigation and mission execution of the ship [11,12]. For pipelines, especially flexible ones, connections are often the weakest link. Therefore, advanced software is used to model the hydrodynamic phenomena associated with high-pressure fluid flow in the pipelines. Numerical methods are effective for pipeline design, taking into account hydrodynamic phenomena and potential pipeline failures [13]. The simulator realistically reproduces the design and operational conditions of these piping systems, enabling trainees to fully master their operational techniques and thereby reduce human error. It should be noted that modeling the flow inside the pipeline is crucial even at the design stage, as it helps predict the maximum load on the pipeline and design its length, wall thickness, and the number and position of supports. When the working fluid is flowing, especially in long pipelines, the water hammer effect can cause damage or even rupture the pipeline. Therefore, using advanced software to model the hydrodynamic phenomena associated with high-pressure flow is essential. The simulator’s realistic reproduction of the design and operation of these systems enables trainees to master operational techniques fully, reducing human errors [14]. However, programming the ship’s piping system is highly complex and typically requires programmers to handle large amounts of data, which is inefficient.
As a result, there has been growing interest in visual modeling methods for ship piping systems within marine engine simulators, with a focus on dynamic modeling, neural networks, modular modeling, and real-time simulation capabilities. These studies highlight the importance of accurate mathematical models and visual simulation in improving training and operational efficiency in the maritime industry. In response, this paper proposes a visual modeling method for the ship’s piping system. Through this method, the complex programming of the engine piping system becomes more intuitive and efficient, greatly enhancing data processing efficiency. This visual modeling method not only simplifies the work for programmers but also provides more convenient solutions for the management and maintenance of the ship’s piping system, further ensuring the safety and efficient operation of the ship.
To improve the programming efficiency of ship piping systems, significant efforts have been made by programmers. In 2005, Shi et al. used a radial basis function (RBF) neural network to model the marine diesel generator system. The RBF neural network has strong nonlinear approximation capabilities, making it ideal for handling complex multi-input, multi-output (MIMO) systems. In their study, they modeled the generator system by inputting physical quantities such as the diesel engine’s torque, excitation current, and voltage and outputting the generator’s voltage, current, and frequency. The system was thoroughly analyzed. During model training, the authors used supervised learning, training the RBF neural network with extensive experimental data. The results showed that the model accurately predicted the generator’s dynamic response, demonstrating high precision and reliability. The study highlighted the advantages of neural network models in handling nonlinear, complex systems, especially their robustness and adaptability during transient conditions such as sudden load changes. The innovation of this research lies in combining neural networks with traditional diesel generator modeling methods, solving the challenges traditional models face in accurately addressing complex conditions. By using the RBF neural network, the model trained quickly and could be used for real-time simulation of ship power systems. This research offers a new approach to marine diesel generator modeling and lays the foundation for further optimization and expansion [15].
In 2010, Kim I et al. explored how to achieve neutral model visualization of ship piping systems using X3D technology, particularly how to utilize 3D technology to more intuitively display complex piping systems. The researchers built a lightweight 3D visualization framework using X3D, an XML-based 3D graphics standard, to show the layout and connections of ship pipelines. This visualization model could run in a browser, achieving cross-platform display and significantly facilitating the system’s application and dissemination. The paper provided a detailed discussion of the visualization process, including geometric modeling of the pipeline system, texture mapping, and dynamic display of pipeline connections. The research also noted that 3D visualization technology could enhance fault detection, pipeline maintenance, and pipeline improvement design. This provides ship engineers with a crucial tool to help them understand complex piping network systems. Furthermore, the study highlighted the system’s strong scalability, supporting future integration of additional functions, such as fluid dynamics simulation. The innovation of this work lies in utilizing open-source X3D technology to achieve a 3D display of ship piping systems, reducing system complexity and providing a highly operable solution for practical applications [16].
In 2015, Zou et al. summarized the modeling and simulation of ship fuel supply systems, proposing a new sparse-matrix-solving algorithm capable of efficiently handling the flow and pressure distribution in large-scale fuel supply piping systems. The paper discussed in detail the mathematical models of various fuel system components, such as fuel pumps, pipelines, and valves and, based on this, established a dynamic simulation model of the entire supply system. The model is characterized by its ability to handle the system’s dynamic response under different fuel conditions, particularly with adaptive adjustment to fuel viscosity changes as temperature varies. The authors verified the model’s accuracy and real-time performance by integrating the simulation system with an actual ship fuel supply system. The paper mentioned that the system adopted object-oriented programming principles and supported distributed deployment, enabling the simulator to handle larger and more complex ship fuel supply systems. In terms of application, the paper demonstrated the successful application of the simulation system in large ships, including dynamic adjustments during operation and system performance optimization. This model achieved a balance between accuracy and real-time performance and possesses strong scalability, making it adaptable to future demands for more complex fuel supply systems [17].
YOLOv5 plays a significant role in detection and classification. To address the need for posture recognition during fruit commercialization, Wang et al. proposed a real-time apple stem and calyx detection algorithm based on YOLOv5. The study first determined the hyperparameters of the recognition targets and used transfer learning to train the model, improving detection performance. A comparison of YOLOv5 network backbones with different widths and depths showed that YOLOv5s had advantages in detection performance, model weight, and detection speed under the same settings. By optimizing the number of detection heads, feature map size, layers, and channel pruning of YOLOv5s, the algorithm’s complexity was reduced, model parameters and weights decreased by 71%, while mAP and F1 scores only slightly dropped by 1.57% and 2.52%, respectively. After optimization, the algorithm achieved real-time detection at 25.51 FPS on a CPU, with a detection accuracy of 93.89%. This method strikes an optimal balance between detection performance and speed, with low hardware requirements and high practicality. The results are also applicable to other tasks requiring specific fruit postures, providing technical support for improving fruit automation processes [18].

2. General Program Design

2.1. Overall Design of Ship Piping Network Program

As the complexity of ship systems continues to increase, using traditional simulation programming methods to build system simulation models requires significant time. Programmers often need to process a large amount of data to deal with complex parameters and models [19]. This presents a major challenge for those who are not proficient in programming or lack professional programming experience. Traditionally, addressing these challenges relies on advanced programming languages and environments like Matlab and Visual C++. Although these tools are powerful, their complexity demands considerable time for nonprogramming users to learn and adapt.
To address the difficulty of traditional piping program development, this study developed a visual piping model. Designers can first create a piping diagram and generate the corresponding SVG file. This SVG file is then imported into WPF, where pumps, valves, and other equipment are added, along with labels to display flow and pressure. Designers can also set parameters to design the ship piping network. The designed SVG image and the position map of WPF controls are then converted into a PNG format, allowing YOLOv5 object detection technology to recognize them. Through the YOLOv5 recognition simulator, designers can detect the piping diagram created in SVG format and the position map of controls designed in WPF. After integration and processing with Python, the data are saved as a CSV file and then calculated and output through C#.

2.2. Main Functions of the Ship Piping Network Program

The ship piping program developed in this study provides a complete solution for piping system design, analysis, and optimization by integrating SVG graphical interface design, YOLOv5 object recognition, Python data processing, and C# computational output.

2.2.1. Visual Piping Network Design

For graphical interface design, we first use professional drawing tools to create a complete piping diagram based on the provided engineering drawings. The entire pipeline connection layout is displayed clearly and intuitively in graphical form. Once completed, the graphic is saved in SVG format, which has the advantage of maintaining clarity and accuracy at different display sizes and resolutions [20]. Pipes are represented by simple lines in the graphic, while specific symbols are used to mark connection points to ensure structural accuracy and readability.
Next, we will import the SVG files into the WPF system, allowing users to interact with the interface intuitively through WPF’s interactive GUI. WPF’s user interface design capabilities are particularly suited for applications requiring highly customized UIs [21]. On this interface, users can freely drag and position various equipment such as pumps and valves and configure the equipment based on actual requirements. Users can set the maximum allowable flow through the valves and assign each valve a flow label code to display the current flow status. Similarly, users can configure the pump’s starting flow rate and pressure and set tags to display the pump’s pressure and flow rate.
WPF is developed on the .NET framework and is highly integrated with the C# language, enabling developers to fully utilize C#’s powerful features, such as type safety and high execution efficiency. Additionally, when the program starts, the interface will display the current pressure of the pumps and the flow through them, corresponding to the respective label codes for flow and pressure. With this visual operation, users can easily monitor and manage the operation of the entire pipeline system, adjusting equipment parameters in a timely manner to ensure efficient operation and safety of the system.

2.2.2. Object Recognition

The program utilizes YOLOv5 object detection technology to recognize the designed SVG diagrams and the position maps of WPF controls. YOLOv5, through convolutional neural networks (CNN), extracts features from the input images and performs object localization, enabling fast and accurate recognition of various devices and connection points [22]. These parameters, including the location, shape, and size of the devices, are then stored in a database. Its efficient recognition capabilities ensure comprehensive detection and analysis of the pipeline system [23]. Additionally, YOLOv5 excels in detecting small objects and in complex backgrounds, especially when handling diverse pipeline devices and connection points. It can optimize the balance between speed and accuracy by adjusting model size, layers, and other parameters.
During the object recognition process, YOLOv5 not only processes large-scale graphical data quickly but also ensures precise localization of various devices and connection points in complex scenes. These detected parameters are systematically recorded for further analysis and optimization. YOLOv5’s outstanding detection performance enables the system to fully cover all aspects of the pipeline network, ensuring the completeness and accuracy of the detection results. Furthermore, the automated data storage and management functions greatly simplify subsequent maintenance tasks, reduce the need for manual intervention, and enhance the overall efficiency of the system.

2.2.3. Data Conversion and Processing

The recognized data are processed and filtered through Python to ensure accuracy and completeness. This step includes eliminating duplicate and unexpected data to improve the quality of the information, making it suitable for subsequent analysis and processing. The final output is a CSV file that provides a reliable data foundation for further calculations and optimization.
In terms of data conversion, since the data recognized by YOLOv5 may contain duplicates and may not fully meet expectations, Python is used to filter and clean the data. This ensures that only the most relevant and accurate data are retained for future use.

2.2.4. Data Calculation and Display

The program utilizes C# to perform real-time calculations on the input CSV files. The type safety and high execution speed of C# ensure the stability and efficiency of the program [24]. Users simply need to place the CSV file in the specified folder and the program will automatically calculate important parameters such as flow and pressure in the pipeline. The calculation results are displayed in real time on the interface, allowing users to quickly receive feedback and become familiar with the operational steps of the ship’s pipeline network.

3. Program Development and Implementation

To achieve the aforementioned functionality, the program’s development and implementation involve the following specific operations:

3.1. Visualization of the Piping Network

In the initial stage of pipeline network modeling, we used advanced drawing software to create a schematic diagram of the pipeline, as shown in Figure 1. In the diagram, larger rectangles represent storage tanks, thin lines represent pipelines, and the dots where thin lines intersect represent nodes, indicating that multiple pipeline segments are connected at that point. Arrows are used to indicate the direction of fluid flow (for target recognition, all pipelines with a fixed flow direction must be marked with arrows, while pipes without arrows indicate that the liquid can flow in both directions). Different colors are used to distinguish the functions of the pipes and the contents of the storage tanks. In this diagram, the example of a sewage system is used, with brown pipes and storage tanks. Users can also customize the colors, such as red for fire water or black for heavy oil.
After completing the drawing, we saved the pipeline diagram in SVG format and imported it into the WPF environment as the base layer for the design. Subsequently, relevant control parameters, such as the valve’s position, the pump’s position, and the maximum allowable flow, can be set in WPF. This method not only allows for personalized visualization of the pipeline layout but also makes it easier for developers to adjust and optimize the diagram, ensuring it meets the design requirements of complex systems.
In the design of the pipeline system, special attention is given to the visual representation of key components. For example, the pump and valve are shown in gray before they are activated and, when the user clicks on them with the mouse, they change to the color of the pipeline to indicate activation. Monitoring the status of flow and pressure in the pump and valve is particularly important, so we developed monitoring labels (including water level, pressure, and flow). As shown in Figure 2, we developed a set of control styles in WPF and stored them in a reusable resource library. In this example, flow and pressure are labeled with “G” and “P”, respectively. Considering that flow is relatively larger, while pressure is smaller, the flow value retains one decimal place and the pressure value retains two decimal places for accurate representation.
In the pipeline diagram, valves are represented by two opposing triangles. One-way valves are shown as one gray and one white triangle, with the gray part indicating the direction of fluid flow. When the one-way valve opens, the gray part changes to the color of the pipeline, intuitively displaying the flow direction. If both triangles are white, it means the valve is a stop valve, which indicates that flow is blocked. When the stop valve is opened, the triangles change to the color of the pipeline. Different valve types are represented by different shapes, as shown in Figure 3. A triangle embedded in a circle represents a pump, and the direction of the triangle indicates the outlet direction of the pump. When the pump is not activated, it is displayed in gray–black and, when activated, it changes to the color of the pipeline.
In real ships, pumps are usually designed with safety valves to prevent damage to the pump or pipeline due to excessive pressure when the discharge pipe is blocked. By default, pumps in this system are equipped with safety valves but, if the user opens only the pump and the valve at the inlet, the pump pressure will rise quickly until the safety valve opens. If the valve at the outlet is opened, the pump resumes normal operation. The rectangle inside the storage tank represents the water level label, providing a visual indication of the liquid level. In the design, the maximum water level in the tank is 100, with an initial water level of 70%. The water level label shows changes based on user operations. When the maximum water level is reached, water supply cannot continue and will be diverted to other branches. When the minimum water level is reached, water cannot be drawn, causing the pump to idle, and both pressure and flow will drop to zero.
Some storage tanks operate by gravity (without pumps). To ensure accuracy in such cases, it is necessary to set the maximum flow limit for the outlet pipe section. To limit the maximum flow of a pipe section, it is only required to appropriately limit the maximum allowable flow of the valve on that section. This detailed graphical design ensures that operators can clearly identify and interpret various status information within the pipeline network.
When designers need to limit the maximum allowable flow of an outlet pipe section, they only need to set the maximum allowable flow for the pump. Notably, if there are multiple valves on the same pipe section, the maximum allowable flow for that section will take the smallest value of the maximum allowable flow across those valves. This approach allows parameters that cannot be set directly for the pipe section in WPF to be set indirectly through the pump.

3.2. Implementation of Object Recognition

Object recognition is a key aspect of this program, which utilizes YOLOv5 for object detection. YOLOv5 is widely adopted for object recognition tasks due to its high efficiency in real-time detection and high accuracy.
Given the absence of a specialized dataset for marine engine simulators, this paper develops a dataset specifically for the simulator’s pipeline system. First, SVG images were converted into PNG format (as shown in Figure 1) and elements such as Up Arrow, Left Arrow, Down Arrow, Right Arrow, Node, Pipe, and Tank were annotated. Additionally, WPF control diagrams were hidden in the background and saved as PNG files (as shown in Figure 4) and elements like Valve, Up Pump, Down Pump, Left Pump, and Right Pump were annotated. These elements were randomly combined during annotation, using Labelme (5.3.1) for labeling.
Labelme, similar to LabelImg, provides a graphical user interface for annotation but offers more functionality, supporting various annotation shapes such as polygons, rectangles, circles, and polylines, making it ideal for tasks like semantic segmentation [25]. After normalizing the annotated JSON files and converting them to TXT format, the elements were trained using the YOLOv5X-Seg model. This model deepens and widens the network compared to others, enhancing AP accuracy and enabling the training of nonrectangular objects. The parameter settings used are shown in Figure 5.
Upon completing the training, the confidence–accuracy curve is shown in Figure 6. The pipeline recognition reached an accuracy of 0.964, while the control recognition achieved 0.93, indicating the program’s ability to efficiently recognize and locate components within the marine pipeline system.
For the converted SVG images, the positions of components such as Up Arrow, Left Arrow, Down Arrow, Right Arrow, Node, Pipe, and Tank were recognized, including co-ordinates for the top-left, bottom-left, top-right, bottom-right, and center points, which were saved to a specified CSV file. Similarly, for WPF control diagrams, the positions of components like Valve, Up Pump, Down Pump, Left Pump, and Right Pump were recognized with the same co-ordinates and automatically saved to a CSV file.
These steps ensure the efficient recognition and localization of all components in the marine pipeline system, providing accurate and complete data for further processing and analysis. This approach facilitates complex pipeline design and lays a strong foundation for optimizing data processing workflows and enhancing system efficiency.

3.3. Data Integration and Conversion

After filtering the data, we obtained two CSV files containing information about the positions of pipeline network elements and controls. We then performed the following conversion steps on these two files.
First, the labels obtained from object detection were not numbered, so we needed to number the targets. The numbering method was as follows: based on the co-ordinates of the center points, we numbered them first by the X-axis co-ordinates in ascending order. If the X-axis co-ordinates were the same, they were numbered by the Y-axis co-ordinates in ascending order. For the WPF control components, only the center point co-ordinates were retained, and other unnecessary co-ordinates were removed.
For the pipeline segments, in order to combine them into a complete pipeline network, we not only needed the co-ordinates for the top-left, top-right, bottom-left, bottom-right, and center points but also calculated and added the midpoints of the two shortest edges. These co-ordinates were saved in the last two columns of the file, named “nearest_midpoint” and “second_nearest_midpoint”, respectively. The “nearest_midpoint” column holds the point with the smaller X-axis value and, if the X-axis values were the same, the smaller Y-axis point was used.
After calculating the required co-ordinates, we combined all the recognized elements into a ship’s pipeline network and imported them into a C# program for computation. The first column of the network file is named “PipeID”, which contains the names of the pipeline segments, and only the segment numbers recognized from the SVG file need to be extracted, as the pipeline segments are the most important part of the network.
The second column of the network file is named “Name”, which contains the names of the control elements on the pipeline segments. When the program determines that a pipeline segment overlaps with a WPF control (by calculating the distance between the centerline formed by the midpoints of the two shortest edges of the pipeline segment and the center point of the control and, if it is less than 50, it is considered overlapping), the program fills the corresponding cell with the name of the control.
The third column of the network file is named “PipeDirection”, which contains the flow direction of the pipeline segment. The program determines this based on the type of overlapping arrow. If it is a Right Arrow or Down Arrow, the cell will contain “AB”. If it is a Left Arrow or Up Arrow, the cell will contain “BA”. If there is no arrow, “CC” is entered, indicating that the fluid can flow in both directions.
The fourth and fifth columns of the network file are named “PipeConnecterA” and “PipeConnecterB”, respectively, and they record the co-ordinates that overlap with the “nearest_midpoint” and “second_nearest_midpoint” columns (top-left and bottom-right co-ordinates) from the SVG result file. When the program determines that the “nearest_midpoint” of Pipe1 overlaps with the “second_nearest_midpoint” of Pipe2, it fills “2B” in Pipe1’s “PipeConnecterA” column and “1A” in Pipe2’s “PipeConnecterB” column. If multiple pipelines overlap, they are separated by commas.
The sixth and seventh columns of the network file are named “IsSource” and “IsTerminal”, respectively, and they record whether the pipeline segment is a source segment or a terminal segment. After determining the values in the third, fourth, and fifth columns, if the result in the third column is “AB” and there is no result in the fourth column (i.e., there is no pipeline segment connected in the “PipeConnecterA” column), the corresponding cell in the sixth column is filled with “TURE”, indicating that the segment is a source segment. Similarly, if the result in the third column is “BA” and there is no result in the fourth column (i.e., there is no pipeline segment connected in the “PipeConnecterB” column), the corresponding cell in the sixth column is filled with “TURE”, indicating that the segment is a source segment.
If the result in the third column is “AB” and there is no result in the fifth column (i.e., there is no pipeline segment connected in the “PipeConnecterB” column), the corresponding cell in the seventh column is filled with “TURE”, indicating that the segment is a terminal segment. Similarly, if the result in the third column is “BA” and there is no result in the fourth column (i.e., there is no pipeline segment connected in the “PipeConnecterA” column), the corresponding cell in the seventh column is filled with “TURE”, indicating that the segment is a terminal segment.
Through the above steps, we not only achieved effective data integration and conversion but also ensured the accuracy and completeness of the data, laying a solid foundation for the subsequent analysis and computation of the ship’s pipeline network.

3.4. Real-Time Data Calculation and Display

After data integration and conversion, calculations are performed within the C# program. During the program’s operation, when the user clicks a valve or pump, it changes to the color of the pipeline, indicating that it is open, and the signal is sent to the calculation program. Next, the program analyzes the pipeline network to determine which segments allow fluid flow. Using an iterative method, it reads and evaluates the control states on the segments. When the number of open controls on a segment matches the number of controls shown in the CSV file, the program determines that the segment is in a flow-allowed state. When all the segments from the source to the terminal are in a flow-allowed state, the pipeline containing those segments is considered to allow fluid flow.
Once the pipeline is confirmed to allow flow, the flow calculation and transmission process begins. The flow calculation proceeds as follows: based on the pump’s power and the pipeline flow direction from the CSV, the program requests flow from the source segment to the pump inlet. If the maximum upstream segment flow exceeds the pump’s rated flow, the system requests flow based on the pump’s rated flow. If the upstream segment’s maximum flow is below the pump’s rated flow, the system adjusts the request according to the segment’s flow limit.
The flow is temporarily stored at the upstream node of each pump and continuously requested from upstream nodes until it reaches the source. When multiple branches exist at an upstream node, the system applies an equal flow distribution strategy, requesting flow evenly from each branch. If the maximum flow limit of any branch is lower than the average, the system adjusts the request to that branch’s maximum flow and distributes the remaining flow to the other branches at the same level. When all branches reach their maximum flow limits, the system automatically adjusts the upstream node’s maximum flow setting to the sum of the flow limits of all branches.
Once flow is assigned to the source, it is distributed downstream to each branch node along the pipeline. Pump outlet handling follows a similar process, with the flow stored at the pump node being distributed downstream according to the maximum allowable value of the downstream segment. The flow is adjusted based on the principles of average distribution and maximum flow limits until it reaches the terminal.
This entire process ensures accurate and balanced flow distribution from the source to the terminal segments. Ultimately, all calculated and distributed flow values are displayed in the pipeline node processing flow, ensuring the intuitive and logical clarity of the pipeline network operations. The network processing flow is illustrated in Figure 7.

4. Model Operation Example

This paper takes the sewage system of a certain ship as an example. After the programmer displays the parameters such as pipelines, flow direction, nodes, and tanks from the drawings in an SVG format and positions the controls like the pumps, valves, flow labels “Gpipe”, and pressure labels “Ppipe” in the required places (as shown in Figure 8), the SVG images are then converted into PNG format. The WPF control image is also saved as a PNG after hiding the base map. These two images are then fed into YOLOv5 for recognition. The results are shown in Figure 9 and Figure 10, with the numbers indicating the confidence scores. From the results, it can be seen that most of the confidence scores are above 0.75, indicating that YOLOv5 can accurately recognize various pipeline elements and control components in the sewage system. YOLOv5 also identifies and saves the position parameters of the elements in the images to a designated CSV file, as shown in Table 1. After data integration and conversion, the data are fed into the pipeline network calculation program.
When the user enters the program, the interface is displayed as shown in Figure 7. Taking the “Clean Drain Tank” module as an example, when the user clicks on controls such as pumps and valves, the corresponding controls will change to the color of the pipeline to indicate they are open. Once the three valves and one pump on the left side are all opened, the C# calculation program will determine that the pipe segment is flowing. Since this pipe segment serves as both the source and terminal segment, the program will conclude that the pipeline is open. Then, the pre-entered flow and pressure values will be calculated and displayed on the corresponding labels. On the right side, where no pump is running, when the user opens the corresponding valve, since this pipeline has only one valve, the program will read the data stored in the valve and display it. In cases where there is a branch, the flow will be evenly distributed. Figure 11 shows the program display after the user has completed several steps.
From the figures above, it can be seen that the program can calculate parameters such as flow and pressure when there is no pump in the pipeline, as well as when there is a pump, with the inlet being the outlet of another pump. The results are displayed in specified locations, allowing the user to intuitively observe the real-time impact of operations on the entire pipeline network system.

5. Conclusions

This paper presents an innovative approach to visual modeling for ship piping systems, aimed at addressing the challenges faced by traditional programming methods when handling complex piping networks. The method combines SVG images with WPF controls, utilizes YOLOv5 for object detection, generates corresponding CSV files, and, finally, uses C# for real-time computation and data display. This process significantly enhances programming efficiency and reduces the potential for human error.
Firstly, the system provides an intuitive graphical interface, allowing users to complete complex piping designs through simple drag-and-drop operations, which greatly benefits nonprogrammers. Additionally, by customizing pipe attributes such as maximum flow rate and flow direction, the accuracy of the piping model is further improved. The use of SVG images ensures clarity across different display sizes, while the integration of YOLOv5 simplifies the object detection and data management process, ensuring the correct identification and positioning of each pipeline device.
In terms of data processing, a Python program filters and processes the data recognized by YOLOv5, ensuring data integrity and accuracy, ultimately generating CSV files suitable for real-time computation. This method visualizes the complex piping design process, making data processing more efficient while ensuring the reliability and safety of the design. The C# program processes these CSV files in real time, ensuring real-time display and updates of flow and pressure data within the piping system, providing users with immediate feedback.
In the future, this method is expected to be widely used in ship piping system design and education, playing a larger role in industry practices. It not only improves work efficiency but also enables nontechnical personnel to easily participate in the design and optimization of piping systems, promoting the shipbuilding industry toward greater intelligence and automation. Additionally, similar visual modeling approaches could be applied to the design and simulation of piping networks in aviation fuel, hydraulic, and air conditioning systems to optimize network layout and fluid flow.

Author Contributions

Conceptualization, X.W. and Z.H.; methodology, X.W. and Z.H.; software, X.W.; validation, X.W., Z.H., S.L. and Z.Y.; formal analysis, S.L. and Z.Y.; investigation, S.L.; resources, Z.H.; data curation, X.W. and Z.H.; writing—original draft preparation, X.W.; writing—review and editing, X.W.; visualization, X.W.; supervision, X.W.; project administration, X.W.; funding acquisition, Z.H. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Ministry of Industry and Information Technology Project: Innovation Project of the Offshore LNG Equipment Industry Chain: CBG3N21-2-7; High-technology Ship Research Program: CBG3N21-3-3; New technology equipment for rapid and green elimination of COVID-19 hydroxyl radicals in cold chain logistics: 62127806.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author. The data are not publicly available due to privacy.

Acknowledgments

The authors extend their appreciation to the anonymous reviewers for their valuable feedback.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

SVGScalable Vector Graphics
WPFWindows Presentation Foundation
YOLOv5You Only Look Once version 5
CSVComma-Separated Values
C#C Sharp
RBFradial basis function
MIMOmulti-input, multi-output
CNNConvolutional Neural Networks

References

  1. Sardar, A.; Garaniya, V.; Anantharaman, M.; Abbassi, R.; Khan, F. Comparison between simulation and conventional training: Expanding the concept of social fidelity. Process Saf. Prog. 2022, 41, S27–S38. [Google Scholar] [CrossRef]
  2. Chauvin, C. Human Factors and Maritime Safety. J. Navig. 2011, 64, 625–632. [Google Scholar] [CrossRef]
  3. Ceylan, B.O.; Karatuğ, Ç.; Arslanoğlu, Y. A novel methodology for the use of engine simulators as a tool in academic studies. J. Mar. Sci. Technol. 2022, 27, 1220–1232. [Google Scholar] [CrossRef]
  4. Hanzu-Pazara, R.; Barsan, E.; Arsenie, P.; Chiotoroiu, L.; Raicu, G. Reducing of maritime accidents caused by human factors using simulators in training process. J. Mar. Res. 2018, 5, 3–18. [Google Scholar]
  5. Hontvedt, M.; Arnseth, H.C. On the bridge to learn: Analysing the social organization of nautical instruction in a ship simulator. Int. J. Comput.-Support. Collab. Learn. 2013, 8, 89–112. [Google Scholar] [CrossRef]
  6. Liu, D.; Yu, J.; Macchiarella, N.D.; Vincenzi, D.A. Simulation fidelity. In Human Factors in Simulation and Training; CRC Press: Boca Raton, FL, USA, 2008; pp. 91–108. [Google Scholar]
  7. Cwilewicz, R.; Tomczak, L. Improvement of ship operational safety as a result of the application of virtual reality engine room simulators. WIT Trans. Inf. Commun. Technol. 2008, 39, 535–544. [Google Scholar]
  8. Shen, H.; Zhang, J.; Zeng, H.; Feng, J. Development of a virtual training system for marine engineers. In Proceedings of the 2015 4th International Conference on Computer Science and Network Technology (ICCSNT), Harbin, China, 19–20 December 2015; pp. 28–32. [Google Scholar]
  9. Zeng, H.; Zhang, J.D.; Yao, W.L.; Zhang, X.J. CAVE Based Visual System Design and Implementation in Marine Engine Room Simulation. In The 19th International Conference on Industrial Engineering and Engineering Management; Qi, E., Shen, J., Dou, R., Eds.; Springer: Berlin/Heidelberg, Germany, 2013. [Google Scholar]
  10. Crawford, J. Marine and Offshore Pumping and Piping Systems; Elsevier: Amsterdam, The Netherlands, 2016. [Google Scholar]
  11. Nikitakos, N.; Sirris, I.; Dalaklis, D.; Papachristos, D.; Tsoukalas, V.D. Game-based learning for maritime education and training: The case of Trader of the World. WMU J. Marit. Aff. 2017, 16, 265–291. [Google Scholar] [CrossRef]
  12. Hjelmervik, K.; Nazir, S.; Myhrvold, A. Simulator training for maritime complex tasks: An experimental study. WMU J. Marit. Aff. 2018, 17, 17–30. [Google Scholar] [CrossRef]
  13. Karpenko, M. Landing gear failures connected with high-pressure hoses and analysis of trends in aircraft technical problems. Aviation 2022, 26, 145–152. [Google Scholar] [CrossRef]
  14. Urbanowicz, K.; Bergant, A.; Stosiak, M.; Karpenko, M.; Bogdevičius, M. Developments in analytical wall shear stress modelling for water hammer phenomena. J. Sound Vib. 2023, 562, 117848. [Google Scholar]
  15. Shi, W.; Yang, J.; Tang, T. RBF NN based marine diesel engine generator modeling. In Proceedings of the 2005, American Control Conference, Portland, OR, USA, 8–10 June 2005; Volume 4, pp. 2745–2749. [Google Scholar]
  16. Kim, I.; Cho, G.; Hwang, J.; Li, J.; Han, S. Visualization of neutral model of ship pipe system using X3D. In Cooperative Design, Visualization, and Engineering: 7th International Conference, CDVE 2010, Calvia, Mallorca, Spain, 19–22 September 2010. Proceedings; Springer: Berlin/Heidelberg, Germany, 2010; pp. 218–228. [Google Scholar]
  17. Zou, C.; Sun, J. Modeling and Simulation of Ship Fuel Supply Unit. In Proceedings of the 2015 7th International Conference on Intelligent Human-Machine Systems and Cybernetics, Hangzhou, China, 26–27 August 2015; Volume 1, pp. 199–202. [Google Scholar]
  18. Wang, Z.; Jin, L.; Wang, S.; Xu, H. Apple stem/calyx real-time recognition using YOLO-v5 algorithm for fruit automatic loading system. Postharvest Biol. Technol. 2022, 185, 111808. [Google Scholar] [CrossRef]
  19. Schenk, T.; Gilg, A.B.; Mühlbauer, M.; Rosen, R.; Wehrstedt, J.C. Architecture for modeling and simulation of technical systems along their lifecycle. Comput. Visual Sci. 2015, 17, 167–183. [Google Scholar] [CrossRef]
  20. Goh, D.; Wang, J. Designing a virtual exhibition using Scalable Vector Graphics. Aslib Proc. 2004, 56, 144–155. [Google Scholar]
  21. Kozminski, A. Windows Presentation Foundation (WPF) technology meets the challenges of operator interface design in automatic test systems. In Proceedings of the 2012 IEEE AUTOTESTCON Proceedings, Anaheim, CA, USA, 10–13 September 2012; pp. 80–83. [Google Scholar]
  22. Wang, J.; Chen, Y.; Dong, Z.; Gao, M. Improved YOLOv5 network for real-time multi-scale traffic sign detection. Neural Comput. Appl. 2023, 35, 7853–7865. [Google Scholar]
  23. Liu, Y.; Lu, B.; Peng, J.; Zhang, Z. Research on the use of YOLOv5 object detection algorithm in mask wearing recognition. World Sci. Res. J. 2020, 6, 276–284. [Google Scholar]
  24. Shakhov, A.; Kupraty, O. Basic project of autonomous main engine control and it implementation in C# (C sharp) environment. In Proceedings of the 2021 IEEE 16th International Conference on Computer Sciences and Information Technologies (CSIT), Lviv, Ukraine, 22–25 September 2021; pp. 319–322. [Google Scholar]
  25. Torralba, A.; Russell, B.C.; Yuen, J. Labelme: Online image annotation and applications. Proc. IEEE 2010, 98, 1467–1484. [Google Scholar] [CrossRef]
Figure 1. Visualization of the piping network.
Figure 1. Visualization of the piping network.
Applsci 14 09194 g001
Figure 2. WPF control placement interface.
Figure 2. WPF control placement interface.
Applsci 14 09194 g002
Figure 3. Shapes of different valve types.
Figure 3. Shapes of different valve types.
Applsci 14 09194 g003
Figure 4. Illustration of the control recognition before saving.
Figure 4. Illustration of the control recognition before saving.
Applsci 14 09194 g004
Figure 5. Parameter settings for training.
Figure 5. Parameter settings for training.
Applsci 14 09194 g005
Figure 6. Confidence–accuracy curve of the training results.
Figure 6. Confidence–accuracy curve of the training results.
Applsci 14 09194 g006
Figure 7. Pipeline node processing flow.
Figure 7. Pipeline node processing flow.
Applsci 14 09194 g007
Figure 8. Programmer’s design drawing.
Figure 8. Programmer’s design drawing.
Applsci 14 09194 g008
Figure 9. YOLOv5 recognition of pipeline network.
Figure 9. YOLOv5 recognition of pipeline network.
Applsci 14 09194 g009
Figure 10. YOLOv5 recognition of WPF controls.
Figure 10. YOLOv5 recognition of WPF controls.
Applsci 14 09194 g010
Figure 11. Pipeline network display during program operation.
Figure 11. Pipeline network display during program operation.
Applsci 14 09194 g011
Table 1. CSV generated after detection and processing.
Table 1. CSV generated after detection and processing.
PipeIDNamePipeDirectionPipeConnecterAPipeConnecterBIsSourceIsTerminal
1LineValve7BA9A TUREFALSE
2LineValve1, LineValve2, LineValve3, LinePump1BA TURETURE
3LineValve4BA8A TUREFALSE
4 BA6A5A, 7AFALSEFALSE
5LineValve5BA4B, 7A TUREFALSE
6 AB4A FALSETURE
7 AB4B, 5A FALSETURE
8 AB3A FALSEFALSE
9LineValve7AB1A15B, 16AFALSEFALSE
10LineValve6BA8B, 11A TUREFALSE
11 AB8B, 10A16B, 17AFALSETURE
12LineValve8BA 14A, 18ATUREFALSE
13LineValve9AB 14B15AFALSEFALSE
14LinePump2VBA12B, 18A13B, 15AFALSEFALSE
15 BA13B, 14B9B, 16AFALSEFALSE
16LineValve10BA9B, 15B11B, 17A, 19AFALSEFALSE
17LineValve11BA11B, 16B, 19A FALSEFALSE
18LineValve12AB12B, 14A FALSETURE
19 CC11B, 16B, 17A22A, 23AFALSEFALSE
20LineValve14BA 24A, 28AFALSETURE
21LineValve15BA 24B, 29AFALSETURE
22LineValve13BA19B, 23A TUREFALSE
23 CC19B, 22A27BFALSEFALSE
24 BA20B, 28A21B, 25A, 29AFALSEFALSE
25 BA21B, 24B, 29A26A, 33AFALSEFALSE
26LineValve16, LinePump3BA25B, 33A27A, 30AFALSEFALSE
27LineValve17BA26B, 30A23B, 31AFALSEFALSE
28LineValve18AB24A FALSETURE
29LineValve19AB21B, 24B, 29A FALSETURE
30LineValve20BA26B, 27A TUREFALSE
31 CC23B, 27B32A, 34AFALSEFALSE
32LineValve21BA31B, 34A TUREFALSE
33 CC25B, 26A40B, 41AFALSEFALSE
34 CC31B, 32A35A, 36AFALSEFALSE
35LineValve22BA34B, 36A TUREFALSE
36 CC34B, 35A42B, 46AFALSEFALSE
37LineValve23BA 39A, 43AFALSETURE
38LineValve24BA 39B, 40A, 44AFALSETURE
39 BA37B, 43A38B, 40A, 44AFALSEFALSE
40 BA38B, 39B, 44A33B, 41AFALSEFALSE
41LineValve25, LinePump4BA33B, 40B42A, 47AFALSEFALSE
42LineValve26BA41B, 47A36B, 45AFALSEFALSE
43LineValve27AB37B, 39A FALSETURE
44LineValve28AB38B, 39B, 40A FALSETURE
45 BA36B, 42A46A, 48A
46LineValve30BA45B, 48A TUREFALSE
47LineValve29BA41B, 42A FALSEFALSE
48 BA45B, 46A49B, 50AFALSEFALSE
49LineValve31AB 48B, 50ATUREFALSE
50LineValve32BA48B, 49B TUREFALSE
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wu, X.; He, Z.; Liu, S.; Yu, Z. Visual Modeling Method for Ship Piping Network Programs in Engine Simulators. Appl. Sci. 2024, 14, 9194. https://doi.org/10.3390/app14209194

AMA Style

Wu X, He Z, Liu S, Yu Z. Visual Modeling Method for Ship Piping Network Programs in Engine Simulators. Applied Sciences. 2024; 14(20):9194. https://doi.org/10.3390/app14209194

Chicago/Turabian Style

Wu, Xiaoyu, Zhibin He, Shufeng Liu, and Zhongkai Yu. 2024. "Visual Modeling Method for Ship Piping Network Programs in Engine Simulators" Applied Sciences 14, no. 20: 9194. https://doi.org/10.3390/app14209194

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Article metric data becomes available approximately 24 hours after publication online.
Back to TopTop