Method and system for calculating overall stress of structure in fluid and computer equipment
By extracting pressure result data and meshing in OpenFOAM software, the local and overall stress of the structure is calculated, and the problem of calculation time in the prior art is solved, and the overall stress of the structure in the fluid is achieved efficiently. calculate.
Patent Information
- Application Number
- CN202411245402.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-24
AI Technical Summary
The existing OpenFOAM-based hydrodynamic calculation method requires a large number of cyclic operations in the entire computing domain grid, resulting in low calculation time and low efficiency, making it difficult to apply to the overall stress calculation of large and complex geometric structures.
By extracting the pressure result data of the target structure in the fluid in OpenFOAM software, performing grid segmentation, calculating the local stress data on each effective surface, and calculating the overall stress of the structure based on these data, using a tetrahedral unit The force calculation is performed with the surface normal vector, reducing the number of cycle calculations.
This method greatly improves the calculation efficiency and can be used for the overall stress calculation of structures with a number of 50 million to 100 million grids. It has a wide range of application and high calculation efficiency. It is suitable for the stress analysis of large and complex geometric structures.
Smart Images

Figure CN119180235A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hydrodynamic calculation of marine engineering structures, and in particular to a solution for calculating the overall force of a structure in a fluid based on OpenFOAM. Background Art
[0002] OpenFOAM is a collection of C++ programs written for different flows.
[0003] The existing method for calculating the overall force of structures based on the hydrodynamic calculation results of OpenFOAM requires a large number of cyclic operations in the entire computational domain grid, which takes a long time and has low efficiency. Summary of the invention
[0004] In view of the shortcoming of long calculation time in the prior art, the present invention provides a solution for calculating the overall force of a structure in a fluid based on OpenFOAM without a large number of cyclic calculations.
[0005] In order to solve the above technical problems, the present invention is solved by the following technical solutions:
[0006] A method for calculating the overall force of a structure in a fluid comprises the following steps:
[0007] Calculate the pressure of the target structure in the target fluid according to the OpenFOAM software, and obtain several groups of result data corresponding to time based on keyword extraction, wherein the result data includes the center coordinates and pressure values corresponding to the center of each boundary unit body;
[0008] Meshing the target structure to obtain a plurality of tetrahedral units, and taking the faces of the obtained tetrahedral units located on the surface of the target structure as effective surfaces;
[0009] In each time step of the calculation domain, local force data corresponding to each effective surface is calculated based on the result data, and overall force data corresponding to the target structure in the current time step is calculated based on each local force data.
[0010] As an implementable method:
[0011] Perform force calculation based on the surface area, surface normal vector and surface pressure of the effective surface to obtain local force data corresponding to the effective surface;
[0012] The effective surface currently being subjected to force calculation is used as the target effective surface, and the tetrahedral unit containing the target effective surface is used as the target effective unit. The method for obtaining the surface area, surface normal vector and surface pressure of the target effective surface includes:
[0013] Taking the vertex in the target effective unit corresponding to the target effective surface as the target vertex;
[0014] Calculating the surface area of the target effective surface based on the target vertices;
[0015] Calculate a surface normal vector of the target effective surface based on the target vertex, wherein the surface normal vector is used to indicate a direction of a fluid force;
[0016] The centroid coordinates of the target effective surface are calculated based on the target vertices, and the pressure corresponding to the centroid coordinates is calculated based on the result data to obtain the surface pressure of the target effective surface.
[0017] As an implementable method, the specific steps of calculating the surface normal vector of the target effective surface based on the target vertex are:
[0018] The target vertices include a first vertex, a second vertex and a third vertex;
[0019] Constructing a first vector based on the first vertex and the second vertex;
[0020] Constructing a second vector based on the first vertex and the third vertex;
[0021] A normal vector is obtained by cross-multiplying the first vector and the second vector, and the surface normal vector is generated based on the obtained normal vector.
[0022] As an implementable method:
[0023] The target valid unit includes three target vertices and one remaining vertex;
[0024] Select any target vertex and the remaining vertices to construct a third vector;
[0025] Perform a dot product of the third vector and the normal vector;
[0026] When the dot product result is positive, the normal vector is used as the surface normal vector;
[0027] When the obtained dot product result is negative, the normal vector is rotated 180° to obtain the surface normal vector.
[0028] As an implementable method:
[0029] The component of the surface normal vector along the x direction is recorded as the first vector component, the component along the y direction is recorded as the second vector component, and the component along the z direction is recorded as the third vector component;
[0030] The local force data includes a first force component, a second force component and a third force component;
[0031] Perform force calculation based on the surface area, surface pressure and first vector component of the effective surface to obtain a first force component corresponding to the effective surface;
[0032] Perform force calculation based on the surface area, surface pressure and second vector component of the effective surface to obtain a second force component corresponding to the effective surface;
[0033] Force calculation is performed based on the surface area, surface pressure and the third vector component of the effective surface to obtain a third force component corresponding to the effective surface.
[0034] As an implementable method:
[0035] Calculate the centroid coordinates of the target effective surface based on the target vertices;
[0036] According to the centroid coordinates, searching for the center coordinates closest to the centroid coordinates to obtain reference coordinates, and using the pressure value corresponding to the center coordinates as the reference pressure value;
[0037] An interpolation calculation is performed based on the reference coordinates and the reference pressure value to obtain the pressure corresponding to the centroid coordinates, and to obtain the surface pressure of the target effective surface.
[0038] As an implementable method:
[0039] Uniquely number the vertices of all tetrahedral units;
[0040] Based on the numbering, determining a numbering set corresponding to each face in the tetrahedral unit, wherein the numbering set includes numbers of three vertices corresponding to the corresponding face;
[0041] The faces corresponding to sets of numbers that do not have duplicate numbers are regarded as valid surfaces.
[0042] As an implementable method:
[0043] The target fluid is ocean waves or a mixture of ocean waves and ocean currents.
[0044] The present invention also discloses a system for calculating the overall force of a structure in a fluid, comprising:
[0045] A simulation module is used to calculate the pressure of the target structure in the target fluid according to the OpenFOAM software, and obtain several groups of result data corresponding to time based on keyword extraction, wherein the result data includes the center coordinates and pressure values corresponding to the center of each boundary unit body;
[0046] A mesh generation module, used for meshing the target structure to obtain a plurality of tetrahedral units, and taking the faces of the obtained tetrahedral units located on the surface of the target structure as effective surfaces;
[0047] The force calculation module is used to calculate the local force data corresponding to each effective surface based on the result data, and calculate the overall force data corresponding to the target structure at the current time step based on each local force data.
[0048] The present invention further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any of the above-mentioned methods when executing the computer program.
[0049] Other features and advantages disclosed in the present invention will be described in the following description, or some features and advantages can be inferred or determined without doubt from the description, or can be learned by implementing the above-mentioned technology disclosed in this application.
[0050] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 It is a flow chart of a method for calculating the overall force of a structure in a fluid according to the present invention;
[0053] Figure 2 is a schematic diagram of a target structure in a target fluid;
[0054] Figure 3 For Figure 2 Schematic diagram of the result of re-meshing the target structure;
[0055] Figure 4 A schematic diagram of the process of calculating the local force data corresponding to the effective surface of the target;
[0056] Figure 5 for Figure 3 Schematic diagram of the surface normal vector of the i-th valid surface;
[0057] Figure 6 This is a schematic diagram of the offshore jacket model in the case;
[0058] Figure 7 for Figure 6Schematic diagram of the change curve of the resultant force in the x and y directions of the mid-tube frame model under the simulated wave impact. DETAILED DESCRIPTION
[0059] The present invention is further described in detail below in conjunction with embodiments. The following embodiments are for explanation of the present invention but the present invention is not limited to the following embodiments.
[0060] Reference Figure 1 , a method for calculating the overall force of a structure in a fluid, comprising the following steps:
[0061] S100, calculate the target structure in the target fluid (such as Figure 2 Based on the pressure of the time, several groups of result data corresponding to the time are obtained based on the keyword extraction;
[0062] The target fluid is ocean waves or a mixture of ocean waves and ocean currents.
[0063] The result data includes the center coordinates and pressure values corresponding to the center of each boundary unit body.
[0064] The pressure on the structure in the fluid working condition to be simulated is calculated using OpenFOAM software to obtain a group of pressure field data in the entire calculation area. This is a prior art and will not be described in detail in this specification.
[0065] The pressure result data calculated based on OpenFOAM software mainly consists of two parts: the results at the center of non-boundary unit bodies and the results at the center of boundary unit bodies, among which the results at the center of boundary unit bodies.
[0066] In actual use, the results at the centers of all boundary unit bodies can be quickly found by searching for keywords to form a series of time series result data files, namely the result data used in this embodiment; the name of each time series result data file is named according to the time it corresponds to, and the number of data rows in the time series result data file is the total number of centers of all boundary unit bodies; the data format of each row is the x, y, z coordinates of the center of each boundary unit body, and the corresponding pressure value at the center of the boundary unit body.
[0067] S200, meshing the target structure to obtain a plurality of tetrahedral units, and taking the faces of the obtained tetrahedral units located on the surface of the target structure as effective surfaces;
[0068] Meshing is a prior art, and this specification does not define it in detail. Figure 2 The result after meshing the structure shown in Figure 3 As shown, Figure 3 The outer surface of the middle structure includes a plurality of triangles, and each triangle is an effective surface.
[0069] In this embodiment:
[0070] Uniquely number the vertices of all tetrahedral units;
[0071] Based on the numbering, determining a numbering set corresponding to each face in the tetrahedral unit, wherein the numbering set includes numbers of three vertices corresponding to the corresponding face;
[0072] The faces corresponding to sets of numbers that do not have duplicate numbers are regarded as valid surfaces.
[0073] The faces of the tetrahedral unit that are only located on the surface of the target structure will not be shared by other tetrahedral units. In this embodiment, each face of each tetrahedral unit is characterized by a number set; the absence of repeated number sets indicates that the face corresponding to the number set only appears in one tetrahedral unit, so it can be determined that it is located on the surface of the target structure and is a valid surface.
[0074] The water pressure values at the centers of all boundary cells obtained by OpenFOAM are isotropic and non-directional, and the impact force of the water pressure on the surface of the marine structure must be perpendicular to the surface of the structure. Therefore, the direction of the water force can only be determined by the directionality of the surface of the structure. This embodiment determines the effective surface by re-dividing the grid, so as to facilitate the subsequent determination of the direction of the water force based on the effective surface.
[0075] S300, in each time step of the calculation domain, local force data corresponding to each effective surface is calculated based on the result data, and overall force data corresponding to the target structure in the current time step is calculated based on each local force data.
[0076] S310, calculating local force data corresponding to the target effective surface;
[0077] The effective surface currently being subjected to force calculation is used as the target effective surface, and the tetrahedral unit containing the target effective surface is used as the target effective unit. In this embodiment, force calculation is performed based on the surface area, surface normal vector and surface pressure of the target effective surface to obtain local force data corresponding to the target effective surface;
[0078] Reference Figure 4 , specifically:
[0079] S311, taking the vertex in the target effective unit corresponding to the target effective surface as the target vertex;
[0080] That is, three vertices in the numbered set corresponding to the target effective surface are taken as target vertices.
[0081] S312, calculating the surface area of the target effective surface based on the target vertex;
[0082] The target effective surface is a triangle. The coordinates of the three vertices of the triangle are known, and those skilled in the art can easily calculate its area, so it will not be described in detail here.
[0083] S313, calculating a surface normal vector of the target effective surface based on the target vertex, wherein the surface normal vector is used to indicate a direction of a fluid force;
[0084] The target effective unit includes three target vertices and one remaining vertex, refer to Figure 5 , Figure 5 The green triangle face is the i-th effective surface of the target structure. Figure 5 Taking the effective unit shown as an example, the three target vertices of the effective unit are recorded as the first vertex A, the second vertex B and the third vertex C, and the remaining vertices are recorded as D.
[0085] The specific steps to obtain the surface normal vector are:
[0086] The first vector is constructed based on the first vertex A and the second vertex B
[0087] The second vector is constructed based on the first vertex A and the third vertex C
[0088] The first vector and the second vector Cross product to get the normal vector The calculation formula is as follows:
[0089]
[0090] Where i represents the i-th valid surface.
[0091] Select any target vertex (A, B or C) and the remaining vertex D to construct a third vector;
[0092] The third vector and the normal vector Perform dot product to determine the normal vector Whether it is pointing to the inside of the target structure;
[0093] When the dot product result is positive, it means that the normal vector Pointing to the inside of the target structure, the normal vector as the surface normal vector;
[0094] When the dot product result is negative, it means that the normal vector does not point to the inside of the target structure, then the normal vector Rotate 180° to align it with the direction of the fluid force and obtain the surface normal vector.
[0095] In this embodiment, after obtaining the surface normal vector, the three components of the surface normal vector along the x, y, and z directions are determined. The component along the x direction is the first vector component. The component along the y direction is the second vector component The component along the z direction is the third vector component
[0096] It can be expressed as:
[0097]
[0098] Please note that in the above formula (x in ,y in , z in ) is the surface normal vector, that is, the normal vector calculated above Or rotate the normal vector by 180°
[0099] S314. Calculate the centroid coordinates of the target effective surface based on the target vertices, and calculate the pressure corresponding to the centroid coordinates based on the result data to obtain the surface pressure of the target effective surface.
[0100] The specific steps are:
[0101] The centroid coordinates of the target effective surface are calculated based on the target vertices. The coordinates of the three vertices of the corresponding triangle are known. Calculating the centroid of the triangle is a prior art and will not be described in detail here.
[0102] According to the centroid coordinates, the center coordinates closest to the centroid coordinates are found to obtain reference coordinates, and the pressure value corresponding to the center coordinates is used as the reference pressure value, that is, the center coordinates closest to the centroid coordinates are obtained from the result data calculated by the above-mentioned OpenFOAM software based on the calculation domain. Those skilled in the art can use any of the existing publicly available methods for finding the nearest point to determine the center coordinates closest to the centroid coordinates.
[0103] Interpolation calculation is performed based on the reference coordinates and the reference pressure value to obtain the pressure corresponding to the center of mass coordinates and the surface pressure of the target effective surface. Those skilled in the art may adopt any existing publicly available mathematical interpolation method to obtain the surface pressure based on the reference coordinates, the reference pressure value and the center of mass coordinates.
[0104] The existing method for calculating the overall force of a structure requires traversing all grids in the entire computational domain through a large number of loop operations. This step consumes a lot of time, resulting in the existing scheme being only applicable to cases involving small-scale grids. For cases involving fluid-structure interactions with 50 million to 100 million grids, it will be difficult to apply due to the huge amount of loop operations.
[0105] This embodiment uses the particularity of the data structure of the calculation results of OpenFOAM to quickly find the pressure field data group at the center of the boundary unit body by searching for keywords, and extracts the pressure results corresponding to each effective surface of the structure surface in the data group by the position matching method for subsequent overall force calculation. Compared with the existing technology, this solution does not require a large number of cyclic calculations, and can save a lot of time when calculating the overall force of large and complex geometric structures such as offshore jackets. It can be applied to the overall force calculation of structures with 50 million to 100 million grids, with a wide range of applications and high calculation efficiency.
[0106] S315, calculating the local force data corresponding to the target effective surface;
[0107] The local force data includes the force components of the target effective surface along the x, y, and z directions. In this embodiment, the force calculation is performed based on the surface area, surface pressure, and various vector components of the target effective surface to obtain the force components corresponding to the target effective surface. The calculation formula is as follows:
[0108]
[0109] in:
[0110] f ix represents the force component of the i-th effective surface in the x direction, recorded as the first force component;
[0111] f iy represents the force component of the i-th effective surface in the y direction, recorded as the second force component;
[0112] f iz represents the force component of the i-th effective surface in the z direction, recorded as the third force component;
[0113] p i (x i ,y i , z i ) represents the force on the mass center of the i-th effective surface, that is, the surface pressure;
[0114] S i represents the surface area of the i-th effective surface;
[0115] The first vector component representing the i-th effective surface;
[0116] The second vector component representing the i-th effective surface;
[0117] Represents the third vector component of the i-th effective surface.
[0118] S320, calculating and obtaining the overall force data of the target structure based on the local force data corresponding to each effective surface;
[0119] Based on step S210, the local force data corresponding to each effective surface is calculated to obtain the force components of each effective surface along the x, y, and z directions;
[0120] Based on the force direction, each force component is integrated to obtain the overall force data of the target structure. The calculation formula is as follows:
[0121] F x =∑f ix
[0122] F y =∑f iy
[0123] Fz=∑f iz
[0124] in:
[0125] F x It represents the resultant force corresponding to the entire target structure in the x direction;
[0126] F x It represents the resultant force corresponding to the entire target structure in the y direction;
[0127] F z It represents the resultant force of the entire target structure in the y direction.
[0128] In this embodiment, the distributed forces on all effective units are integrated to obtain the resultant force on the entire structure, which can improve the efficiency and accuracy of the calculation to a certain extent.
[0129] In summary, the method for calculating the overall force of a structure in a fluid proposed in the present invention is simple and highly accurate. Even for a structure with a complex geometric shape and an extremely large number of grids, the overall force of the structure in a fluid can be quickly calculated.
[0130] The following is an application example of the calculation method for calculating the overall stress of an offshore jacket under the impact of waves. The specific steps are as follows:
[0131] 100. Use SOLIDWORKS software to build the catheter rack model, and then import it into OpenFOAM software.
[0132] The catheter rack model constructed in this case is as follows Figure 6 shown.
[0133] The OpenFOAM software is used to mesh the jacket model. In this case, the number of meshes is 62,171,856.
[0134] The wave parameters are set on the OpenFOAM software according to the wave conditions to be simulated. The wave parameters are shown in Table 1 below. The OpenFOAM software is set to calculate the initial time as 0s, the calculation interval as 0.2s, and the total calculation time as 144s.
[0135] Table 1 Parameters of ocean waves
[0136]
[0137] 200. Run OpenFOAM software to perform calculations to obtain a group of pressure field data of the jacket in the fluid calculation area at each calculation time point.
[0138] The pressure field data group at the center of all boundary units in the computational domain is quickly found and extracted through keywords, that is, the result data corresponding to each time step. This process takes only 0.2s per time step.
[0139] 300. Tetrahedron the catheter rack to screen out effective units and effective surfaces.
[0140] 400. Calculate the local force data corresponding to each effective surface at the current time step;
[0141] Based on the method disclosed in step S310 above, based on the extracted result data, the pressure corresponding to all effective surfaces of the jacket surface is calculated by position matching method, so as to calculate and obtain the wave force on the jacket surface. This process takes only 0.02s per time step.
[0142] 500. Calculate the overall stress condition of the jacket at the current time step;
[0143] Based on the method disclosed in the above step S320, the overall force data of the target structure is calculated based on each local force data;
[0144] Step 400 and step 500 are repeated until the calculation of all time steps in the current calculation domain is completed.
[0145] In this case, through the calculation of the above steps, the result of the combined force in the x and y directions on the jacket under the impact of waves in the calculation time domain is obtained as follows: Figure 7 As shown, Fx represents the curve diagram of the force on the catheter frame in the x direction, and Fy represents the curve diagram of the force on the catheter frame in the y direction. Figure 7 It can be seen that the maximum resultant force in the x-direction is 17501.98783 kN, and the resultant force in the y-axis direction always tends to 0, and this value of 0 is consistent with physical reality.
[0146] Another embodiment provides a system for calculating the overall force of a structure in a fluid, comprising:
[0147] A simulation module is used to calculate the pressure of the target structure in the target fluid according to the OpenFOAM software, and obtain several groups of result data corresponding to time based on keyword extraction, wherein the result data includes the center coordinates and pressure values corresponding to the center of each boundary unit body;
[0148] A mesh generation module, used for meshing the target structure to obtain a plurality of tetrahedral units, and taking the faces of the obtained tetrahedral units located on the surface of the target structure as effective surfaces;
[0149] The force calculation module is used to calculate the local force data corresponding to each effective surface based on the result data, and calculate the overall force data corresponding to the target structure at the current time step based on each local force data.
[0150] Furthermore, the force calculation module includes a local calculation unit and an overall calculation unit;
[0151] The local calculation unit is used to perform force calculation based on the surface area, surface normal vector and surface pressure of the effective surface to obtain local force data corresponding to the effective surface;
[0152] The overall calculation unit is used to calculate and obtain the overall force data of the target structure based on the local force data corresponding to each effective surface.
[0153] Further, the local calculation unit includes a coordinate extraction unit, an area calculation unit, a normal vector calculation unit, a pressure calculation unit and a force calculation unit, and the effective surface currently being subjected to force calculation is used as a target effective surface, and the tetrahedral unit containing the target effective surface is used as a target effective unit;
[0154] The coordinate extraction unit is used to extract the vertex in the target effective unit corresponding to the target effective surface as the target vertex;
[0155] The area calculation unit is used to calculate the surface area of the target effective surface based on the target vertex;
[0156] The normal vector calculation unit is used to calculate the surface normal vector of the target effective surface based on the target vertex, and the surface normal vector is used to indicate the direction of the fluid force;
[0157] The pressure calculation unit is used to calculate the centroid coordinates of the target effective surface based on the target vertices, and calculate the pressure corresponding to the centroid coordinates based on the result data to obtain the surface pressure of the target effective surface.
[0158] Another embodiment provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned method of calculating the overall force of a structure in a fluid when executing the computer program.
[0159] The method of the invention is simple and can be encoded into corresponding software. The software occupies little memory and is easy to promote.
[0160] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0161] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0162] The present invention is described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0163] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0165] It should be noted that:
[0166] The "one embodiment" or "embodiment" mentioned in the specification means that the specific features, structures or characteristics described in conjunction with the embodiment are included in at least one embodiment of the present invention. Therefore, the phrases "one embodiment" or "embodiment" appearing in various places throughout the specification do not necessarily refer to the same embodiment.
[0167] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
Claims
1. A method for calculating the overall force of a structure in a fluid, characterized in that The following steps are involved: Calculate the pressure of the target structure in the target fluid according to the OpenFOAM software, and obtain several groups of result data corresponding to time based on keyword extraction, wherein the result data includes the center coordinates and pressure values corresponding to the center of each boundary unit body; Meshing the target structure to obtain a plurality of tetrahedral units, and taking the faces of the obtained tetrahedral units located on the surface of the target structure as effective surfaces; In each time step of the calculation domain, local force data corresponding to each effective surface is calculated based on the result data, and overall force data corresponding to the target structure in the current time step is calculated based on each local force data.
2. A method for calculating the overall force of a structure in a fluid according to claim 1, characterized in that: Perform force calculation based on the surface area, surface normal vector and surface pressure of the effective surface to obtain local force data corresponding to the effective surface; The effective surface currently being subjected to force calculation is used as the target effective surface, and the tetrahedral unit containing the target effective surface is used as the target effective unit. The method for obtaining the surface area, surface normal vector and surface pressure of the target effective surface includes: Taking the vertex in the target effective unit corresponding to the target effective surface as the target vertex; Calculating the surface area of the target effective surface based on the target vertices; Calculate a surface normal vector of the target effective surface based on the target vertex, wherein the surface normal vector is used to indicate a direction of a fluid force; The centroid coordinates of the target effective surface are calculated based on the target vertices, and the pressure corresponding to the centroid coordinates is calculated based on the result data to obtain the surface pressure of the target effective surface.
3. A method for calculating the overall force of a structure in a fluid according to claim 2, characterized in that: The specific steps of calculating the surface normal vector of the target effective surface based on the target vertex are: The target vertices include a first vertex, a second vertex and a third vertex; Constructing a first vector based on the first vertex and the second vertex; Constructing a second vector based on the first vertex and the third vertex; A normal vector is obtained by cross-multiplying the first vector and the second vector, and the surface normal vector is generated based on the obtained normal vector.
4. A method for calculating the overall force of a structure in a fluid according to claim 3, characterized in that: The target valid unit includes three target vertices and one remaining vertex; Select any target vertex and the remaining vertices to construct a third vector; Perform a dot product of the third vector and the normal vector; When the dot product result is positive, the normal vector is used as the surface normal vector; When the obtained dot product result is negative, the normal vector is rotated 180° to obtain the surface normal vector.
5. A method for calculating the overall force of a structure in a fluid according to claim 4, characterized in that: The component of the surface normal vector along the x direction is recorded as the first vector component, the component along the y direction is recorded as the second vector component, and the component along the z direction is recorded as the third vector component; The local force data includes a first force component, a second force component and a third force component; Perform force calculation based on the surface area, surface pressure and first vector component of the effective surface to obtain a first force component corresponding to the effective surface; Perform force calculation based on the surface area, surface pressure and second vector component of the effective surface to obtain a second force component corresponding to the effective surface; Force calculation is performed based on the surface area, surface pressure and the third vector component of the effective surface to obtain a third force component corresponding to the effective surface.
6. A method for calculating the overall force of a structure in a fluid according to any one of claims 2 to 5, characterized in that: Calculate the centroid coordinates of the target effective surface based on the target vertices; According to the centroid coordinates, searching for the center coordinates closest to the centroid coordinates to obtain reference coordinates, and using the pressure value corresponding to the center coordinates as the reference pressure value; An interpolation calculation is performed based on the reference coordinates and the reference pressure value to obtain the pressure corresponding to the centroid coordinates, and to obtain the surface pressure of the target effective surface.
7. A method for calculating the overall force of a structure in a fluid according to any one of claims 1 to 5, characterized in that: Uniquely number the vertices of all tetrahedral units; Based on the numbering, determining a numbering set corresponding to each face in the tetrahedral unit, wherein the numbering set includes numbers of three vertices corresponding to the corresponding face; The faces corresponding to sets of numbers that do not have duplicate numbers are regarded as valid surfaces.
8. A method for calculating the overall force of a structure in a fluid according to any one of claims 1 to 5, characterized in that: The target fluid is ocean waves or a mixture of ocean waves and ocean currents.
9. A system for calculating the overall force of a structure in a fluid, characterized in that include: A simulation module is used to calculate the pressure of the target structure in the target fluid according to the OpenFOAM software, and obtain several groups of result data corresponding to time based on keyword extraction, wherein the result data includes the center coordinates and pressure values corresponding to the center of each boundary unit body; A mesh generation module, used for meshing the target structure to obtain a plurality of tetrahedral units, and taking the faces of the obtained tetrahedral units located on the surface of the target structure as effective surfaces; The force calculation module is used to calculate the local force data corresponding to each effective surface based on the result data, and calculate the overall force data corresponding to the target structure at the current time step based on each local force data.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.
