Streamline generation method and device, electronic equipment and storage medium

By iteratively computing the moving data of seed points during the streamline generation process, particle tracking calculation is reduced, the problem of low streamline generation efficiency is solved, and the computing efficiency and user experience are improved.

CN119089757APending Publication Date: 2024-12-06SHENZHEN YUNBO SOFTWARE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411073816.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In the prior art, long-term particle tracking and large-scale integral calculations are required during the streamline generation process, resulting in long calculation time, low efficiency and poor user experience.

Method used

By obtaining the seed point data source and inputting it into the preset fluid domain, traversing the seed point, calculating the initial data, and iterating the moving data of each step until the movement terminates, gathering the data to generate streamlines, reducing particle tracking calculations.

Benefits of technology

Reduces the calculation time during the streamline generation process, and improves the efficiency and user experience of streamline generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119089757A_ABST
    Figure CN119089757A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of computer technology simulation, and discloses a streamline generation method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a seed point data source, and inputting the seed point data source into a preset fluid domain; traversing seed points in the seed point data source, and calculating initial data of each seed point in the fluid domain; iteratively calculating the movement data corresponding to each step of movement of each seed point in the fluid domain until each seed point stops moving in the fluid domain; and aggregating the initial data and the movement data of each seed point in the fluid domain to obtain streamline data corresponding to each seed point, and outputting the streamline data. According to the method, a large amount of particle tracking calculation is not needed, so that the calculation time in the streamline generation process is shortened, and the streamline generation efficiency and the user experience are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology simulation, and in particular, relates to a method, device, electronic device and storage medium for streamlining generation. Background Art

[0002] Streamlines can effectively represent important features of flow fields in a sparse manner. At present, there are two main ways to construct streamlines: one is a streamline generation algorithm based on numerical integration, and the other is a streamline generation algorithm based on stream functions. Streamline construction based on numerical integration calculations is simple in calculation and conforms to the discrete idea in fluid calculations. However, since streamlines require a long-term particle tracking process and a large number of integral calculations, there are problems of large amount of calculation and low efficiency.

[0003] Therefore, how to solve the problem of long calculation time and low streamline generation efficiency caused by the need for long-term particle tracking and a large number of integral calculations in the existing technology, which further leads to poor user experience, is an important issue in current research. Summary of the invention

[0004] The main technical problem solved by the present invention is to provide a method, device, electronic device and storage medium for streamline generation, so as to solve the problem of long calculation time and low efficiency caused by the need for long-term particle tracking and a large number of integral calculations in the process of streamline generation in the prior art.

[0005] In order to solve the above technical problems, a technical solution adopted by the present invention is to provide a method, device, electronic device and storage medium for streamline generation, wherein the method for streamline generation includes the steps of: obtaining a seed point data source and inputting it into a preset fluid domain; wherein the seed point data source contains multiple seed points; traversing the seed points in the seed point data source, and calculating the initial data of various sub-points in the fluid domain; iteratively calculating the movement data corresponding to each step of movement of various sub-points in the fluid domain until the movement of various sub-points in the fluid domain is terminated; aggregating the initial data and the movement data of various sub-points moving through the fluid domain, obtaining the streamline data corresponding to various sub-points and outputting them.

[0006] The traversing of the seed points in the seed point data source and calculating the initial data of various sub-points in the fluid domain also includes: traversing the initial positions of various sub-points in the seed point data source; searching for the grid unit corresponding to the initial position in the input interface; obtaining the preset velocity vector of the grid unit according to the number of the grid unit; and calculating the initial moving velocity vector of various sub-points in the input interface according to the preset velocity vector of the grid unit, wherein the initial data includes the coordinate value of the initial position and the initial moving velocity vector.

[0007] The iterative calculation of the movement data corresponding to each step of movement of various sub-points in the fluid domain also includes the steps of: moving various sub-points from the current position to a first preset position, searching for the velocity vector preset for the grid unit corresponding to the first preset position in the fluid domain; calculating the movement velocity vector corresponding to the first preset position according to the velocity vector preset for the grid unit corresponding to the first preset position, the movement data including the coordinate value of the first preset position and the corresponding movement velocity vector; and moving to a second preset position according to the movement velocity vector corresponding to the first preset position.

[0008] Before moving to the second preset position according to the moving speed vector corresponding to the first preset position, the step also includes: judging whether the moving speed vector corresponding to the current position meets the set conditions; if the moving speed vector corresponding to the current position does not meet the set conditions, withdrawing the seed point to the third preset position, adjusting the moving speed vector corresponding to the third preset position and moving again; if the moving speed vector corresponding to the current position meets the set conditions, moving to the first preset position according to the moving speed vector corresponding to the current position.

