A method and system for data conversion in fluid simulation
By unifying the mesh and result data formats in fluid simulation, the problems of complex data formats and slow loading in fluid simulation are solved, achieving efficient data loading and fast conversion, and improving the efficiency of querying solution results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PERA
- Filing Date
- 2023-09-07
- Publication Date
- 2026-08-04
AI Technical Summary
In existing fluid simulation processes, the simulation software from different vendors differs in data format organization and storage, leading to complex format conversion and slow data loading.
This paper provides a data conversion method for fluid simulation, which converts the mesh data of the fluid model into unified mesh data and the solver output data into unified tree-shaped result data, including unified processing of point, boundary and volume data, and uses a unified format for data loading and conversion.
It enables efficient loading and rapid conversion of mesh data, improves the efficiency of querying solution results, and simplifies the processing of result data from different solvers.
Smart Images

Figure CN117271633B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data simulation technology, and in particular to a data conversion method and system for fluid simulation. Background Technology
[0002] Fluid simulation has wide applications in aerospace, vehicle transportation, energy and power, electronics and electrical appliances, bioengineering, shipbuilding and water conservancy, environmental engineering, sports engineering and other fields.
[0003] Fluid simulation converts fluid data into mesh data before solving, converts the mesh data into the format required by the solver during solving, and presents the solution results after solving.
[0004] During process simulation, different manufacturers' simulation software currently use different methods to organize and store data. For example, when storing point, boundary, and volume data before solving, each has its own rules on how to represent the point order, normal, boundary, volume, and the relationship between the volume and the boundary, which leads to complex format conversion and slow data loading. Summary of the Invention
[0005] Based on the above analysis, the present invention aims to provide a data conversion method and system for fluid simulation, in order to solve the problem of slow data loading and conversion caused by complex data formats in existing fluid simulation processes.
[0006] On one hand, embodiments of the present invention provide a data conversion method in fluid simulation, comprising the following steps:
[0007] Obtain the mesh data of the fluid model after meshing, and convert the mesh data of the fluid model into unified mesh data;
[0008] After converting the unified mesh data into the mesh data corresponding to the solver, it is passed into the solver;
[0009] The output data of the parser is analyzed and converted into a unified tree-structured result data.
[0010] Based on further improvements to the above method, the unified mesh data includes: point, boundary, and volume data; wherein, point data includes point index and coordinate values in three-dimensional space; the boundary is composed of multiple faces, and the boundary data includes the boundary attributes and multiple face data; the volume is composed of multiple volume elements, and the volume data includes the volume attributes and multiple volume element data.
[0011] Based on further improvements to the above method, the attributes of the boundary include: boundary identifier, boundary name, boundary type, number of faces, face type, and body identifier; among which the boundary type includes: wall, interior face, and split face; the face type includes: triangle, quadrilateral, polygon, and mixed type.
[0012] Based on further improvements to the above method, the surface data is constructed according to the surface type, including:
[0013] For triangles and quadrilaterals, obtain the indexes of the points that make up the same face, and use them as a face data entry.
[0014] For polygonal faces, obtain the number of points that make up the same face, as well as the index of each point on the face, as a single face data entry.
[0015] For mixed-type faces, obtain the type of each face in sequence according to the number of faces. If the face type is not a polygon type, obtain the code value corresponding to the face type and the index of the points that make up the face as a face data. Otherwise, obtain the code value corresponding to the face type, the number of points that make up the face, and the index of the points that make up the face in sequence as a face data.
[0016] Based on further improvements to the above method, the properties of a volume include: volume identifier, volume name, volume element type, number of volume elements, and material type; among which, the volume element type includes: tetrahedron, pyramid, prism, hexahedron, polyhedron, and hybrid type; the material type includes: fluid and solid.
[0017] Based on further improvements to the above method, volume element data is constructed according to volume element type, including:
[0018] For volume elements of tetrahedral, pyramidal, prism, and hexahedral types, obtain the point indices that make up the same volume element and treat them as a single volume element data.
[0019] For polyhedral volume elements, first count the number of faces contained in each volume element according to the number of volume elements, and use it as the main data of the corresponding volume element data. Then, obtain the number of point data that make up each face and the index of each point as a sub-data. One main data and multiple sub-data make up a volume element data.
[0020] For mixed-type volume elements, obtain the type of each volume element in sequence according to the number of volume elements. If the volume element type is not a polyhedron type, obtain the code value corresponding to the volume element type and the point index of the volume element as a volume element data; otherwise, take the code value corresponding to the volume element type as the first value and add it to the main data of the polyhedron type volume element data.
[0021] Based on further improvements to the above method, the method also includes:
[0022] Based on the body identifier of the shared surface in the mesh data of the fluid model, obtain the material type of the two bodies;
[0023] When both bodies are made of fluid materials, the boundary conditions of the shared surface are used to identify whether the shared surface is an internal surface. If not, the shared surface is split into boundaries.
[0024] If one of the material types of the two bodies is solid, then the shared surface is split into boundaries.
[0025] Based on a further improvement to the above method, the shared surface is split into boundaries, including:
[0026] For each point on the shared surface, remove duplicates and generate a new point with the same coordinates, then add it to the global point array and generate a new point index;
[0027] Construct a new boundary, assign a unique boundary identifier, set the boundary name, set the boundary type to split face, set the owner body identifier to one of the owner body identifiers of the shared face, and keep other attributes consistent with the shared face. Modify the owner body identifier of the original shared face to another owner body identifier, and set the boundary type of the original shared face to split face.
[0028] Based on the type of the shared face and the new point index, generate new face data and associate it with the new boundary.
[0029] Based on the further improvement of the above method, the solver output data is parsed and converted into a unified tree-shaped result data, including: taking each volume name as the first-level result, taking each variable to be solved as the second-level result, and then displaying the solution value of each variable to be solved according to each boundary as the third-level result.
[0030] On the other hand, embodiments of the present invention provide a data conversion system for fluid simulation, comprising:
[0031] The mesh data conversion module is used to acquire the mesh data of the fluid model after meshing and convert the mesh data of the fluid model into unified mesh data.
[0032] The solution data conversion module is used to convert uniform mesh data into mesh data corresponding to the solver before passing it into the solver;
[0033] The solution result conversion module is used to parse the solver's output data and convert it into a unified tree-structured result data.
[0034] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0035] 1. Unified grid data: It can efficiently load grid data and quickly convert it to other grid data formats.
[0036] 2. Unified result data: It can unify the result data of all solvers and load the result data efficiently, thus improving the query efficiency of the solution results.
[0037] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description
[0038] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.
[0039] Figure 1 This is a flowchart of a data conversion method in fluid simulation according to Embodiment 1 of the present invention;
[0040] Figure 2 This is a schematic diagram of the point index of the tetrahedral type volume element in Embodiment 1 of the present invention;
[0041] Figure 3 This is a block diagram of a data conversion system in fluid simulation according to Embodiment 2 of the present invention. Detailed Implementation
[0042] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0043] Example 1
[0044] A specific embodiment of the present invention discloses a data conversion method in fluid simulation, such as... Figure 1 As shown, it includes the following steps:
[0045] S11. Obtain the mesh data after the fluid model is meshed, and convert the mesh data of the fluid model into unified mesh data.
[0046] It's important to note that fluid mesh data is obtained by meshing the fluid model, including points, edges, surfaces, volumes, and their interrelationships. Surfaces shared by two volumes are called shared surfaces. For example, shared surfaces can be identified by adding "share" to their names. When performing fluid simulations based on fluid mesh data, different software programs use inconsistent data formats. This necessitates converting each format to its corresponding solver mesh data, leading to inconsistent conversion methods and maintenance difficulties. Therefore, this step converts the fluid model mesh data from different formats into a unified mesh data format.
[0047] It should be noted that the unified mesh data in this embodiment includes three parts: points, boundaries, and volumes. Each point data includes a point index and its 3D spatial coordinates, stored in a global point array. The detailed data for boundaries and volumes consists of point indices. The following details the steps for obtaining and constructing boundary and volume data:
[0048] 1) Boundary data
[0049] It should be noted that a boundary is composed of multiple faces. The overall information of the boundary is described using its attributes, which include, but are not limited to: boundary identifier, boundary name, boundary type, number of faces, face type, and belonging entity identifier. The face data of the boundary describes the type of each face included in the boundary and the point indices of the constituent faces. The face data of the boundary, as detailed boundary data, is usually stored in the form of a two-dimensional array and associated with the corresponding boundary.
[0050] Specifically, the attributes of the boundary are described as follows: The boundary identifier is the unique ID of the boundary. Boundary types include: wall, interior face, and split face. A wall is the surface of a constituent body, composed of various faces; an interior face is a face shared by two bodies, a type of shared face; a split face is a new face split from an interior face during mesh data transformation, for example, splitting an interior face into two split faces. The number of faces is the total number of faces that make up the boundary. Face types include: triangle, quadrilateral, polygon, and mixed type, each type corresponding to a coded value. Triangle type means the face is composed entirely of triangles; quadrilateral type means the face is composed entirely of quadrilaterals; polygon type means the face is composed entirely of polygons; mixed type means the face is composed of triangles and / or quadrilaterals and / or polygons. The belonging body identifier is the identifier of the body to which this boundary belongs. If the face is an interior face, the belonging body identifier includes the body identifiers of the two bodies sharing the face.
[0051] In this embodiment, the boundary surface data is stored according to the surface type, including:
[0052] ① For triangle and quadrilateral faces, obtain the indexes of the points that make up the same face, and use them as a face data entry;
[0053] ② For polygonal faces, obtain the number of points that make up the same face, as well as the index of each point on the face, as a face data; that is, count the number of points that make up the same face, use it as the first value, and then concatenate the indexes of each point to form a face data.
[0054] ③ For mixed-type faces, obtain the type of each face in sequence according to the number of faces. If the face type is not a polygon type, obtain the code value corresponding to the face type and the point index of the face as a face data. Otherwise, obtain the code value corresponding to the face type, the number of point data of the face, and the point index of the face as a face data.
[0055] For example, if the code value for a triangle type is 1, the code value for a quadrilateral type is 2, and the code value for a polygon type is 3, then a face data of "1,5,6,7" in a mixed type indicates that the mixed type contains a triangle type face, and the indices of the 3 points are 5, 6, and 7 respectively; a face data of "3,6,6,7,9,0,12,4" indicates that the mixed type contains a polygon type face, which consists of 6 points, and the indices of these 6 points are 6, 7, 9, 0,12, and 4 respectively.
[0056] It should be noted that when the point data constituting the same surface in the fluid mesh data is stored in a certain order, it can be used directly according to the actual situation, or the point order can be adjusted according to preset rules. Preferably, the point data is obtained in the following order: starting from any point on the surface, other point data of the same surface are obtained in a counterclockwise direction outward from the normal to the surface.
[0057] 2) Body data
[0058] It should be noted that volume data consists of multiple volume units. Volume attributes are used to describe the overall information of the volume, including but not limited to: volume identifier, volume name, volume unit type, number of volume units, and material type. The volume unit data of a volume describes the type of each volume unit included in the volume and the point indexes of the constituent volume units. The volume unit data of a volume serves as the detailed data of the volume and is associated with the corresponding volume.
[0059] Specifically, the attributes of a volume are described as follows: The volume identifier is the volume's unique ID. The volume element type refers to the type of volume elements that make up the volume, including: tetrahedron, pyramid, prism, hexahedron, polyhedron, and mixed types. Each volume element type corresponds to a unique code value; a polyhedron indicates that the number of faces in the volume element is not fixed, and a mixed type indicates that the volume element type is any combination of other types. The number of volume elements is the total number of volume elements that make up the volume. Material types include: fluid and solid.
[0060] Considering that the number of volume elements contained in a volume is not fixed, and the number of faces contained in a polyhedral volume element and the number of points contained in each face are also not fixed, this embodiment stores the volume element data of the volume according to the type of volume element, including:
[0061] ① For volume elements of tetrahedral, pyramidal, prism, and hexahedral types, obtain the point indices that make up the same volume element and treat them as a single volume element data.
[0062] For example, a body's attributes are: 1, box1, 1, 6, 1, which respectively represent: body identifier is 1, body name is box1, body element type is tetrahedron (the code value corresponding to tetrahedron type is 1), it is composed of 6 tetrahedron type body elements, and the corresponding material is fluid (the code value corresponding to fluid is 1). Then the data of the 6 body elements of this body are displayed in rows as follows:
[0063] 2,7,3,5,
[0064] 4,7,11,15,
[0065] 10,9,7,12,
[0066] 8,6,4,14,
[0067] 10,8,5,9,
[0068] 9,8,5,13,
[0069] Each of the above rows represents the point index that makes up a volume unit.
[0070] ② For polyhedral type volume elements, first count the number of faces contained in each volume element according to the number of volume elements, and use it as the main data of the corresponding volume element data. Then, obtain the number of point data that make up each face and the index of each point as a sub-data. One main data and multiple sub-data make up a volume element data.
[0071] ③ For mixed-type volume elements, obtain the type of each volume element sequentially according to the number of volume elements. If the volume element type is not a polyhedron, obtain the code value corresponding to the volume element type and the point index of the volume element as a single volume element data. Otherwise, use the code value corresponding to the volume element type as the first value and add it to the main data of the polyhedron type volume element data. That is, if the volume element type is a polyhedron, use the code value corresponding to the volume element type and the number of faces contained in the volume element as a single main data, and then obtain the number of point data that make up each face and the index of each point as a single sub-data. One main data and multiple sub-data constitute one volume element data.
[0072] For example, an entity has the attributes 2, box2, 6, 3, 1, which respectively represent: entity identifier is 2, entity name is box2, entity element type is mixed type (the code value corresponding to mixed type is 6), it consists of 3 entity elements, and the corresponding material is fluid (the code value corresponding to fluid is 1). Then the data of the 3 entity elements of this entity are as follows:
[0073] 1,7,9,10,3,
[0074] 4,4,6,7,8,5,3,1,2,
[0075] 5,5,
[0076] 6,3,2,6,7,11,14,
[0077] 3,3,2,6,
[0078] 4,7,11,10,9,
[0079] 5,2,3,7,5,10,
[0080] 7,3,4,8,7,10,13,1,
[0081] The first row above corresponds to a volume element data, where the first number 1 is the code value for a tetrahedron type, and 7, 9, 10, 3 are the 4 point indices of the tetrahedron; the second row corresponds to a volume element data, where the first number 4 is the code value for a hexahedron type, and 4, 6, 7, 8, 5, 3, 1, 2 are the 8 point indices of the hexahedron; the third to eighth rows correspond to a volume element data, where the third row is one main data entry, the first number 5 is the code value for a polyhedron type, the second number 5 indicates that the polyhedron has 5 faces, and the fourth to eighth rows are 5 sub-data entries corresponding to the 5 faces respectively. The first number of each sub-data entry is the number of point data for that face, followed by the point index of that face.
[0082] It should be noted that each type of volume element has a corresponding extraction order for its points. Based on the obtained point index order, and then according to the extraction order of the corresponding faces, the order of each face and the point index order of each face can be obtained. Therefore, in this embodiment, the volume element data only needs to store the point index of each volume.
[0083] For example, Figure 2 It is a tetrahedral type volume element. When the point index order obtained according to the point extraction order is 0,1,2,3, the order of the four faces and the point indices obtained according to the face extraction order are: 0,1,2; 1,0,3; 2,1,3; 3,0,2.
[0084] 3) Split the shared surface into boundary data
[0085] In this embodiment, based on the model, some shared surfaces are split so that two bodies with shared surfaces have different surfaces. This simplifies the subsequent solver process and improves the solver's efficiency.
[0086] Specifically, based on the identifier of the shared surface, two corresponding surfaces are identified. Then, based on the material type of the surfaces, it is determined whether these two surfaces are fluid or solid. This allows for the creation of three scenarios: flow-flow, flow-solid, and solid-solid model scenarios. Depending on the set boundary conditions, in the flow-flow model scenario, if both surfaces are of fluid material type, and the boundary condition for the shared surface is set to normal, the shared surface is treated as an internal surface and not split; otherwise, it is split. In the flow-solid and solid-solid model scenarios, if one of the two surfaces is of solid material type, since models containing solid surfaces do not have internal surfaces, the shared surface is split.
[0087] Split boundary data using the following steps:
[0088] ① For each point on the shared surface, remove duplicates and generate corresponding new points with the same coordinates, and add them to the global point array to generate new point indices;
[0089] ② Construct a new boundary, assign a unique boundary identifier, set the boundary name, set the boundary type to split face, set the owner body identifier to one of the owner body identifiers of the shared face, and keep other attributes consistent with the shared face. Modify the owner body identifier of the original shared face to another owner body identifier, and set the boundary type of the original shared face to split face.
[0090] ③ Generate new face data and associate it with new boundaries based on the type of shared face and the new point index.
[0091] 4) Constructing virtual entities
[0092] In this embodiment, in the flow-flow model scenario, if the two volumes belonging to the shared surface are made of the same material and the boundary type corresponding to the shared surface is an internal surface, a virtual volume is constructed, a virtual volume identifier is generated, and the volume identifier of the volume to which the shared surface belongs is associated, so that the solver can solve the problem uniformly, thereby improving the efficiency of the solver.
[0093] S12. After converting the unified mesh data into the mesh data corresponding to the solver, it is passed into the solver.
[0094] It should be noted that different solvers require different mesh data formats. For example, some solvers require data in StarCD4 format, while others require data in Reds format. For instance, StarCD4 format data includes three files: a VRT file for point data, a BND file for boundary data, and a CEL file for volume data. Each volume consists of two parts: metadata and raw data. The metadata describes the volume, including the index, volume element type, number of points, volume identifier, and material type; the raw data is the specific point data that makes up the volume.
[0095] In this embodiment, point data, boundary data, and volume data have been stored separately in step S11, so the conversion can be achieved quickly.
[0096] The conversion process will be explained below, following the steps for each of the three files in StarCD4:
[0097] ① Write the point indices and three coordinates of the points in the global point array into a vrt file;
[0098] ② Based on the volume attributes in the unified mesh data, construct the metadata of each volume and generate the volume index; based on the volume element data of the volume, construct the original data of each volume, generate the index of each face, combine the metadata and original data of each volume, and write them into a cel file;
[0099] ③ Based on the boundary attributes in the unified grid data and the volume index of the body to which the boundary belongs, construct each boundary, generate a boundary index, and write it to the bnd file.
[0100] It should be noted that in this embodiment, a virtual body is constructed in step S11, and the solver is extended to solve the virtual body as a whole. In this step, the metadata of the virtual body and the original data are also written into the cel file.
[0101] S13. Analyze the solver's output data and convert it into a unified tree-structured result data.
[0102] It should be noted that the solver is used to accurately simulate various engineering flow and heat transfer problems encountered in daily life; it supports steady-state solutions, transient solutions, compressible calculations, incompressible calculations, laminar flow and various turbulent flow models, multiphase flow models, porous media models, MRF models, heat transfer models, etc. It also provides a rich material database with complete boundary conditions such as inlet, outlet, wall, symmetry, and periodicity.
[0103] Depending on the variables to be solved, such as temperature, velocity, and pressure, different solvers produce results in different formats. To facilitate standardized processing of the output results, this step parses the solver's raw data, converts it into a unified tree-structured result data, and saves it in a fixed format. For example, the converted result data is saved as an HDF5 file.
[0104] Specifically, the raw data from the parsing solver is converted into a unified tree-structured result data, including:
[0105] Each entity name is treated as a first-level result, each variable to be solved is treated as a second-level result, and then the solution value of each variable to be solved is displayed sequentially according to each boundary, which is treated as a third-level result.
[0106] Preferably, the result data of the body or boundary is obtained through an interface.
[0107] Compared with existing technologies, the data conversion method provided in this embodiment for fluid simulation unifies mesh data, enabling efficient loading of mesh data and rapid conversion to other mesh data formats; it also unifies result data, unifying the result data of all solvers and enabling efficient loading of result data, thereby improving the efficiency of querying solution results.
[0108] Example 2
[0109] Another embodiment of the present invention discloses a data conversion system for fluid simulation, thereby implementing the data conversion method for fluid simulation in Embodiment 1. The specific implementation of each module is described in the corresponding description in Embodiment 1. Figure 3 As shown, the system includes:
[0110] The mesh data conversion module 101 is used to acquire the mesh data after the fluid model is meshed and convert the mesh data of the fluid model into unified mesh data.
[0111] The solution data conversion module 102 is used to convert the unified mesh data into the mesh data corresponding to the solver and then pass it into the solver;
[0112] The solution result conversion module 103 is used to parse the output data of the solver and convert the output data into a unified tree-shaped result data.
[0113] Since this embodiment and the aforementioned data conversion method in fluid simulation are related and can be referenced each other, and this is a repetition, they will not be repeated here. Because this system embodiment shares the same principle as the above method embodiment, it also possesses the corresponding technical effects of the above method embodiment.
[0114] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0115] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method of data conversion in a fluid simulation, characterized by, Includes the following steps: The process involves: acquiring the mesh data of the fluid model after meshing, converting the fluid model's mesh data into unified mesh data; obtaining the material types of two bodies based on the body identifiers of the shared surfaces in the fluid model's mesh data; when both bodies are of fluid material type, identifying whether the shared surface is an internal surface based on the boundary conditions of the shared surface; if not, splitting the shared surface into boundaries; when one of the two bodies is of solid material type, splitting the shared surface into boundaries; splitting the shared surface into boundaries includes: for each point on the shared surface, removing duplicates and generating corresponding new points with the same coordinates, adding them to the global point array, and generating new point indices; constructing a new boundary, assigning a unique boundary identifier, setting the boundary name, setting the boundary type to split surface, setting the body identifier to one of the body identifiers of the shared surface, keeping other attributes consistent with the shared surface, modifying the original shared surface's body identifier to another body identifier, and setting the original shared surface's boundary type to split surface; generating new surface data and associating it with the new boundary based on the shared surface type and the new point index; After converting the unified mesh data into the mesh data corresponding to the solver, it is passed into the solver; The output data of the parser is analyzed and converted into a unified tree-structured result data.
2. The method of claim 1, wherein, The unified mesh data includes: point, boundary, and volume data; wherein, point data includes point index and coordinate values in three-dimensional space; the boundary is composed of multiple faces, and the boundary data includes the boundary attributes and multiple face data; the volume is composed of multiple volume elements, and the volume data includes the volume attributes and multiple volume element data.
3. The method of claim 2, wherein, The attributes of the boundary include: boundary identifier, boundary name, boundary type, number of faces, face type, and body identifier; wherein the boundary type includes: wall, interior face, and split face; the face type includes: triangle, quadrilateral, polygon, and mixed type.
4. The method of claim 3, wherein, The face data is constructed according to the face type, including: For triangles and quadrilaterals, obtain the indexes of the points that make up the same face, and use them as a face data entry. For polygonal faces, obtain the number of points that make up the same face, as well as the index of each point on the face, as a single face data entry. For mixed-type faces, obtain the type of each face in sequence according to the number of faces. If the face type is not a polygon type, obtain the code value corresponding to the face type and the index of the points that make up the face as a face data. Otherwise, obtain the code value corresponding to the face type, the number of points that make up the face, and the index of the points that make up the face in sequence as a face data.
5. The method of claim 2, wherein, The properties of the body include: body identifier, body name, body element type, number of body elements, and material type; wherein the body element type includes: tetrahedron, pyramid, prism, hexahedron, polyhedron, and hybrid type; the material type includes: fluid and solid.
6. The method of claim 5, wherein, The volume element data is constructed according to the volume element type, including: For volume elements of tetrahedral, pyramidal, prism, and hexahedral types, obtain the point indices that make up the same volume element and treat them as a single volume element data. For polyhedral volume elements, first count the number of faces contained in each volume element according to the number of volume elements, and use it as the main data of the corresponding volume element data. Then, obtain the number of point data that make up each face and the index of each point as a sub-data. One main data and multiple sub-data make up a volume element data. For mixed-type volume elements, obtain the type of each volume element in sequence according to the number of volume elements. If the volume element type is not a polyhedron type, obtain the code value corresponding to the volume element type and the point index of the volume element as a volume element data; otherwise, take the code value corresponding to the volume element type as the first value and add it to the main data of the polyhedron type volume element data.
7. The method of claim 2, wherein, The analytical solver outputs data, which is then converted into a unified tree-structured result data. This includes: treating each entity name as a first-level result, treating each variable to be solved as a second-level result, and then displaying the solution value for each variable to be solved sequentially according to each boundary as a third-level result.
8. A data conversion system in a fluid simulation, characterized by, include: The mesh data conversion module is used to acquire the mesh data of the fluid model after meshing and convert the mesh data of the fluid model into unified mesh data. Based on the body identifier of the shared surface in the mesh data of the fluid model, the material types of the two bodies are obtained. When both bodies are of fluid material type, the boundary conditions of the shared surface are used to identify whether the shared surface is an internal surface. If not, the shared surface is split into boundaries. When one of the two bodies is of solid material type, the shared surface is split into boundaries. Splitting the shared surface into boundaries includes: for each point on the shared surface, deduplication is performed and new points with the same coordinates are generated and added to the global point array to generate new point indices; a new boundary is constructed, a unique boundary identifier is assigned, a boundary name is set, the boundary type is set to split surface, the body identifier is set to one of the body identifiers of the shared surface, other attributes are the same as the shared surface, the original body identifier of the shared surface is modified to another body identifier, and the boundary type of the original shared surface is set to split surface; new surface data is generated and associated with the new boundary based on the type of the shared surface and the new point index. The solution data conversion module is used to convert uniform mesh data into mesh data corresponding to the solver before passing it into the solver; The solution result conversion module is used to parse the solver's output data and convert it into a unified tree-structured result data.