A kind of method that generates three-dimensional finite element mesh
[technical field]
The present invention relates to computer image processing technology, relate in particular to a kind of method that generates three-dimensional finite element mesh.
[background technology]
In the middle of producing in various manufacturing industry, manufacture and design in the middle of the process such as automobile product, need carry out stressed and deformation analysis, fluid mobility analysis or electromagnetism domain analysis to structure member, to reach save design cost, the purpose in shortening launch cycle.Usually in computer, set up the three-dimensional stereo model of a product, with basis as analysis.Present Pro-Engineer, CATIA and Patran can be used as D modeling tool, and CAD (Computer Aided Drafting) is generally used for as basic finite element analysis instrument.
As the initial process of dimensional finite element method, at first a structure to be analyzed or mechanical part are divided into a certain size junior unit, this process is called grid dividing; Specifically be to finish the grid dividing of 3D solid by the three-dimensional model occupation space being divided into a lot of little solid elements.Solid element is a kind of simple geometric shape, for example tetrahedron or hexahedron.Solid element can be divided into tetrahedron element, hexahedral element, prism elements and pyramid unit according to their profile difference.Because more to the big needed element number of model division tetrahedron element, be easy to generate the cell configuration distortion, so tetrahedron element mesh quality of acquisition for finite element analysis is poor, computational accuracy is lower.Hexahedral element does not then have above shortcoming comparatively speaking, therefore, uses hexahedral element to carry out grid dividing usually, so that obtain higher computational accuracy and counting yield.
As shown in Figure 1.Fig. 1 a to 1e represents under the usual method product model to be carried out the process that finite element grid is divided.It among the figure three-dimensional finite element model of a cup.The initial mathematical model of cup is a cad model.Usually, in order to generate the three-dimensional finite element model of cup geometric configuration, at first the entity grid dividing to be carried out in the bottom of cup, shown in Figure 1A.Among Figure 1B and the 1C, the entity grid dividing of wall of cup is to form by the entity grid cell stacking that the entity grid cell at the bottom of the cup is carried out suitable shape.A lot of pre-processing softwares all have the function of stacking, also can be called mesh mapping, by the veil lattice are carried out projection according to a certain direction, set the entity number of grid between the projection then, just can access required entity grid.Among Fig. 1 d and the 1e, the stacking that carries out suitable shape by the entity grid cell with wall of cup obtains the 3D solid grid cell of cup handle.By above process, obtain the entity grid of final cup.
The method that above-mentioned finite element grid generates is that at first to need entity division be the fritter of some regular shape, can be divided into the handle of columniform cup and rectangle such as the cup among the figure.After these several fritters are all divided the entity grid, obtain whole entity grid.Promptly determine node, such as the junction of the handle of cup and wall of cup promptly is the node place by manual; Then according to definite sequence formation solid element one by one, and finally obtain three-dimensional entity grid.This is a very complicated process, therefore, so that generate high-quality grid, just require to have the sufficient time and the experience of long time integration to accomplish.For example, to an automobile engineer, finally generating the hexahedron finite element grid from cad model needs about three to six months.
Result of calculation by in the past and test are to recently seeing, result of calculation after hexahedral mesh is divided is the most near correct result, pentahedron secondly, tetrahedron is the poorest, but usually owing to the reason such as irregular of physical form, the hexahedral mesh that uses software to mark off rule automatically is impossible, so cae analysis slip-stick artist majority all adopts the method for manual division grid to obtain satisfied relatively hexahedral mesh.Just can recognize that from letter it is very complicated manually to divide the hexahedral mesh process, the shape of a common medium difficulty all needs several months usually if carry out hexahedral mesh and divide and also need a very long time.Because the 3D grid modeling need take a large amount of time, caused a bottleneck for follow-up analysis and design, be the difficult problem on a basis of engineering design field.
[summary of the invention]
The technical problem to be solved in the present invention provides a kind of short time, high-quality, help the method for the generation three-dimensional finite element analysis grid that high-level efficiency analyzes.
The present invention realizes by following technical scheme:
A kind of method that generates three-dimensional finite element mesh may further comprise the steps:
101, carry out the two-dimensional surface grid dividing on the surface of object entity three-dimensional model;
102, produce the entity basic grid that surrounds three-dimensional model by the entity basic grid of setting up by contour projection;
103, the two-dimensional surface grid is inserted into after the entity basic grid, removes the entity grid outside the object entity veil lattice, obtain the entity 3D grid of ultimate demand.
Further, the present invention is further comprising the steps of before step 101: the three-dimensional model of setting up the object entity.
Further, step 102 of the present invention may further comprise the steps:
301, the projection on the plane of object entity, the contour projection of the object entity that draws:
302, grid dividing is carried out on the plane at contour projection place;
303, based on the grid on plane, described contour projection place, the height of contrast object entity carries out the grid stacking by the two-dimensional grid to described plane and forms the entity basic grid.
Further, the described projection of step 301 of the present invention is vertical direction or non-perpendicular direction.
Further, the described stacking grid of step 303 of the present invention is hexahedron, pentahedron or tetrahedron.
Further, the entity grid outside the described removal object of the step 103 of the present invention entity veil lattice adopts and penetrates algorithm.
Further, the algorithm that penetrates of the present invention may further comprise the steps:
701, choose first arbitrfary point in the solid element;
702, choose second arbitrfary point outside the entity basic grid;
703, connect described first arbitrfary point and second arbitrfary point, calculate the number of times that passes through of line passed between described first arbitrfary point and second arbitrfary point object entity grid surface;
704, if the described number of times that passes through is an odd number, then described solid element is positioned within the surface mesh of described object entity; If the described number of times that passes through is an even number, then described solid element is positioned at outside the surface mesh of described object entity.
Further, the present invention is further comprising the steps of: by node is transformed to the second place from primary importance, eliminate the wedge angle that protrudes in outside the veil lattice.
Owing to adopted above technical scheme, two-dimensional surface grid and entity net substantially scrupulously and respectfully all are easy to obtain, owing to adopted and penetrate algorithm, the process required time that generates final entity grid is compared classic method and is just shortened greatly, and the workload of some months can be finished in several days even several hrs.Simultaneously because the 3D solid grid that generates is a hexahedral mesh, so mesh quality than higher, the error of calculation of generation also can be improved significantly.
[description of drawings]
The three-dimensional finite element mesh generative process synoptic diagram that Fig. 1 has for oneself.
Fig. 2 generates three-dimensional finite element mesh process synoptic diagram for the present invention.
Fig. 3 a to Fig. 3 e is respectively the enlarged drawing to Fig. 2 b, 2d, 2e, 2f and 2g.
Fig. 4 is the generative process process flow diagram of three-dimensional finite element mesh of the present invention.
Fig. 5 is the synoptic diagram of single grid cell among the present invention.
[embodiment]
The invention will be further elaborated below in conjunction with the drawings and specific embodiments.
Shown in Fig. 2, Fig. 3 a to Fig. 3 e, be example with the three-dimensional finite element mesh generative process of a cup.At the entity of a cup, shown in Fig. 2 a, at first need to set up its three-dimensional model, can set up by the CAD modeling software.In second step, cup's surface is set up grid.Utilize the cad model of cup to set up the veil lattice, as Fig. 2 b and Fig. 3 a.The generation method of veil lattice is conventional mesh division methods, and its ultimate principle is to connect by node to obtain corresponding veil lattice.For engineering analysis personnel, very simple realization.In the 3rd step, the contour projection of the cup cad model that draws is shown in Fig. 2 c and Fig. 3 b, the vertical projection on the surface level of placement of cup.Suppose that the cup cad model is in that (Z) in the coordinate system, the Z axle is as vertical direction for X, Y, contour projection generates, and Fig. 2 c and Fig. 3 b have represented projected outline's wire shaped of the cup end and handle in X-Y plane.Described projection also can be non-vertical direction.The 4th step, by to contour projection institute shape face carry out grid dividing, shown in Fig. 2 d and 3b, generated the grid on the cup end and plane, place thereof.In the 5th step, generate hexahedron entity basic grid.Based at the bottom of the cup and the grid on plane, place, the height of contrast cup, by at the bottom of the cup and the two-dimensional grid on plane, place carry out the hexahedral mesh stacking, integral body has formed a hexahedral shape, has generated the entity basic grid, shown in Fig. 2 e and 3c.The entity basic grid also is a kind of form of veil lattice, is the two dimensional surface grid, can utilize existing software to realize.By selecting suitable grid height, the size of resulting each hexahedral element all is fit to the requirement of computational accuracy.When the higher computational accuracy of needs, grid dividing can be got very tinyly, at this time the grid height is just selected smaller; And be not under the very high situation to accuracy requirement, can suitably divide grid more greatly, at this time the grid height will be corresponding big.The 6th step, by being carried out the position with the projection bottom profile line of Fig. 3 c entity basic grid, Fig. 3 a veil lattice dock, the surface mesh of cup shown in Fig. 3 a is inserted in the entity basic grid, shown in Fig. 2 f and Fig. 3 d.The 7th step, in the entity basic grid, remove the part outside the veil lattice that are enclosed in cup, remaining hexahedral mesh is exactly the 3D solid grid of the cup that will obtain.Shown in Fig. 3 e.The grid that is used for stacking also can be pentahedron or tetrahedron.The determining of the hexahedral mesh that these are remaining calculates the back and obtains by penetrating algorithm.Promptly a number of times that connects the grid surface that line passed of the arbitrfary point outside solid element (getting the arbitrfary point in solid element) and the entity basic grid obtains by calculating.If this number of times is an odd number, illustrate that solid element is positioned within the surface mesh of cup; If this number of times is an even number, illustrate that solid element is positioned at outside the surface mesh of cup.
Fig. 4 is a process flow diagram of the present invention.According to Fig. 4, flow process 402 is at first set up a cad model; Flow process 404 obtains the projection of mould shapes on a face according to cad model; Flow process 406 according to flow process 404 resulting projection of shape, is carried out grid dividing to this plane; Flow process 408 by dividing the bottom surface grid that obtains, is carried out the grid stacking, obtains the entity basic grid; Flow process 410, according to flow process 402 resulting cad models, coming that this mold surface is carried out the veil lattice divides, then flow process 410 and flow process 408 are docked according to the shape of projection line, the two-dimensional surface grid of model is inserted in three entity basic grids of model, thereby finishes flow process 412; At last, flow process 414 is removed the 3D grid that does not belong to product entity by penetrating algorithm, and remaining 3D solid grid is exactly the 3D solid grid of the cad model that will obtain.Thereby finish all flow processs.
Fig. 5 has explained the implementation procedure that penetrates algorithm noted earlier visually in detail.Wherein with marked with dotted lines be entity elementary cell grid, with solid marks be the veil lattice of entity, entity veil lattice have carried out docking insertion with entity elementary cell grid.According to Fig. 5, get the arbitrfary point in several solid elements arbitrarily, represent with E, F, G.Its mid point E and some G are positioned at outside the veil lattice.Point B appoints the point of getting outside the entity elementary cell.As seen, by the line of B point and other 3 some E, F, G, the number of times that line BE and line BG pass the veil lattice respectively is 0 and 2, is even number, thus can judging point E, G all be positioned at outside the veil lattice, so the solid element at its place also is positioned at outside the veil lattice.And line BF to pass the number of times of veil lattice be 1, be odd number, thus can be positioned within the veil lattice by judging point F, so the solid element at its place also is positioned within the veil lattice.By penetrating Algorithm Analysis, can distinguish out which unit easily and be our required reservation, which unit should be removed.
According to Fig. 5, some nodes in the solid element are A1 and A2 for example, and the solid element at their places has comprised some F, so these nodes need remain.Can be by changing the position of these nodes, getting in the position that makes them change to A1-1 and A2-1, thereby eliminates the wedge angle that protrudes in outside the veil lattice.This divides in the grid process at pre-processing software, only needs the use location movement directive to set certain displacement and just can realize.