[0009] The setting condition includes a first setting condition and a second setting condition. The first setting condition is: judging that the movement coefficient corresponding to the current position is greater than or equal to a first preset threshold, that is, S div ≥S max , where S div represents the mobility coefficient, S max represents the first preset threshold; the second setting condition is to limit the moving speed vector corresponding to the current position, that is:

[0010]

[0011] Where i represents the number of the seed point. Indicates that the coordinate value of the seed point at the first preset position is p i 'hour

[0012] The iterative calculation of the movement data corresponding to each step of movement of various sub-points in the fluid domain until the movement of various sub-points in the fluid domain is terminated includes the steps of: judging whether the current position of various sub-points exceeds the boundary range of the fluid domain; if it exceeds the boundary range of the fluid domain, terminating the movement of the seed points that exceed the boundary range; if it does not exceed the boundary range of the fluid domain, continuing to move the position of the seed points step by step.

[0013] If the boundary range of the fluid domain is not exceeded, the position of the seed point continues to be moved step by step, including the steps of: moving the seed point forward from the current position along the streamline integration direction to a fourth preset position, and searching whether there is a grid unit corresponding to the fourth preset position; if so, calculating the moving speed vector corresponding to the fourth preset position according to the speed vector preset for the grid unit corresponding to the fourth preset position, and moving to the fifth preset position according to the moving speed vector corresponding to the fourth preset position; if not, withdrawing the seed point from the fourth preset position to the current position, and then moving backward along the streamline integration direction to the sixth preset position, searching for the grid unit corresponding to the sixth preset position, and if found, calculating the moving speed vector corresponding to the sixth preset position according to the speed vector preset for the grid unit corresponding to the sixth preset position, and moving to the seventh preset position according to the moving speed vector corresponding to the sixth preset position; if not found, the movement of the seed point is terminated.

[0014] In order to solve the above technical problems, the present application also provides a device for streamline generation, including: an input module, used to obtain a seed point data source and input it into a preset fluid domain; wherein the seed point data source contains multiple seed points. An initial calculation module, used to traverse the seed points in the seed point data source, and calculate the initial data of various sub-points in the fluid domain. A movement calculation module, used to iteratively calculate the movement data corresponding to each step of movement of various sub-points in the fluid domain until the movement of various sub-points in the fluid domain is terminated. An aggregation output module, used to aggregate the initial data and movement data of various sub-points moving in the fluid domain, obtain the streamline data corresponding to various sub-points and output them.

[0015] To solve the above technical problems, the present application also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, any one of the above methods for streamline generation is implemented.

[0016] In order to solve the above technical problems, the present application also provides a computer-readable storage medium on which program instructions are stored, and the program instructions are used to implement any one of the above methods for streamline generation.

[0017] Beneficial effects: The present application discloses a method, device, electronic device and storage medium for streamline generation, the method comprising the steps of: obtaining a seed point data source and inputting it into a preset fluid domain; wherein the seed point data source includes multiple seed points; traversing the seed points in the seed point data source, calculating the initial data of various sub-points in the fluid domain; iteratively calculating the movement data corresponding to each step of movement of various sub-points in the fluid domain until the movement of various sub-points in the fluid domain is terminated; gathering the initial data and movement data of various sub-points moving in the fluid domain, obtaining and outputting the streamline data corresponding to various sub-points. The method of the present application generates streamlines by iteratively calculating the movement data corresponding to each step of movement of various sub-points in the fluid domain, and finally outputting the initial data and movement data of various sub-points moving in the fluid domain. Since a large amount of particle tracking calculation is not required, the calculation time in the streamline generation process is reduced, the efficiency of streamline generation and the user experience are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of the structure of a fluid domain and a seed point of an embodiment of the present application is given;

[0019] Figure 2 A flow chart of an embodiment of a method for streamlining generation of the present application is provided;

[0020] Figure 3 A flowchart of an embodiment of calculating initial data of various sub-points in a fluid domain in the method for streamlining generation of the present application is provided;

[0021] Figure 4 A schematic diagram of an embodiment of randomly setting various sub-points on an input interface in the method for streamline generation of the present application is provided;

[0022] Figure 5 A schematic diagram of a first embodiment of a grid unit and a number in a method for generating streamlines in the present application is provided;

