Method for simulating liquid flow of energy storage fire hose in computer graphics

By calculating the liquid flow range based on the three-dimensional pipe boundary dimensions and determining the fragment orientation, the problems of visual distortion and high computational cost in traditional methods are solved, and accurate simulation and efficient rendering of liquid flow in fire water pipes are achieved.

CN121723677APending Publication Date: 2026-03-24NANTONG ALPHA ESS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511897542.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Traditional computer graphics methods struggle to accurately match the actual spatial morphology of complex 3D pipes when simulating liquid flow in fire hydrants, resulting in visual distortion and enormous computational overhead, making it difficult to meet the frame rate and interactivity requirements of real-time visualization applications.

Method used

The liquid flow range is calculated based on the three-dimensional pipe boundary dimensions. Combined with whether the fragment is facing the camera, the fragment is directly assigned color to simulate the occlusion relationship between the liquid and the pipe surface. The color assignment process is executed in parallel by a graphics processor.

Benefits of technology

It achieves accurate simulation of the real spatial morphology of pipelines, improves the reliability of simulation and control of flow effects, reduces computational load, and supports forward and reverse flow simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121723677A_ABST
    Figure CN121723677A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of computer graphics, and provides an energy storage fire hose liquid flow simulation method in computer graphics, comprising the following steps: determining a boundary center based on a boundary size of a three-dimensional pipeline to be rendered, and calculating a starting point of liquid flow according to a preset flow direction; calculating the space length of the three-dimensional pipeline; according to the preset liquid filling percentage, the length of the pipeline needing to be filled currently is calculated; for each fragment in the three-dimensional rendering pipeline, calculating the spatial distance from the three-dimensional position of the fragment to the starting point; whether the spatial distance is smaller than or equal to the length of the pipeline needing to be filled or not is judged, if yes, the piece element is marked as a liquid area piece element, and if not, the piece element is marked as a non-liquid area piece element; judging whether each fragment faces the virtual camera or not; and endowing each fragment with a corresponding color value according to the mark and the judgment result of the orientation of the virtual camera. According to the invention, accurate reflection of the real spatial form of the pipeline is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer graphics technology, specifically to a method for simulating liquid flow in energy storage fire-fighting water pipes in computer graphics. Background Technology

[0002] In the field of fire protection engineering visualization simulation, real-time and realistic 3D simulation of liquid flow within pipes (such as fire hoses) is a crucial requirement. Traditional computer graphics methods typically employ UV coordinate-based texture flow mapping or discrete particle system simulation to simulate such dynamic fluid effects. UV coordinate-based texture flow mapping simulates flow by setting texture coordinates on the surface of the pipe model and shifting the texture over time. However, this method has significant drawbacks: its flow effect heavily relies on the quality of the model's UV unwrapping, making it difficult to accurately match the actual spatial morphology of complex 3D pipes. This results in a discrepancy between the dynamic filling effect and the real fluid motion, leading to noticeable visual distortion. Furthermore, the textures used in this method are often fixed and rigid, making it impossible to flexibly control the start, stop, direction, and filling ratio of the flow. Discrete particle system simulation uses a large number of particles to represent fluid, achieving good dynamic effects, but requires extremely high computational resources to simulate particle movement, collisions, and rendering. When simulating long-distance pipe filling, maintaining the state of a massive number of particles results in enormous computational overhead, making it difficult to meet the frame rate and interactivity requirements of real-time visualization applications (such as monitoring systems and simulation training). Therefore, there is a need to provide a method for simulating liquid flow in energy storage fire-fighting water pipes using computer graphics, aiming to solve the above problems. Summary of the Invention

[0003] In view of the shortcomings of the existing technology, the purpose of this invention is to provide a method for simulating liquid flow in energy storage fire-fighting water pipes in computer graphics, so as to solve the problems existing in the above-mentioned background technology.

[0004] This invention is implemented as follows: a method for simulating liquid flow in energy storage fire-fighting water pipes in computer graphics, the method comprising the following steps: Based on the boundary dimensions of the 3D pipe to be rendered, the boundary center is determined, and the starting point of the liquid flow is calculated according to the preset flow direction. Calculate the spatial length of the three-dimensional pipe based on the boundary dimensions; Calculate the current required pipe length based on the preset liquid filling percentage and the space length; For each fragment in the 3D rendering pipeline, calculate the spatial distance from the fragment's 3D position to the starting point; Determine whether the spatial distance is less than or equal to the length of the pipe to be filled. If so, mark the fragment as a liquid region fragment; otherwise, mark it as a non-liquid region fragment. Determine whether each fragment is facing the virtual camera; Based on the liquid / non-liquid area markings and the determination of orientation towards the virtual camera, each fragment is assigned a corresponding color value. Fragments marked as liquid areas and facing the virtual camera are assigned the liquid color, otherwise they are assigned the pipe surface color.

