Method, device, equipment and medium for initializing calculation of flow field area of rotating body shape
By using the round table and bounding box algorithm in CFD calculation, the flow field area of the gyro body shape is accurately initialized, which solves the problem of difficulty in capturing complex contour shapes during the initialization process, and improves the accuracy and user experience of the calculation results.
Patent Information
- Application Number
- CN202510180139.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-02-19
AI Technical Summary
In CFD calculation, it is difficult to accurately capture its complex contour shape in the initialization of the gyro body shape flow field region, resulting in unreasonable calculation results.
By obtaining the flow field data and mesh core coordinates in the text file, creating a circle to mark the target grid, creating a bounding box and recording its spatial coordinate range information, determining the target bounding box and target spatial points, and assigning values to the grid according to preset conditions until all target grid assignments are completed.
Accurate initialization of the flow field area in the shape of the slewing body is achieved, the efficiency and reliability of the flow field initialization are improved, and the user experience is improved.
Smart Images

Figure CN119647354B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the research field of fluid calculation, and in particular to a method, device, equipment and medium for initializing calculation of a flow field region in the shape of a body of revolution. Background Art
[0002] In the CFD (Computational Fluid Dynamics) calculation process, the initialization of the flow field refers to the process of setting the initial conditions of the flow field before the CFD calculation. These initial conditions include the size and distribution of physical quantities such as density, velocity, pressure, temperature, etc. in the flow field, as well as the setting of boundary conditions. The accuracy and rationality of the initial conditions directly affect the accuracy and reliability of the CFD calculation results.
[0003] At present, if only global initialization is used for some specific fluid flow problems, it cannot meet the needs. Some local initialization operations need to be combined to obtain more realistic simulation calculation results. These problems are widely representative in practical applications. For example, in CFD calculations, the local area in the initial flow field is high temperature and high pressure, which is very different from other areas. In this case, the temperature and pressure of the local area need to be assigned separately during the initialization process; or the flow field structure is complex. In order to ensure that the CFD calculation is easy to converge, a staged calculation method is used, and the calculation results of the previous stage are used as the initial field of the next stage. However, in the application scenarios of these local initialization calculations, the contour shape of the local area in the flow field may be more complex, and it is not always a simple block or sphere. For example, the flow field in some engines is generally in the shape of a more complex body of revolution. If the contour shape of the area is not accurately captured during the initialization assignment, it may lead to unreasonable calculation results. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for calculating the initialization of a flow field region in the shape of a body of revolution, which can effectively and accurately complete the flow field initialization of the flow field region in the shape of a body of revolution, and improve the efficiency and reliability of the flow field initialization, thereby improving the user experience. The specific scheme is as follows:
[0005] In a first aspect, the present application provides a method for initializing calculation of a flow field region of a body of revolution, comprising:
[0006] Obtaining a text file corresponding to the current flow field area; the text file includes corresponding flow field data and grid body center coordinates;
[0007] By creating a truncated cone, a plurality of target grids corresponding to a target local flow field area are determined and marked by using the truncated cone and the text file; the target grid is a grid whose own grid body center coordinates are located within the area wrapped by the truncated cone, and the target local flow field area is an area in the current flow field area where the local area contour is in the shape of a solid of revolution;
[0008] Creating a bounding box based on the mesh body center coordinates in the text file to obtain a plurality of bounding boxes, and recording the spatial coordinate range information of each of the bounding boxes;
[0009] Determine a current grid from the plurality of target grids based on a non-repeated selection principle, and calculate and compare the distance between grids and bounding boxes using the grid body center coordinates of the current grid and the spatial coordinate range information of each bounding box to determine a target bounding box corresponding to the current grid;
[0010] Calculate and compare the distances between points using the mesh body center coordinates of the current mesh and the mesh body center coordinates in the target bounding box to determine the target space point, and record the corresponding distances between the target points;
[0011] If the distance information between the target points meets the preset conditions, the current grid is assigned based on the flow field data of the target space point, and the process jumps again to the step of determining the current grid from the several target grids based on the principle of non-repetitive selection until the assignment operations corresponding to each of the target grids are completed.
[0012] Optionally, the step of creating a frustum to determine and mark a plurality of target grids corresponding to a target local flow field region by using the frustum and the text file includes:
[0013] The number of truncated cones is defined by the text file, and the corresponding upper and lower base radius configuration operations and upper and lower base center coordinate configuration operations on the truncated cone are triggered to obtain the truncated cone;
[0014] A plurality of target grids corresponding to a target local flow field region are determined by using the frustum and the grid body center coordinates in the text file, and the plurality of target grids are marked.
[0015] Optionally, the determining a plurality of target grids corresponding to a target local flow field region by using the truncated cone and the grid body center coordinates in the text file, and marking the plurality of target grids, comprises:
[0016] Determine the corresponding truncated cone height based on the center coordinates of the upper and lower bases of the truncated cone;
[0017] Calculate the cosine value between the truncated cone axis and the spatial coordinate axis based on the upper and lower base radii of the truncated cone and the height of the truncated cone to obtain a target cosine value;
[0018] For any of the mesh body center coordinates in the text file, calculation is performed based on the current mesh body center coordinates and the upper base center coordinates of the frustum to obtain a first calculation result;
[0019] Calculate based on the current grid body center coordinates and the target cosine value and upper base center coordinates of the frustum to obtain a second calculation result;
[0020] If the first calculation result is greater than the second calculation result, determine whether the square difference between the first calculation result and the second calculation result is not greater than the corresponding threshold value, and if so, determine that the grid corresponding to the center coordinates of the current grid body is the target grid corresponding to the target local flow field area, and trigger the corresponding target grid marking operation.
[0021] Optionally, creating a bounding box based on the mesh body center coordinates in the text file to obtain a plurality of bounding boxes, and recording the spatial coordinate range information of each of the bounding boxes includes:
[0022] Establishing a spatial point set based on the mesh body center coordinates in the text file;
[0023] Creating a bounding box using the spatial point set to obtain a plurality of bounding boxes;
[0024] The spatial coordinate range information of each bounding box is determined and recorded based on the coordinate values of the corner points of each bounding box.
[0025] Optionally, the calculating and comparing the distance between the grid and the bounding box by using the grid body center coordinates of the current grid and the spatial coordinate range information of each bounding box to determine the target bounding box corresponding to the current grid includes:
[0026] Determine the distance between the current grid and each of the bounding boxes by using the grid body center coordinates of the current grid and the spatial coordinate range information of each of the bounding boxes to obtain a corresponding bounding box distance value;
[0027] The corresponding bounding box distance value comparison operation is triggered, and the bounding box corresponding to the bounding box distance value with the smallest value is determined as the target bounding box corresponding to the current grid.
[0028] Optionally, calculating and comparing the distances between points using the mesh body center coordinates of the current mesh and the mesh body center coordinates in the target bounding box to determine the target space point, and recording the corresponding distances between the target points, includes:
[0029] Calculating the distance between points using the mesh body center coordinates of the current mesh and the mesh body center coordinates in the target bounding box to obtain corresponding distance values between points;
[0030] triggering a corresponding point-to-point distance value comparison operation, and determining the grid body center coordinates corresponding to the point-to-point distance value with the smallest value as the target space point corresponding to the current grid;
[0031] The target point distance between the current grid and the target space point is recorded.
[0032] Optionally, if the distance information between the target points meets a preset condition, assigning a value to the current grid based on the flow field data of the target space point includes:
[0033] If the distance information between the target points is smaller than the bounding box distance values of the other bounding boxes among the plurality of bounding boxes except the target bounding box, the flow field data of the target space points is obtained based on the text file, and the current grid is assigned with the flow field data.
[0034] In a second aspect, the present application provides a device for initializing and calculating a flow field region of a body of revolution, comprising:
[0035] A file acquisition module, used to acquire a text file corresponding to the current flow field area; the text file includes corresponding flow field data and grid body center coordinates;
[0036] A frustum creation module, used to create a frustum, so as to determine and mark a plurality of target grids corresponding to a target local flow field region by using the frustum and the text file; the target grid is a grid whose own grid body center coordinates are located within the region enclosed by the frustum, and the target local flow field region is a region in the current flow field region whose local region contour is in the shape of a solid of revolution;
[0037] A bounding box creation module, used to create a bounding box based on the mesh body center coordinates in the text file to obtain a plurality of bounding boxes, and record the spatial coordinate range information of each of the bounding boxes;
[0038] A target bounding box determination module is used to determine the current grid from the plurality of target grids based on a non-repetitive selection principle, and calculate and compare the distance between the grid and the bounding box through the grid body center coordinates of the current grid and the spatial coordinate range information of each bounding box, so as to determine the target bounding box corresponding to the current grid;
[0039] A target space point determination module is used to calculate and compare the distance between points through the mesh body center coordinates of the current mesh and the mesh body center coordinates in the target bounding box to determine the target space point and record the corresponding distance between the target points;
[0040] The grid assignment module is used to assign a value to the current grid based on the flow field data of the target space point if the distance information between the target points meets the preset conditions, and jump back to the step of determining the current grid from the plurality of target grids based on the principle of non-repetitive selection until the assignment operations corresponding to each of the target grids are completed.
[0041] In a third aspect, the present application provides an electronic device, including:
[0042] Memory, used to store computer programs;
[0043] The processor is used to execute the computer program to implement the steps of the aforementioned method for initializing the flow field area of the shape of a body of revolution.
[0044] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the steps of the aforementioned method for initializing calculation of a flow field area in the shape of a body of revolution.
[0045] It can be seen that in the present application, a text file corresponding to the current flow field area is obtained; the text file includes corresponding flow field data and mesh body center coordinates; by creating a truncated cone, a number of target grids corresponding to the target local flow field area are determined and marked using the truncated cone and the text file; the target grid is a grid whose own mesh body center coordinates are located within the area wrapped by the truncated cone, and the target local flow field area is an area in the current flow field area where the local area contour is in the shape of a solid of revolution; a bounding box is created based on the mesh body center coordinates in the text file to obtain a number of bounding boxes, and the spatial coordinate range information of each of the bounding boxes is recorded; the current grid is determined from the several target grids based on the principle of non-repetitive selection. Grid, and calculate and compare the distance between the grid and the bounding box through the grid body center coordinates of the current grid and the spatial coordinate range information of each bounding box to determine the target bounding box corresponding to the current grid; calculate and compare the distance between points through the grid body center coordinates of the current grid and the grid body center coordinates in the target bounding box to determine the target space point, and record the corresponding distance between target points; if the distance information between target points meets the preset conditions, assign a value to the current grid based on the flow field data of the target space point, and jump again to the step of determining the current grid from the several target grids based on the principle of non-repetitive selection, until the assignment operation corresponding to each of the target grids is completed. That is, in this application, first determine several target grids corresponding to the target local flow field area by creating a truncated cone, then create a bounding box, then determine the target bounding box by calculating and comparing the distance between the grid and the bounding box, and determine the distance between target points by calculating and comparing the distance between the grid body center of the grid and the grid body center coordinates in the target bounding box. If the distance between the target points meets the conditions, the target space point is used to assign the grid, and the step jump is performed until the assignment of all target grids is completed. In this way, the flow field initialization of the flow field area in the shape of a rotating body can be completed effectively and accurately, and the efficiency and reliability of the flow field initialization are improved, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0047] Figure 1 A flow chart of a method for initializing calculation of flow field area in a body of revolution shape provided in this application;
[0048] Figure 2A flow chart of a specific method for initializing the calculation of the flow field area of a body of revolution provided in this application;
[0049] Figure 3 A schematic diagram of a continuous multi-cone for capturing the engine shape provided by the present application;
[0050] Figure 4 A schematic diagram of a bounding box provided for this application;
[0051] Figure 5 A schematic diagram of a flow field simulated by a bell-shaped nozzle model provided in this application;
[0052] FIG6 (a) is a schematic diagram of a velocity cloud diagram in the X-axis direction of a flow field 1 provided in the present application;
[0053] FIG6 (b) is a schematic diagram of a velocity cloud diagram in the X-axis direction of a flow field 2 provided by the present application;
[0054] FIG. 7 ( a ) is a schematic diagram of a Mach number cloud diagram in a flow field 1 provided in the present application;
[0055] FIG7( b ) is a schematic diagram of a Mach number cloud diagram in a flow field 2 provided in the present application;
[0056] FIG8 (a) is a schematic diagram of velocity comparison of a flow field on the axis of a nozzle provided by the present application;
[0057] FIG8 (b) is a schematic diagram of pressure comparison of a flow field on the nozzle axis provided by the present application;
[0058] FIG8 (c) is a schematic diagram of density comparison of a flow field on the nozzle axis provided by the present application;
[0059] Fig. 9 A schematic diagram of the structure of a device for initializing the flow field area of a body of revolution provided in this application;
[0060] Fig.10 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0062] For example: in CFD calculations, a local area in the initial flow field is of high temperature and high pressure, which is very different from other areas. In this case, the temperature and pressure of the local area need to be assigned separately during the initialization process; or the flow field structure is complex. In order to ensure that the CFD calculation is easy to converge, a staged calculation method is adopted, and the calculation results of the previous stage are used as the initial field for the next stage. In the application scenarios of these local initialization calculations, the contour shape of the local area in the flow field may be more complex, and it is not always a simple square or spherical shape. For example, the flow field in some engines generally has a more complex shape of a rotating body. If the contour shape of the area is not accurately captured during the initialization assignment, unreasonable calculation results may result. To this end, the present application provides a rotation-shaped flow field area initialization calculation scheme, which can effectively and accurately complete the flow field initialization of the flow field area in the shape of a rotating body, and improve the efficiency and reliability of flow field initialization, thereby enhancing the user experience.
[0063] See also Figure 1 As shown, an embodiment of the present invention discloses a method for initializing calculation of a flow field region of a body of revolution, comprising:
[0064] Step S11, obtaining a text file corresponding to the current flow field area; the text file includes corresponding flow field data and grid body center coordinates.
[0065] Combination Figure 2 As shown, in this embodiment, firstly, a text file file.dat recording the mesh body center coordinates and the corresponding flow field data is obtained. The data in the file may be derived from the CFD calculation results, or may be directly input according to the actual situation. The data description is shown in Table 1 below, where the mesh body center coordinates may be arranged in the order of the Tecplot unstructured grid. If the component transport equation is not solved in the CFD calculation, the component mass fraction data does not need to be written.
[0066]
[0067] Step S12, by creating a frustum, using the frustum and the text file to determine and mark a number of target grids corresponding to the target local flow field area; the target grid is a grid whose own grid body center coordinates are located within the area wrapped by the frustum, and the target local flow field area is an area in the current flow field area where the local area contour is in the shape of a solid of revolution.
[0068] Specific, combined Figure 3 As shown, in this embodiment, a continuous frustum (such as Figure 3In the figure, three frustums are used, numbered 1, 2, and 3. Alternatively, a cylinder can be used, which can be considered a special frustum with the same radius at the top and bottom. The target area of the grid is wrapped, and the grid of the wrapped area is marked. That is, the number of frustums is defined by a text file. (It can be 1 or other custom values, for example, Figure 3 In =3), and trigger the corresponding upper and lower base radii of the cone (respectively ) configuration operations and upper and lower base center coordinates (respectively , The configuration operation is performed to obtain a frustum; a number of target grids corresponding to the target local flow field area are determined by using the frustum and the grid body center coordinates in the text file, and the target grids are marked.
[0069] It is further understood that in this embodiment, when performing grid marking, the corresponding truncated cone height is first determined based on the center coordinates of the upper and lower bases of the truncated cone. , the expression is:
[0070] ;
[0071] Then calculate the axis of the cone and The cosine value of the axis, and the cosine value between the axis of the truncated cone and the spatial coordinate axis is calculated based on the upper and lower base radii of the truncated cone and the height of the truncated cone to obtain the target cosine value , the expression is:
[0072] ;
[0073] Then, for any mesh body center coordinate in the text file, the first calculation result is calculated based on the current mesh body center coordinate and the upper base center coordinate of the truncated cone. Specifically, the mesh body center coordinate in the flow field can be set as , the distance from the center of the grid to the bottom center of the truncated cone for:
[0074] ;
[0075] The second calculation result is obtained by calculating based on the coordinates of the current mesh center, the target cosine value of the cone, and the coordinates of the upper base center. That is, the distance from the mesh center to the upper base is:
[0076] ;
[0077] If the first calculation result is greater than the second calculation result, it is determined whether the square difference between the first calculation result and the second calculation result is not greater than the corresponding threshold value, and if so, the grid corresponding to the coordinates of the current grid body center is determined to be the target grid corresponding to the target local flow field area, and the corresponding target grid marking operation is triggered. When further judgment is made, if , it means that the center of the grid is within the area enclosed by the frustum, and it is determined as the target grid and marked.
[0078] Step S13: Create a bounding box based on the mesh body center coordinates in the text file to obtain a plurality of bounding boxes, and record the spatial coordinate range information of each bounding box.
[0079] In this embodiment, after determining the target grid, a certain number of bounding boxes are generated using the grid body center coordinates in the text file. Specifically, a spatial point set is established based on the grid body center coordinates in the text file; the bounding boxes are created using the spatial point set to obtain a number of ( ) bounding box; determine and record the spatial coordinate range information of each bounding box based on the coordinate values of the corner points of each bounding box. It can be understood that each bounding box has a part of spatial points (i.e., the center of the grid body), and the corner points of each bounding box are recorded. The minimum and maximum coordinate values in the direction: , used to represent the range enclosed by each box, the minimum and maximum coordinate values are derived from the enclosed space points, Figure 4 An example of a bounding box is given.
[0080] Step S14, determining the current grid from the plurality of target grids based on the principle of non-repetitive selection, and calculating and comparing the distances between grids and bounding boxes using the grid body center coordinates of the current grid and the spatial coordinate range information of each bounding box to determine the target bounding box corresponding to the current grid.
[0081] In this embodiment, the marked grids in the flow field, that is, the target grids, are looped to calculate the distance from the center of the marked grid to each bounding box. If the center of the grid is within the bounding box, it satisfies the following conditions at the same time:
[0082] ;
[0083] The distance Recorded as 0, if it is not in the bounding box, the distance for:
[0084] ;
[0085] ;
[0086] ;
[0087] ;
[0088] This way you can find That is, the distance between the current grid and each bounding box is determined by the grid body center coordinates of the current grid and the spatial coordinate range information of each bounding box to obtain the corresponding bounding box distance value; the corresponding bounding box distance value comparison operation is triggered, and the bounding box corresponding to the bounding box distance value with the smallest value is determined as the target bounding box corresponding to the current grid.
[0089] Step S15, calculating and comparing the distances between points using the mesh body center coordinates of the current mesh and the mesh body center coordinates in the target bounding box to determine the target space point, and recording the corresponding distances between the target points.
[0090] In this embodiment, after finding the target bounding box, loop through the set of spatial points in the box to find the point closest to the center of the marked grid body, and record the minimum distance between the two points. That is, the distance between points is calculated by the mesh body center coordinates of the current mesh and the mesh body center coordinates in the target bounding box to obtain the corresponding inter-point distance value; the corresponding inter-point distance value comparison operation is triggered, and the mesh body center coordinates corresponding to the minimum inter-point distance value are determined as the target space point corresponding to the current mesh; and the target point distance between the current mesh and the target space point is recorded.
[0091] Step S16: If the distance information between the target points meets the preset conditions, the current grid is assigned based on the flow field data of the target space point, and the process jumps to the step of determining the current grid from the plurality of target grids based on the principle of non-repetitive selection, until the assignment operations corresponding to each of the target grids are completed.
[0092] Specific, combined Figure 2 As shown, in this embodiment, it is necessary to compare Distance from the grid to other bounding boxes , if it exists Less than , then loop the set of spatial points in the newly determined target bounding box, and if there is a new spatial point with a shorter distance to the center of the marked grid, update Then continue to compare Distance to other bounding boxes , until the point closest to the center of the marked grid is found, and then the flow field data corresponding to the point is assigned to the marked grid. Then repeat steps S14 to S16 until all marked grids are assigned. That is, if the distance information between the target points is less than the bounding box distance value of other bounding boxes except the target bounding box among several bounding boxes, the flow field data of the target space point is obtained based on the text file, and the flow field data is used to assign the current grid.
[0093] In summary, in this embodiment, a complex flow field area of a solid of revolution is captured by wrapping multiple truncated cones or cylinders, and a bounding box algorithm is used to quickly perform local initialization calculations. In this way, not only can the local flow field area of the solid of revolution be accurately captured, but also the value can be accurately assigned to the target area in space.
[0094] It can be seen that in the embodiment of the present application, a text file corresponding to the current flow field area is obtained; the text file includes corresponding flow field data and grid body center coordinates; by creating a frustum, a number of target grids corresponding to the target local flow field area are determined and marked using the frustum and the text file; the target grid is a grid whose own grid body center coordinates are located within the area wrapped by the frustum, and the target local flow field area is an area in the current flow field area where the local area contour is a solid of revolution; a bounding box is created based on the grid body center coordinates in the text file to obtain a number of bounding boxes, and the spatial coordinate range information of each bounding box is recorded; based on the principle of non-repetitive selection, the current target grid is determined from the several target grids. The previous grid, and the distance between the grid and the bounding box is calculated and compared through the grid body center coordinates of the current grid and the spatial coordinate range information of each bounding box to determine the target bounding box corresponding to the current grid; the distance between points is calculated and compared through the grid body center coordinates of the current grid and the grid body center coordinates in the target bounding box to determine the target space point, and the corresponding distance between the target points is recorded; if the distance information between the target points meets the preset conditions, the current grid is assigned based on the flow field data of the target space point, and the step of determining the current grid from the several target grids based on the principle of non-repetitive selection is jumped again until the assignment operation corresponding to each of the target grids is completed. That is, in this application, several target grids corresponding to the target local flow field area are first determined by creating a truncated cone, and then a bounding box is created, and then the target bounding box is determined by calculating and comparing the distance between the grid and the bounding box, and the distance between the target points is determined by calculating and comparing the distance between the grid body center of the grid and the grid body center coordinates in the target bounding box. If the distance between the target points meets the conditions, the target space point is used to assign the grid, and the step jump is performed until the assignment of all target grids is completed. In this way, the flow field initialization of the flow field area in the shape of a rotating body can be completed effectively and accurately, and the efficiency and reliability of the flow field initialization are improved, thereby improving the user experience.
[0095] Combine the following Figure 3 - The schematic diagram disclosed in FIG8 (c) specifically illustrates the technical solution of the embodiment of the present application.
[0096] In a specific embodiment, a typical bell-shaped nozzle model is used to simulate the flow field 1 after pressure is built up in a closed space, and then the flow field 1 data of the closed space is used to initialize the flow field 2 of the open space, such as Figure 5 The nozzle exhaust gas is cold pure air, the throat Mach number is 1, and the static pressure is 53528.15 , static temperature is 250 . Nozzle throat section diameter 16 , expansion ratio is 25, expansion segment length is 100 The specific local flow field initialization process is as follows.
[0097] 1): Use NNW-flowstar software to simulate the pressure building process of the nozzle in a confined space, and use the CFD calculation results to generate the flow field data and grid body center coordinates. The calculated velocity flow field in the X direction is shown in Figure 6(a).
[0098] 2): First, establish a coordinate system. The center of the coordinate circle is placed on the nozzle axis. The X-axis direction is consistent with the nozzle axis direction. The XOY plane is the symmetry plane. Define the number of frustums used to capture the initial flow field shape, and the corresponding center coordinates and radius of the upper and lower bases of the frustum. In this example, three frustums are defined to capture the flow field shape (such as Figure 3 As shown), the upper base radii of the three cones are 0.0085m, 0.028m, and 0.2m respectively, and the upper base center coordinates are (-0.0009, 0, 0), (0.038, 0, 0), and (0.078, 0, 0) respectively. The lower base radii are 0.028m, 0.038m, and 0.2m respectively, and the lower base center coordinates are (0.038, 0, 0), (0.078, 0, 0), and (0.26, 0, 0) respectively.
[0099] 3): Utilize The spatial point set data in the file generates 32 bounding boxes.
[0100] 4): During the CFD initialization process, the bounding box method is used to find the point in the frustum enclosed area that is closest to the center of the marked grid body, and the corresponding flow field data is assigned to the target area.
[0101] 5): Compare the flow field results of the initialization area with the results after the pressure buildup in the confined space in 1), as shown in Figures 6 (a) to 8 (c). It can be seen that after local initialization, the calculation results of flow field 1 are accurately assigned to the specified area of flow field 2. In the comparison of the flow field data on the nozzle axis in Figures 8 (a), (b) and (c), the pressure ,density The match is very good, and the X-direction speed Only in a very small area in the axial direction There is an error within 14%.
[0102] See also Fig. 9 As shown, the embodiment of the present application also discloses a device for initializing and calculating a flow field area of a body of revolution, including:
[0103] The file acquisition module 11 is used to acquire a text file corresponding to the current flow field area; the text file includes corresponding flow field data and grid body center coordinates;
[0104] The truncated cone creation module 12 is used to create a truncated cone, so as to determine and mark a plurality of target grids corresponding to the target local flow field area by using the truncated cone and the text file; the target grid is a grid whose own grid body center coordinates are located in the area wrapped by the truncated cone, and the target local flow field area is an area in the current flow field area where the local area contour is in the shape of a solid of revolution;
[0105] A bounding box creation module 13 is used to create a bounding box based on the mesh body center coordinates in the text file to obtain a plurality of bounding boxes, and record the spatial coordinate range information of each of the bounding boxes;
[0106] A target bounding box determination module 14 is used to determine a current grid from the plurality of target grids based on a non-repeated selection principle, and calculate and compare the distance between grids and bounding boxes through the grid body center coordinates of the current grid and the spatial coordinate range information of each bounding box to determine a target bounding box corresponding to the current grid;
[0107] The target space point determination module 15 is used to calculate and compare the distance between points through the mesh body center coordinates of the current mesh and the mesh body center coordinates in the target bounding box to determine the target space point and record the corresponding distance between the target points;
[0108] The grid assignment module 16 is used to assign a value to the current grid based on the flow field data of the target space point if the distance information between the target points meets the preset conditions, and jump back to the step of determining the current grid from the plurality of target grids based on the principle of non-repetitive selection until the assignment operations corresponding to each of the target grids are completed.
[0109] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0110] It can be seen that in this application, a number of target grids corresponding to the target local flow field area are first determined by creating a truncated cone, and then a bounding box is created. After that, the target bounding box is determined by calculating and comparing the distance between the grid and the bounding box, and the distance between the grid body center of the grid and the grid body center coordinates in the target bounding box is calculated and compared to determine the distance between the target points. If the distance between the target points meets the conditions, the target space point is used to assign the grid, and the step jump is performed until the assignment of all target grids is completed. In this way, the flow field initialization of the flow field area in the shape of a body of revolution can be effectively and accurately completed, and the efficiency and reliability of the flow field initialization are improved, thereby improving the user experience.
[0111] In some specific embodiments, the frustum creation module 12 can be specifically used to define the number of frustums through the text file, and trigger the corresponding upper and lower base radius configuration operations and upper and lower base center coordinate configuration operations of the frustum to obtain the frustum; use the frustum and the grid body center coordinates in the text file to determine a number of target grids corresponding to the target local flow field area, and mark the several target grids.
[0112] In some specific embodiments, the frustum creation module 12 can be specifically used to determine the corresponding frustum height based on the upper and lower base center coordinates of the frustum; calculate the cosine value between the frustum axis and the spatial coordinate axis based on the upper and lower base radii of the frustum and the frustum height to obtain a target cosine value; for any of the grid body center coordinates in the text file, calculate based on the current grid body center coordinates and the upper base center coordinates of the frustum to obtain a first calculation result; calculate based on the current grid body center coordinates and the target cosine value of the frustum and the upper base center coordinates to obtain a second calculation result; if the first calculation result is greater than the second calculation result, determine whether the square difference between the first calculation result and the second calculation result is not greater than the corresponding threshold, and if so, determine that the grid corresponding to the current grid body center coordinate is the target grid corresponding to the target local flow field area, and trigger the corresponding target grid marking operation.
[0113] In some specific embodiments, the bounding box creation module 13 can be specifically used to establish a spatial point set based on the grid body center coordinates in the text file; use the spatial point set to create a bounding box to obtain a number of bounding boxes; determine and record the spatial coordinate range information of each bounding box based on the corner point coordinate values of each bounding box.
[0114] In some specific embodiments, the target bounding box determination module 14 can be specifically used to determine the distance between the current grid and each of the bounding boxes through the grid body center coordinates of the current grid and the spatial coordinate range information of each of the bounding boxes to obtain a corresponding bounding box distance value; trigger the corresponding bounding box distance value comparison operation, and determine the bounding box corresponding to the bounding box distance value with the smallest value as the target bounding box corresponding to the current grid.
[0115] In some specific embodiments, the target space point determination module 15 can be specifically used to calculate the distance between points through the grid body center coordinates of the current grid and the grid body center coordinates in the target bounding box to obtain corresponding point distance values; trigger corresponding point distance value comparison operations, and determine the grid body center coordinates corresponding to the point distance value with the smallest value as the target space point corresponding to the current grid; and record the target point distance between the current grid and the target space point.
[0116] In some specific embodiments, the grid assignment module 16 can also be used to obtain the flow field data of the target space point based on the text file if the distance information between the target points is less than the bounding box distance value of other bounding boxes among the several bounding boxes except the target bounding box, and use the flow field data to assign the current grid.
[0117] Furthermore, the present application also discloses an electronic device. Fig.10 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0118] Fig.10 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the method for initializing the calculation method of the flow field area of the body of revolution shape disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0119] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0120] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0121] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the initialization calculation method of the flow field area of the body of revolution shape performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.
[0122] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed method for calculating the initialization of the flow field area of a body of revolution is implemented. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0123] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0124] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0125] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0126] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0127] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for initializing the flow field area of a rotating body, characterized in that: include: Get the text file corresponding to the current flow field area; The text file includes corresponding flow field data and grid body center coordinates; By creating a frustum, a plurality of target grids corresponding to a target local flow field area are determined and marked by using the frustum and the text file; The target grid is a grid whose own grid body center coordinates are located within the area wrapped by the truncated cone, and the target local flow field area is an area in the current flow field area where the local area contour is in the shape of a solid of revolution; Creating a bounding box based on the mesh body center coordinates in the text file to obtain a plurality of bounding boxes, and recording the spatial coordinate range information of each of the bounding boxes; Determine a current grid from the plurality of target grids based on a non-repeated selection principle, and calculate and compare the distance between grids and bounding boxes using the grid body center coordinates of the current grid and the spatial coordinate range information of each bounding box to determine a target bounding box corresponding to the current grid; Calculate and compare the distances between points using the mesh body center coordinates of the current mesh and the mesh body center coordinates in the target bounding box to determine the target space point, and record the corresponding distances between the target points; If the distance information between the target points meets the preset conditions, the current grid is assigned based on the flow field data of the target space point, and the process jumps again to the step of determining the current grid from the several target grids based on the principle of non-repetitive selection until the assignment operations corresponding to each of the target grids are completed.
2. The method for initializing the flow field area of a body of revolution according to claim 1, characterized in that: The step of creating a frustum to determine and mark a plurality of target grids corresponding to a target local flow field region by using the frustum and the text file includes: The number of truncated cones is defined by the text file, and the corresponding upper and lower base radius configuration operations and upper and lower base center coordinate configuration operations on the truncated cone are triggered to obtain the truncated cone; A plurality of target grids corresponding to a target local flow field region are determined by using the frustum and the grid body center coordinates in the text file, and the plurality of target grids are marked.
3. The method for initializing the flow field area of a body of revolution according to claim 2, characterized in that: The method of determining a plurality of target grids corresponding to a target local flow field region by using the truncated cone and the grid body center coordinates in the text file, and marking the plurality of target grids, comprises: Determine the corresponding truncated cone height based on the center coordinates of the upper and lower bases of the truncated cone; Calculate the cosine value between the truncated cone axis and the spatial coordinate axis based on the upper and lower base radii of the truncated cone and the height of the truncated cone to obtain a target cosine value; For any of the mesh body center coordinates in the text file, calculation is performed based on the current mesh body center coordinates and the upper base center coordinates of the frustum to obtain a first calculation result; Calculate based on the current grid body center coordinates and the target cosine value and upper base center coordinates of the frustum to obtain a second calculation result; If the first calculation result is greater than the second calculation result, determine whether the square difference between the first calculation result and the second calculation result is not greater than the corresponding threshold value, and if so, determine that the grid corresponding to the center coordinates of the current grid body is the target grid corresponding to the target local flow field area, and trigger the corresponding target grid marking operation.
4. The method for initializing the flow field area of a body of revolution according to claim 1, characterized in that: The creating of the bounding box based on the mesh body center coordinates in the text file to obtain a plurality of bounding boxes, and recording the spatial coordinate range information of each of the bounding boxes, includes: Establishing a spatial point set based on the mesh body center coordinates in the text file; Creating a bounding box using the spatial point set to obtain a plurality of bounding boxes; The spatial coordinate range information of each bounding box is determined and recorded based on the coordinate values of the corner points of each bounding box.
5. The method for initializing the flow field area of a body of revolution according to claim 1, characterized in that: The calculating and comparing the distance between the grid and the bounding box by using the grid body center coordinates of the current grid and the spatial coordinate range information of each bounding box to determine the target bounding box corresponding to the current grid includes: Determine the distance between the current grid and each of the bounding boxes by using the grid body center coordinates of the current grid and the spatial coordinate range information of each of the bounding boxes to obtain a corresponding bounding box distance value; The corresponding bounding box distance value comparison operation is triggered, and the bounding box corresponding to the bounding box distance value with the smallest value is determined as the target bounding box corresponding to the current grid.
6. The method for initializing the flow field area of a body of revolution according to any one of claims 1 to 5, characterized in that: The calculating and comparing the distances between points by the mesh body center coordinates of the current mesh and the mesh body center coordinates in the target bounding box to determine the target space point and recording the corresponding distances between the target points includes: Calculating the distance between points using the mesh body center coordinates of the current mesh and the mesh body center coordinates in the target bounding box to obtain corresponding distance values between points; triggering a corresponding point-to-point distance value comparison operation, and determining the grid body center coordinates corresponding to the point-to-point distance value with the smallest value as the target space point corresponding to the current grid; The target point distance between the current grid and the target space point is recorded.
7. The method for initializing the flow field area of a body of revolution according to claim 5, characterized in that: If the distance information between the target points meets the preset conditions, assigning a value to the current grid based on the flow field data of the target space points includes: If the distance information between the target points is smaller than the bounding box distance values of the other bounding boxes among the plurality of bounding boxes except the target bounding box, the flow field data of the target space points is obtained based on the text file, and the current grid is assigned with the flow field data.
8. A device for initializing and calculating the flow field area of a body of revolution, characterized in that: include: A file acquisition module, used to acquire a text file corresponding to the current flow field area; The text file includes corresponding flow field data and grid body center coordinates; A frustum creation module, used to create a frustum, so as to determine and mark a plurality of target grids corresponding to a target local flow field region by using the frustum and the text file; the target grid is a grid whose own grid body center coordinates are located within the region enclosed by the frustum, and the target local flow field region is a region in the current flow field region whose local region contour is in the shape of a solid of revolution; A bounding box creation module, used to create a bounding box based on the mesh body center coordinates in the text file to obtain a plurality of bounding boxes, and record the spatial coordinate range information of each of the bounding boxes; A target bounding box determination module is used to determine the current grid from the plurality of target grids based on a non-repetitive selection principle, and calculate and compare the distance between the grid and the bounding box through the grid body center coordinates of the current grid and the spatial coordinate range information of each bounding box, so as to determine the target bounding box corresponding to the current grid; A target space point determination module is used to calculate and compare the distance between points through the mesh body center coordinates of the current mesh and the mesh body center coordinates in the target bounding box to determine the target space point and record the corresponding distance between the target points; The grid assignment module is used to assign a value to the current grid based on the flow field data of the target space point if the distance information between the target points meets the preset conditions, and jump back to the step of determining the current grid from the plurality of target grids based on the principle of non-repetitive selection until the assignment operations corresponding to each of the target grids are completed.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the method for initializing the flow field area of a rotating body as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the method for initializing the flow field area of a rotating body as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Aircraft processing method, system and equipment and computer storage medium
CN115358096A
Collision parallel detection method and device, equipment and storage medium
CN119378452A