[0023] Figure 6 A schematic diagram of an embodiment of moving a seed point in a grid unit in the method for generating streamlines in the present application is provided;

[0024] Figure 7 A schematic diagram of an embodiment of a streamline generation process in which a seed point exceeds a fluid domain boundary according to the streamline generation method of the present application is provided;

[0025] Figure 8 A schematic diagram of an embodiment of a streamline finally generated according to the method for streamline generation of the present application is provided;

[0026] Fig. 9 A schematic diagram of a framework of an embodiment of a device for streamlining generation of the present application is provided;

[0027] Fig.10 A schematic diagram of the framework of an electronic device of the present application is provided;

[0028] Fig.11 A schematic diagram of a computer-readable storage medium according to an embodiment of the present application is provided. DETAILED DESCRIPTION

[0029] In order to facilitate the understanding of the present invention, the present invention is described in more detail below in conjunction with the accompanying drawings and specific embodiments. Preferred embodiments of the present invention are provided in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described in this specification. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.

[0030] It should be noted that, unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used in this specification includes any and all combinations of one or more related listed items.

[0031] It should be noted that the "streamline" referred to in this application refers to a curve that is tangent to the velocity vector at every point in the fluid domain, which gives the velocity direction of the seed point at different times; the "fluid domain" refers to the space occupied by the seed point during the movement; the "seed point" refers to the marking point used to simulate the motion of the fluid; and the "fluid" refers to substances that can flow, including liquids and gases.

[0032] Exemplary, combined Figure 1 The fluid domain 2 is a rectangular parallelepiped, but is not limited to this shape. It is only for illustration purposes and can also be any other polyhedron. Figure 1 The fluid domain 2 in includes 6 boundary surfaces, and any boundary surface can be selected as the input interface of the fluid domain 2. Figure 1 The leftmost side of the fluid domain 2 is used as the input interface 1 of the fluid domain 2, and the initial positions of various sub-points 3 on the input interface can also be set according to simulation models of different scenarios.

[0033] Figure 2 A flow chart of an embodiment of a method for streamlining generation of the present application is given. Figure 1 and Figure 2 , the method of the present application comprises the steps of:

[0034] Step S1, obtaining a seed point data source, and inputting it into a preset fluid domain 2; wherein the seed point data source includes a plurality of seed points.

[0035] Step S2, traversing the seed points 3 in the seed point data source, and calculating the initial data of various sub-points 3 in the fluid domain 2.

[0036] Step S3, iteratively calculating the movement data corresponding to each step of movement of various sub-points 3 in the fluid domain 2, until the movement of various sub-points 3 in the fluid domain 2 is terminated.

[0037] Step S4, gathering the initial data and movement data of various sub-points 3 moving in the fluid domain, obtaining and outputting the streamline data corresponding to the various sub-points 3.

[0038] The method of the present application generates streamlines by iteratively calculating the movement data corresponding to each step of movement of various sub-points in the fluid domain, and finally outputting the initial data and movement data of various sub-points moving in the fluid domain, without requiring a large amount of particle tracking calculations. Therefore, the method of the present application can reduce the calculation time in the process of streamline generation, improve the efficiency of streamline generation, and enhance the user experience.

[0039] In some embodiments, in combination Figure 2 In the above step S1, a seed point data source is obtained and input into a preset fluid domain 2, including the steps of randomly setting various sub-points 3 in the seed point data source on an input interface 1 of the fluid domain 2. Alternatively, the positions of various sub-points 3 in the seed point data source on the input interface 1 may be generated by using different algorithms.

[0040] In some embodiments, in combination Figure 3 In step S2, the seed points in the seed point data source are traversed to calculate the initial data of various sub-points in the fluid domain, which also includes:

[0041] Step S21, traversing the initial positions of various sub-points in the seed point data source;

[0042] Step S22, searching for the grid unit corresponding to the initial position in the input interface;

[0043] Step S23, obtaining a preset velocity vector of the grid unit according to the number of the grid unit;

[0044] Step S24, calculating the initial moving speed vectors of various sub-points in the input interface according to the speed vectors preset in the grid unit, the initial data including the coordinate values ​​of the initial positions and the initial moving speed vectors.