[0005] As a further aspect of the present invention, the step of calculating the starting point of liquid flow specifically includes: calculating the boundary center bCenter of the pipe based on the boundary dimensions; when the flow direction is positive, the starting point startPos = boundsCenter - bCenter; when the flow direction is negative, the starting point startPos = boundsCenter + bCenter; wherein, boundsCenter is the coordinate of the center point of the bounding box of the three-dimensional pipe.

[0006] As a further aspect of the present invention, when calculating the spatial length of a three-dimensional pipe, the components x, y, and z of the boundary size boundsSize are summed by adding the squares of the maximum values ​​of x and y to the squares of the minimum values ​​of x and y and the maximum value of z, and then taking the square root to obtain the pipe length boundsLength.

[0007] As a further aspect of the present invention, the formula for calculating the required pipe length boundsFillLength is: boundsFillLength=(fill / 100)×boundsLength, where fill is a preset liquid filling percentage.

[0008] As a further aspect of the present invention, the formula for calculating the spatial distance is: distance = Where position represents the 3D world coordinates of the current fragment. These are the coordinates of the starting point.

[0009] As a further aspect of the present invention, the method for determining whether a fragment is facing the virtual camera is as follows: obtaining the projection vertices v0, v1, and v2 of the corresponding primitive in screen space; calculating the cross product cross = If cross>0, then the fragment is determined to be facing the virtual camera; otherwise, it is determined not to be facing the virtual camera.

[0010] As a further aspect of the present invention, the process of assigning a corresponding color value to each fragment is performed in parallel within the fragment shader of the graphics processor.

[0011] Compared with the prior art, the beneficial effects of the present invention are: By directly calculating the filling range based on the 3D boundary dimensions of the pipe, an accurate reflection of the pipe's true spatial morphology is achieved. This method fundamentally avoids the geometric distortion problem caused by 2D projection in traditional UV mapping methods, ensuring that the liquid front's advancement strictly conforms to the pipe's 3D orientation. By introducing a judgment on whether a fragment is facing the camera, and distinguishing between the pipe surface color and the liquid color accordingly, the occlusion relationship between the pipe wall and the internal liquid is effectively simulated, improving the overall simulation's reliability. The filling progress and flow direction of the liquid can be intuitively controlled through parameters, supporting both forward and reverse flow simulations, eliminating the dependence on fixed textures. Attached Figure Description

[0012] Figure 1 This is a flowchart of a method for simulating liquid flow in energy storage fire-fighting water pipes using computer graphics.

[0013] Figure 2 This is a flowchart illustrating the calculation of the starting point in a computer graphics method for simulating liquid flow in energy storage fire-fighting water pipes.

[0014] Figure 3 This is a flowchart for determining whether a pixel is facing a virtual camera in a method for simulating the flow of liquid in an energy storage fire-fighting water pipe in computer graphics. Detailed Implementation

[0015] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0016] The specific implementation of the present invention will be described in detail below with reference to specific embodiments.

[0017] like Figure 1 As shown, this embodiment of the invention provides a method for simulating liquid flow in energy storage fire-fighting water pipes in computer graphics. The method includes the following steps: S100: Based on the boundary dimensions of the 3D pipe to be rendered, determine the boundary center and calculate the starting point of the liquid flow according to the preset flow direction. S200, Calculate the spatial length of the three-dimensional pipe based on the boundary dimensions; S300, calculate the length of the pipe that needs to be filled based on the preset liquid filling percentage and the length of the space; S400, for each fragment in the 3D rendering pipeline, calculate the spatial distance from the 3D position of the fragment to the starting point; S500, determine whether the spatial distance is less than or equal to the length of the pipe to be filled. If so, mark the fragment as a liquid region fragment; otherwise, mark it as a non-liquid region fragment. S600 determines whether each pixel is facing the virtual camera; S700, based on the liquid / non-liquid area markings and the determination result of the orientation towards the virtual camera, assign a corresponding color value to each fragment, wherein fragments marked as liquid areas and facing the virtual camera are assigned the liquid color, otherwise they are assigned the pipe surface color.

[0018] To facilitate understanding of the technical solution, the following terms will be explained uniformly: isFrontFace: Whether the current fragment is facing the camera; position: Current vertex position; liquidColor: Liquid color; surfaceColor: Surface color; fill: Fill percentage; boundsSize: Boundary size; boundsCenter: Coordinates of the bounding box center point; direction: Fill direction; return: Final color of the fragment.