[0045] Specifically, the coordinate values ​​of the initial positions of various sub-points can be expressed as The initial moving velocity vector is expressed as Then the initial data of various sub-points can be expressed as Where i represents the number of the current seed point; each seed point records its corresponding valid movement data every time it moves one step (this is because there will be multiple reciprocating movements to find the best next position point. The data generated by multiple reciprocating movements in the intermediate process are not used as the final valid data, but the position and velocity vector corresponding to the next moving position point finally determined are used as valid movement data). Therefore, the movement data of the mth movement of the i-th seed point is expressed as: in, Represents the coordinate value of the position where the i-th seed point moves for the m-th time, represents the moving velocity vector corresponding to the mth movement of the ith seed point; therefore, the streamline data corresponding to the ith seed point is expressed as: The overall streamline data finally generated is the collection of streamline data corresponding to various sub-points.

[0046] Specific, combined Figure 4 , various sub-points 3 can be set on the input interface 1 according to a predetermined algorithm, and at this time, the positions of various sub-points 3 on the input interface 1 are also the initial positions of various sub-points.

[0047] Specific, combined Figure 5 , meshing or meshing the fluid domain can divide the geometric surface and the cube into multiple units (i.e., mesh units). In the meshing process, the two-dimensional surface is represented by triangles or quadrilaterals, and the three-dimensional cube is divided into tetrahedrons, quadrangular pyramids, triangular prisms, hexahedrons or polyhedrons. In the present application, the input interface 1 can be divided into multiple mesh units 30 with triangular geometric structures, and each mesh unit 30 is provided with a corresponding number (for example, in Figure 5 12, 25, 34, 38, and 45 are numbers corresponding to each grid unit, respectively) and attribute data. The attribute data includes velocity vectors, scalar data (such as for display, the data represents the display color value corresponding to the grid unit), and other data.

[0048] Specific, combined Figure 5 , according to the input seed point data source, traverse each seed point 3, and for different streamline integration directions, obtain the coordinate value of the initial position of each seed point 3, and find the grid unit 30 where the coordinate value is located in the input interface 1 according to the coordinate value of the initial position, and obtain the geometric structure and attribute data of the grid unit 30 according to the number of the grid unit 30. Specifically, the streamline integration direction can be forward, that is, one-way only along the forward direction of the flow; it can be reverse, that is, one-way only against the backward direction of the flow; it can also be bidirectional, that is, both forward and reverse. Different streamline integration directions can be selected according to different actual application scenarios. For example, the forward direction is selected as the streamline integration direction in this application.

[0049] Among them, the preset velocity vector of the grid unit where the seed point is located is obtained, and the initial moving velocity vectors of various sub-points in the input interface are obtained according to the preset velocity vector of the grid unit. Since the initial moving velocity vector includes the magnitude and direction of the velocity, the seed point moves to the next position in the fluid domain according to the initial moving velocity vector.

[0050] In some embodiments, iterative calculation of movement data corresponding to each step of movement of various sub-points in the fluid domain further includes the step of: various sub-points starting from an initial position, moving forward step by step along the streamline integral direction.

[0051] Among them, various sub-points move from the current position to the next position immediately after the current position, which is called the first preset position. According to the coordinate value of the current position and the moving speed vector corresponding to the current position, the coordinate value of the first preset position can be calculated, and the grid unit corresponding to the first preset position in the fluid domain and the speed vector preset by the grid unit can be found; according to the speed vector preset by the grid unit corresponding to the first preset position, the moving speed vector corresponding to the first preset position is calculated (the speed vector preset by the grid unit can be directly used as the corresponding moving speed vector, or the corresponding moving speed vector can be obtained after the speed vector preset by the grid unit is revised and calculated, which is further explained below); according to the coordinate value of the first preset position and the corresponding moving speed vector, it is moved to the second preset position (that is, the next position immediately after the first preset position, which is called the second preset position), and so on. Each time it moves to a new position, the corresponding movement data includes the coordinate value of the new position and the corresponding moving speed vector.

[0052] Specifically, the seed point moves forward along the streamline integral direction (at Figure 1 In the example, the seed point moves gradually from left to right. The product of the moving speed vector of the seed point at the current position and the unit time is the moving distance of the seed point. When the seed point moves from the current position to the first preset position, it is necessary to find the speed vector preset by the grid unit corresponding to the first preset position, and recalculate the moving speed vector corresponding to the first preset position according to the speed vector preset by the grid unit corresponding to the first preset position; then recalculate the moving distance according to the moving speed vector corresponding to the first preset position, and the seed point continues to move forward and so on.

[0053] In some embodiments, before moving to the second preset position according to the moving speed vector corresponding to the first preset position, the step is also included: judging whether the moving speed vector corresponding to the current position meets the set conditions, including the first set condition and the second set condition, the first set condition is: the moving coefficient corresponding to the current position is greater than or equal to the first preset threshold, and the second set condition is to limit the moving speed vector corresponding to the current position; if the set conditions are not met, the seed point is withdrawn from the current position to the third preset position (the previous position immediately before the current position, referred to as the third preset position), the moving speed vector corresponding to the third preset position is adjusted and moved again; if the set conditions are met, the moving speed vector corresponding to the current position is moved to the first preset position. In this way, the moving distance of each step of the seed point can be reduced to avoid excessive changes in the moving speed vector.

[0054] It can be seen that the seed points of the present application have a self-regulation and correction constraint method when determining each step of movement to ensure the reliability of each step of movement. Otherwise, a large number of seed points will fail to move midway, and a large amount of data calculation will be wasted due to the failure of many seed points to move midway. Under extreme conditions, even a simulation process will produce very little valid streamline data output, and multiple simulations will be required to generate the required amount of streamline data.

[0055] Specifically, for the first setting condition, the calculation method for determining whether the movement coefficient corresponding to the current position is greater than or equal to the first preset threshold is: div ≥S max ; Among them, S div represents the mobility coefficient, S max Indicates the first preset threshold.

[0056] Specifically, the calculation method for determining whether the moving speed vector corresponding to the current position satisfies the second setting condition is:

[0057]

[0058] Where i represents the number of the current seed point. Indicates that the coordinate value of the seed point at the first preset position is

[0059] Therefore, here we actually compare the moving speed vector corresponding to the current position with the moving speed vector corresponding to the first preset position to ensure that there is no large deviation between the moving speed vectors between adjacent positions. When the moving speed vector corresponding to the current position does not meet the first set condition, the seed point is withdrawn to the third preset position, the moving speed vector corresponding to the third preset position is adjusted and moved again, and the calculation method is:

[0060]

[0061] in, represents the first adjusted moving speed vector corresponding to the withdrawal to the third preset position, S init represents the initial movement coefficient, S div represents the mobility coefficient.

[0062] Furthermore, the above calculation method for adjusting the moving speed vector corresponding to the third preset position can be repeated multiple times to obtain multiple different value, and then select the optimal value from them, for example, the moving distance corresponding to the moving speed vector is the smallest, the moving direction corresponding to the moving speed vector is closer to the forward integral direction of the streamline, etc. Therefore, the preferred moving speed vector corresponding to the withdrawal to the third preset position can be obtained

[0063] Among them, combined Figure 6 To explain, Figure 6 The dots in are all seed points, the first grid unit 31 is the current position of the seed point, the second grid unit 32 is the third preset position of the seed point, and when the moving speed vector corresponding to the current position does not meet the set condition, the seed point is withdrawn from the current position (i.e., the first grid unit 31) to the third preset position (the second grid unit 32), the moving speed vector corresponding to the third preset position is adjusted and moved again, for example: moved again to the third grid unit 33. Then, the speed vector set by the third grid unit 33 is obtained, and the moving speed vector is calculated according to the speed vector set by the third grid unit 33, and the movement continues according to the moving speed vector.

[0064] In some embodiments, the moving speed vector corresponding to the third preset position can be further adjusted, that is, based on the aforementioned preferred moving speed vector Calculate and obtain the second adjusted moving speed vector corresponding to the third preset position The calculation method is:

[0065]

[0066] in, Represents the moving speed vector corresponding to the seed point at the current position, It indicates the preferred moving speed vector obtained by multiple calculations and optimization after withdrawing to the third preset position. When the moving speed vector corresponding to the current position does not meet the first set condition, that is, the moving speed vector is too large and the moving distance is too long, the seed point is first withdrawn from the current position to the third preset position, and the first adjusted moving speed vector corresponding to the third preset position is calculated. You can also perform multiple calculations and select the optimal moving speed vector Then based on the preferred moving speed vector of the corresponding point at the third preset position Calculate the second adjusted moving speed vector It can achieve the effect of optimizing the moving distance, making the obtained streamline smoother and more accurate.

[0067] In some embodiments, in step S3, the movement data corresponding to each step of movement of various sub-points in the fluid domain is iteratively calculated until the movement of various sub-points in the fluid domain is terminated, and the steps are also included: judging whether the current position of various sub-points exceeds the boundary range of the fluid domain; if it exceeds the boundary range of the fluid domain, the movement of the seed points exceeding the boundary range is terminated; if it does not exceed the boundary range of the fluid domain, the position of the seed points continues to be gradually moved. By judging whether various sub-points exceed the boundary range of the fluid domain and terminating the movement of the seed points exceeding the boundary range of the fluid domain, it is avoided that the calculation loop caused by repeatedly returning to the previous position is reduced, and the calculation amount of streamline generation can be reduced, thereby reducing the calculation time of streamline generation and improving efficiency.

[0068] Specifically, the input interface and other boundary surfaces of the fluid domain are divided into triangular grid units with a geometric structure, and the coordinate values ​​v1 of the three vertices of the triangular grid unit where the seed point is located are obtained. k =(v1 k,x ,v1 k,y ,v1 k,z ), v2 k =(v2 k,x ,v2 k,y ,v2 k,z ), v3 k =(v3 k,x ,v3 k,y ,v3 k,z ), and change the input order of the coordinate values ​​of the three vertices in turn to calculate the unit normal vector under different vertex input orders Then calculate the corresponding feature point products dpd1 and dpd2 respectively to determine the current position p of the seed point i The position relationship with the triangular mesh unit. The method is: the product of dpd1 and dpd2 is not less than zero, that is, greater than or equal to zero, indicating that the current position p of the seed point i Within the triangular mesh unit, that is, the seed point does not exceed the boundary of the fluid domain.

[0069] Specifically, the calculation method of the feature point product dpd1 is:

[0070]

[0071] Specifically, the calculation method of the feature point product dpd2 is:

[0072]

[0073] Among them, v1 k 、v2 k 、v3 k are the coordinate values ​​of each vertex of the triangular mesh unit where the seed point is located, n k is the unit normal vector in different vertex input order; k is the number of the current triangle mesh unit.

[0074] In some embodiments, if the boundary range of the fluid domain is not exceeded, the position of the seed point is continued to be gradually moved, further comprising the steps of:

[0075] Move the seed point forward from the current position along the streamline integration direction to the fourth preset position, and check whether there is a grid unit corresponding to the fourth preset position; if so, calculate the moving speed vector corresponding to the fourth preset position according to the speed vector preset for the grid unit corresponding to the fourth preset position, and move to the fifth preset position according to the moving speed vector corresponding to the fourth preset position; if not, withdraw the seed point from the fourth preset position to the current position, and then move backward along the streamline integration direction to the sixth preset position, and search for the grid unit corresponding to the sixth preset position; if found, calculate the moving speed vector corresponding to the sixth preset position according to the speed vector preset for the grid unit corresponding to the sixth preset position, and move to the seventh preset position according to the moving speed vector corresponding to the sixth preset position; if not found, the movement of the seed point is terminated. By moving the positions of the seed points twice, it is possible to more accurately determine whether the seed points on the boundary surface exceed the boundary range of the fluid domain. The seed points that exceed the boundary range are terminated in time, which is conducive to timely termination of the seed points that exceed the boundary in the middle process, avoiding these seed points from repeatedly advancing and retreating in the boundary range and wasting computing resources, thereby ensuring that the remaining seed points can efficiently perform subsequent calculations, ensuring the efficiency of the entire simulation process, and the resulting streamline data is more accurate.

[0076] Specifically, first move the seed point from the current position p i =(p i,x ,p i,y ,p i,z ) moves forward along the streamline integral direction to the fourth preset position pb i =(pb i,x ,pb i,y ,pb i,z ), after moving the seed point from the current position to the fourth preset position, determine whether the fourth preset position is within the boundary range, that is, find out whether there is a grid unit corresponding to the fourth preset position; if so, it indicates that the fourth preset position is within the boundary range, find the speed vector preset by the grid unit, and thus calculate the moving speed vector corresponding to the fourth preset position And move to the fifth preset position according to the moving speed vector corresponding to the fourth preset position.

[0077] If it does not exist, the seed point is withdrawn from the fourth preset position to the current position, and then from the current position p i =(p i,x ,p i,y ,p i,z ) moves backward along the streamline integral direction to the sixth preset position pb' i =(pb' i,x ,pb' i,y ,pb' i,z ), determine whether the sixth preset position is within the boundary range, that is, search for the grid unit corresponding to the sixth preset position. If found, it indicates that the sixth preset position is within the boundary range, and search for the velocity vector preset for the grid unit; and move to the seventh preset position according to the moving velocity vector corresponding to the sixth preset position; if not found, the movement of the seed point is terminated.