[0019] like Figure 2 As shown in this embodiment of the invention, because there are forward and reverse flows, a direction is used to control the direction. Since the directions differ, the starting point of the flow also differs. The step of calculating the starting point of the liquid flow specifically includes: calculating the boundary center bCenter of the pipe based on the boundary dimensions. ; When the flow direction is positive, the starting point startPos = boundsCenter - bCenter: ; When the flow direction is reversed, the starting point startPos = boundsCenter + bCenter: ; Where boundsCenter represents the coordinates of the center point of the bounding box of the three-dimensional pipeline.

[0020] In this embodiment of the invention, when calculating the spatial length of the pipe, the components x, y, and z of the boundary size boundsSize are taken as follows: the square of the maximum value of x and y is added to the square of the minimum value of x and y and the maximum value of z, and then the square root is taken to obtain the pipe length boundsLength = .

[0021] In this embodiment of the invention, the formula for calculating the length of the pipe to be filled, boundsFillLength, is: boundsFillLength=(fill / 100)×boundsLength, where fill is a preset liquid filling percentage.

[0022] In this embodiment of the invention, the formula for calculating the spatial distance is: distance = Where position represents the 3D world coordinates of the current fragment. These are the coordinates of the starting point.

[0023] like Figure 3 As shown, in this embodiment of the invention, the method for determining whether a fragment is facing the virtual camera is as follows: obtain the projection vertices v0, v1, and v2 of the corresponding primitive in the screen space; calculate the cross product cross = If cross>0, then the fragment is determined to be facing the virtual camera; otherwise, it is determined not to be facing the virtual camera.

[0024] In this embodiment of the invention, assigning a corresponding color value to each fragment is performed in parallel within the fragment shader of the graphics processor.

[0025] The above description only details the preferred embodiments of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

[0026] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.

[0027] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0028] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the disclosure in the specification and embodiments. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

Claims

1. A method for simulating liquid flow in energy storage fire-fighting water pipes using computer graphics, characterized in that, The method includes the following steps: Based on the boundary dimensions of the 3D pipe to be rendered, the boundary center is determined, and the starting point of the liquid flow is calculated according to the preset flow direction. Calculate the spatial length of the three-dimensional pipe based on the boundary dimensions; Calculate the current required pipe length based on the preset liquid filling percentage and the space length; For each fragment in the 3D rendering pipeline, calculate the spatial distance from the fragment's 3D position to the starting point; Determine whether the spatial distance is less than or equal to the length of the pipe to be filled. If so, mark the fragment as a liquid region fragment; otherwise, mark it as a non-liquid region fragment. Determine whether each fragment is facing the virtual camera; Based on the liquid / non-liquid area markings and the determination of orientation towards the virtual camera, each fragment is assigned a corresponding color value. Fragments marked as liquid areas and facing the virtual camera are assigned the liquid color, otherwise they are assigned the pipe surface color.

2. The method for simulating liquid flow in energy storage fire-fighting water pipes in computer graphics according to claim 1, characterized in that, The step of calculating the starting point of liquid flow specifically includes: calculating the boundary center bCenter of the pipe based on the boundary dimensions; when the flow direction is positive, the starting point startPos = boundsCenter - bCenter; when the flow direction is negative, the starting point startPos = boundsCenter + bCenter; where boundsCenter is the coordinate of the center point of the bounding box of the three-dimensional pipe.

3. The method for simulating liquid flow in energy storage fire-fighting water pipes in computer graphics according to claim 1, characterized in that, When calculating the spatial length of a three-dimensional pipe, take the components x, y, and z of the boundary size boundsSize, add the sum of the squares of the maximum values ​​of x and y to the sum of the squares of the minimum values ​​of x and y and the maximum value of z, and then take the square root to obtain the pipe length boundsLength.

4. The method for simulating liquid flow in energy storage fire-fighting water pipes in computer graphics according to claim 3, characterized in that, The formula for calculating the required pipe length boundsFillLength is: boundsFillLength=(fill / 100)×boundsLength, where fill is the preset liquid filling percentage.

5. The method for simulating liquid flow in energy storage fire-fighting water pipes in computer graphics according to claim 1, characterized in that, The formula for calculating the spatial distance is: distance = Where position represents the 3D world coordinates of the current fragment. These are the coordinates of the starting point.

6. The method for simulating liquid flow in energy storage fire-fighting water pipes in computer graphics according to claim 1, characterized in that, The method to determine whether a fragment is facing the virtual camera is to obtain the projection vertices v0, v1, and v2 of the corresponding primitive in screen space. Calculate the cross product cross= If cross>0, then the fragment is determined to be facing the virtual camera; otherwise, it is determined not to be facing the virtual camera.

7. The method for simulating liquid flow in energy storage fire-fighting water pipes in computer graphics according to claim 1, characterized in that, Assigning a corresponding color value to each fragment is performed in parallel within the fragment shader of the graphics processor.