[0078] Specifically, the fourth preset position pb i The calculation method is:

[0079]

[0080] Specifically, the sixth preset position pb i The calculation method of ' is:

[0081]

[0082] Among them, i represents the number of the current seed point, p i Indicates the coordinate value p of the seed point at the current position i (p i,x ,p i,y ,p i,z ), which is a known input parameter; px represents the X-axis coordinate value of the feature point of the triangular mesh unit (px x ,px y ,px z ), which is a known input parameter; py represents the Y-axis coordinate value of the feature point of the triangular mesh unit (py x ,py y ,py z ), is a known input parameter; o represents the origin coordinate value of the triangular mesh unit (o x ,o y ,o z ), is a known input parameter; f s Represents the scaling factor, which is a fixed value; j represents the number of the triangular mesh unit in the x, y, and z directions.

[0083] Combination Figure 7 It can be seen that in the process of generating streamlines, if a gray seed point 36 exceeds the boundary range of the fluid domain during movement, the movement of the gray seed point 36 will be terminated. For the method of judging whether the current position of various sub-points exceeds the boundary range of the fluid domain, please refer to the above, which will not be repeated here.

[0084] Figure 8 A schematic diagram of the resulting streamlines is given. Figure 8 The multiple curved dotted lines represent the multiple generated streamlines 4, including the streamline 41 that stops when encountering a boundary midway.

[0085] Combination Fig. 9 The present application also provides a device 50 for streamline generation, comprising an input module 51, an initial calculation module 52, a mobile calculation module 53 and an aggregation output module 54 connected in sequence.

[0086] The input module 51 is used to obtain a seed point data source and input it into a preset fluid domain; wherein the seed point data source includes a plurality of seed points.

[0087] The initial calculation module 52 is used to traverse the seed points in the seed point data source and calculate the initial data of various sub-points in the fluid domain.

[0088] The movement calculation module 53 is used to iteratively calculate the movement data corresponding to each step of movement of various sub-points in the fluid domain until the movement of various sub-points in the fluid domain is terminated.

[0089] The aggregation output module 54 is used to aggregate the initial data and movement data of various sub-points moving in the fluid domain, obtain the streamline data corresponding to the various sub-points and output them.

[0090] The other technical features of the above-mentioned device for streamline generation are the same as the features disclosed in the above-mentioned embodiment method, and will not be repeated here.

[0091] Combination Fig.10 The present application also provides an electronic device 60, including a processor 62 and a memory 61, wherein the memory 61 stores a computer program that can be executed by the processor, and when the computer program is executed by the processor 62, any one of the above-mentioned methods for streamline generation is implemented.

[0092] Specifically, the memory 61 is used to store computer programs or data. The memory 61 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.

[0093] The processor 62 is used to read / write data or computer programs stored in the memory 61 and execute corresponding functions. For example, when the computer program stored in the memory 61 is executed by the processor 62, the method for streamline generation provided in the embodiment of the present application can be implemented.

[0094] Combination Fig.11 The present application also provides a computer-readable storage medium 70 on which program instructions 701 are stored. The program instructions 701 are used to implement any of the above-mentioned methods for streamline generation.

[0095] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0096] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0097] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0098] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0099] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or partly contributed to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The above-mentioned storage medium can be non-transient or transient. Specifically, it includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program code.

[0100] In summary, the present application discloses a method, device, electronic device and storage medium for streamline generation, the method comprising the steps of: obtaining a seed point data source and inputting it into a preset fluid domain; traversing the seed points in the seed point data source, calculating the initial data of various sub-points in the fluid domain; iteratively calculating the movement data corresponding to each step of movement of various sub-points in the fluid domain until the movement of various sub-points in the fluid domain is terminated; gathering the initial data and movement data of various sub-points moving in the fluid domain, obtaining the streamline data corresponding to various sub-points and outputting them. The method of the present application generates streamlines by iteratively calculating the movement data corresponding to each step of movement of various sub-points in the fluid domain, and finally outputting the initial data and movement data of various sub-points moving in the fluid domain. Since a large amount of particle tracking calculation is not required, the calculation time in the streamline generation process is reduced, the efficiency of streamline generation and the user experience are improved.

[0101] The above descriptions are merely embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any equivalent structural transformations made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the protection scope of the present invention.

Claims

1. A method for streamline generation, It is characterized in that Includes steps: Obtain a seed point data source and input it into a preset fluid domain; wherein the seed point data source includes multiple seed points; Traversing the seed points in the seed point data source, and calculating the initial data of each seed point in the fluid domain; Iteratively calculating movement data corresponding to each step of movement of each seed point in the fluid domain until the movement of each seed point in the fluid domain is terminated; The initial data and the movement data of each seed point moving in the fluid domain are gathered to obtain and output the streamline data corresponding to each seed point.

2. The method for streamlining according to claim 1, It is characterized in that The step of traversing the seed points in the seed point data source and calculating the initial data of various sub-points in the fluid domain further includes: Traversing the initial positions of various sub-points in the seed point data source; Finding a grid unit corresponding to the initial position in the input interface; Acquire a preset velocity vector of the grid unit according to the number of the grid unit; According to the preset speed vector of the grid unit, the initial moving speed vectors of various sub-points in the input interface are calculated, and the initial data includes the coordinate value of the initial position and the initial moving speed vector.

3. The method for streamlining generation according to claim 1, It is characterized in that The iterative calculation of movement data corresponding to each step of movement of various sub-points in the fluid domain also includes the steps of: Various sub-points are moved from current positions to first preset positions, and velocity vectors preset in grid cells corresponding to the first preset positions in the fluid domain are searched; Calculating a moving speed vector corresponding to the first preset position according to a speed vector preset in a grid unit corresponding to the first preset position, wherein the moving data includes a coordinate value of the first preset position and a corresponding moving speed vector; Move to a second preset position according to the moving speed vector corresponding to the first preset position.

4. The method for streamlining generation according to claim 3, It is characterized in that Before moving to the second preset position according to the moving speed vector corresponding to the first preset position, the method further includes the following steps: Determine whether the moving speed vector corresponding to the current position meets the set condition. If the moving speed vector corresponding to the current position does not meet the set condition, withdraw the seed point to the third preset position, adjust the moving speed vector corresponding to the third preset position, and move again. If the moving speed vector corresponding to the current position meets the set condition, the mobile device moves to the first preset position according to the moving speed vector corresponding to the current position.

5. The method for streamlining generation according to claim 4, It is characterized in that The setting condition includes a first setting condition and a second setting condition. The first setting condition is: judging that the movement coefficient corresponding to the current position is greater than or equal to a first preset threshold, that is, S div ≥S max , where S div represents the mobility coefficient, S max represents a first preset threshold; The second setting condition is to limit the moving speed vector corresponding to the current position, that is: Where i represents the number of the seed point. Indicates that the coordinate value of the seed point at the first preset position is p i 'hour 6. The method for streamlining generation according to claim 1, It is characterized in that The iterative calculation of movement data corresponding to each step of movement of various sub-points in the fluid domain until the movement of various sub-points in the fluid domain is terminated includes the steps of: Determine whether the current positions of various sub-points exceed the boundary range of the fluid domain; If the fluid domain exceeds the boundary range, the seed point exceeding the boundary range is moved and stopped; If the boundary range of the fluid domain is not exceeded, the position of the seed point continues to be moved step by step.

7. The method for streamline generation according to claim 6, It is characterized in that If the boundary range of the fluid domain is not exceeded, the position of the seed point continues to be moved step by step, including the steps of: Move the seed point forward from the current position along the streamline integral direction to a fourth preset position, and search whether there is a grid cell corresponding to the fourth preset position; If it exists, calculating the moving speed vector corresponding to the fourth preset position according to the speed vector preset in the grid unit corresponding to the fourth preset position, and moving to the fifth preset position according to the moving speed vector corresponding to the fourth preset position; If it does not exist, the seed point is withdrawn from the fourth preset position to the current position, and then moved backward along the streamline integral direction to the sixth preset position, and the grid unit corresponding to the sixth preset position is searched. If found, the moving speed vector corresponding to the sixth preset position is calculated according to the speed vector preset in the grid unit corresponding to the sixth preset position, and the seed point is moved to the seventh preset position according to the moving speed vector corresponding to the sixth preset position; If not found, the seed point movement is terminated.

8. A device for streamline generation, It is characterized in that include: An input module is used to obtain a seed point data source and input it into a preset fluid domain; wherein the seed point data source includes a plurality of seed points; An initial calculation module, used for traversing the seed points in the seed point data source, and calculating the initial data of various sub-points in the fluid domain; A movement calculation module, used for iteratively calculating movement data corresponding to each step of movement of various sub-points in the fluid domain, until the movement of various sub-points in the fluid domain is terminated; The aggregation output module is used to aggregate the initial data and the movement data of various sub-points moving in the fluid domain, obtain the streamline data corresponding to the various sub-points and output them.

9. An electronic device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and when the computer program is executed by the processor, the method for streamline generation according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that The computer program is used to implement the method for streamline generation according to any one of claims 1 to 7.