CN115908739B - Method and system for rapidly generating high-fidelity structural grid on surface of complex terrain - Google Patents

Method and system for rapidly generating high-fidelity structural grid on surface of complex terrain Download PDF

Info

Publication number
CN115908739B
CN115908739B CN202310215984.4A CN202310215984A CN115908739B CN 115908739 B CN115908739 B CN 115908739B CN 202310215984 A CN202310215984 A CN 202310215984A CN 115908739 B CN115908739 B CN 115908739B
Authority
CN
China
Prior art keywords
grid
coordinate
array
layer
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310215984.4A
Other languages
Chinese (zh)
Other versions
CN115908739A (en
Inventor
李泽祥
冯毅
李鑫洋
孙鑫宇
刘伟毅
李树民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Fluid Power Innovation Center
Original Assignee
Chengdu Fluid Power Innovation Center
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Fluid Power Innovation Center filed Critical Chengdu Fluid Power Innovation Center
Priority to CN202310215984.4A priority Critical patent/CN115908739B/en
Publication of CN115908739A publication Critical patent/CN115908739A/en
Application granted granted Critical
Publication of CN115908739B publication Critical patent/CN115908739B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention relates to a method and a system for rapidly generating a high-fidelity structural grid on the surface of a complex terrain, wherein the method comprises the following steps: obtaining an STL format file with topographic data, wherein the topographic data comprises a plurality of triangular patches for representing geometric features of a topographic surface, and the patches are described by normal vectors and vertex coordinates, and the vertex coordinates are obtained from a projection coordinate system comprising X, Z which is perpendicular to each other and a Y axis; extracting a plurality of coordinate data (X, Y, Z) from the topographic data by adopting a coordinate value extraction method, and storing the coordinate data in the form of discrete points; generating a ground grid coordinate point array with regular ordering based on the coordinate data, and stretching the ground grid coordinate point array from the Y direction to form a target grid array; the near-ground grid can be orthogonally corrected through the angle relation of points in an XY plane and a ZY plane. The invention can rapidly generate the high-fidelity structural grid when facing complex terrains such as mountains, hills and the like.

Description

Method and system for rapidly generating high-fidelity structural grid on surface of complex terrain
Technical Field
The invention relates to the field of computational fluid dynamics simulation, in particular to a method and a system for rapidly generating a high-fidelity structural grid on the surface of a complex terrain.
Background
Clean and efficient new energy development is an important guarantee for sustainable development. Wind energy is used as a representative of a plurality of new energy sources, has the advantages of environmental protection, regeneration, large reserves, wide distribution and the like, and the generation of electricity by utilizing wind energy has been rapidly developed. In the development of wind power projects, wind resource assessment is a first key step, and the benefits of the wind power projects and the safety of wind turbines are directly affected. In addition, wind field calculation is also an important basis for research on problems such as weather forecast, flight safety analysis and the like.
To be able to evaluate or predict wind resources of an area, a simulation of the terrain surface of the area is typically performed, for example, using grid generation techniques to build a terrain grid model for simulating the terrain surface. And then, carrying out corresponding simulation or coupling by utilizing the terrain grid model, thereby realizing wind field simulation of the area so as to complete corresponding wind resource evaluation, weather forecast or flight safety analysis and the like. Wherein, generating a high-fidelity grid model for the terrain surface is one of the key steps in accurately performing wind field simulation.
In the conventional grid generation technology, there are generally two methods of generating a structured grid and an unstructured grid. In practical application, the structural grid is only suitable for a pattern with a regular shape, and the surface of the terrain (especially mountains, hilly terrains and the like) has different fluctuation, namely the surface of the terrain belongs to a complex and irregular geometric shape, so that it is difficult to generate the structural grid of the body fitting aiming at the surface of the terrain. Therefore, a method of generating an unstructured grid is generally selected in the existing wind field simulation and other applications. For example, chinese patent application publication No. CN108563867a discloses a method for implementing WRF and CFD coupling simulation of wind fields based on OpenFOAM, in which a terrain CFD model uses a triangular prism grid that is unstructured. The unstructured grid needs a larger memory during calculation, which puts higher demands on the calculation power of a computer, and on the other hand, the unstructured grid is difficult to recover the boundary, so that grid generation failure is likely to be caused.
Therefore, there is a need for a method that can quickly generate a high fidelity ground grid.
Disclosure of Invention
The invention aims to provide a method and a system for rapidly generating a high-fidelity structural grid of a complex terrain surface, which partially solve or alleviate the defects in the prior art and can rapidly and accurately generate the structural grid of the terrain surface of a body.
In order to solve the technical problems, the invention adopts the following technical scheme:
the method for rapidly generating the high-fidelity structural grid of the surface of the complex terrain comprises the following steps:
s101 acquires an STL format file having topographic data including: a plurality of triangular patches for representing geometric features of the complex terrain surface, the triangular patches being described by normal vectors and vertex coordinates, wherein the vertex coordinates are obtained from a projection coordinate system comprising: an X direction and a Z direction, and a vertical Y direction perpendicular to the X direction and the Z direction;
s102, extracting a plurality of coordinate data from a target range in the topographic data by adopting a coordinate value extraction method, and storing the plurality of coordinate data in the form of discrete points, wherein the coordinate data is expressed as (X, Y, Z);
s103, generating a first-layer ground grid array with regular ordering based on the coordinate data, and stretching the first-layer ground grid array from the Y direction to create a target grid array;
wherein S103 includes the steps of:
S31, determining a target calculation domain, acquiring coordinate data of all discrete points in the target calculation domain, and creating a one-dimensional array Xt, yt and Zt according to the acquired coordinate data by using an array creation method, wherein the one-dimensional array Xt, yt and Zt are respectively sets of coordinate values in the X, Y, Z directions, and NX multiplied by NZ coordinate data are arranged in each direction;
s32, sequencing the one-dimensional array Xt for the first time according to the size of the coordinate values in the one-dimensional array Xt, and synchronously changing the sequence of corresponding coordinate values Y, Z in the one-dimensional arrays Yt and Zt to correspondingly obtain one-dimensional arrays Xn, yn and Zn;
s33, converting the one-dimensional arrays Xn, yn and Zn which are subjected to the first sequencing into three-dimensional arrays Xc, yc and Zc with the size of [ NX ] [ NY ] [ NZ ], wherein the three-dimensional arrays Xc, yc and Zc comprise first-layer grid data of the ground in the Y direction;
s34, sorting the three-dimensional array Zc for the second time according to the coordinate values in the three-dimensional array Zc along the size of the Z direction, and synchronously changing the positions of the corresponding coordinate values in the three-dimensional array Xc and the Y c to enable the three-dimensional array Xc, the Y c and the Zc to form a first layer grid array of the ground in the Y direction;
S35, calculating grid distribution coefficients in the Y direction from the ground to the top of the target calculation domain in the target calculation domain according to preset parameters, and stretching the first-layer grid array of the ground through the grid distribution coefficients, so as to obtain an NY-1 layer grid array which is above the first-layer grid of the ground and has the size of [ NX ] [1] [ NZ ], wherein the first-layer grid array of the ground and the NY-1 layer grid array jointly form a calculation domain grid array;
s36, sampling the calculation domain grid array according to the target resolution to obtain a coordinate value X, Z of the target grid point;
s37 outputs the target grid array based on the coordinate values of the target grid points.
In some embodiments, prior to S35, further comprising the step of:
in the layer grids, starting from the second layer grid, correcting the coordinates of at least one discrete point in at least one upper layer grid in at least one plane through the included angle relation between the lower layer grid and the adjacent upper layer grid;
wherein, in the XY plane, the grids are numbered
Figure SMS_1
Correction amount for correcting coordinate value X of discrete point D of (c)
Figure SMS_2
The method comprises the following steps:
Figure SMS_3
the coordinate value X' corrected by the discrete point D is as follows:
Figure SMS_4
wherein ,
Figure SMS_5
and
Figure SMS_8
respectively two characteristic angles of < CBD, < ABD and discrete point A in XY plane 1 The coordinates of (2) are:
Figure SMS_11
grid number of
Figure SMS_7
Discrete point B 1 The coordinates of (2) are:
Figure SMS_10
grid number of
Figure SMS_13
Discrete point C 1 The coordinates of (2) are:
Figure SMS_14
grid number of
Figure SMS_6
The coordinates of the discrete point D are:
Figure SMS_9
grid number of
Figure SMS_12
In the ZY plane, the grids are numbered
Figure SMS_15
Correction of the coordinate value Z of the discrete point D of (C)
Figure SMS_16
The method comprises the following steps:
Figure SMS_17
the coordinate value Z' after the correction of the discrete point D is as follows:
Figure SMS_18
wherein ,
Figure SMS_19
and
Figure SMS_23
respectively two characteristic angles of +.CBD, +.ABD and discrete point A in ZY plane 2 The coordinates of (2) are:
Figure SMS_26
grid number of
Figure SMS_21
Discrete point B 2 The coordinates of (2) are:
Figure SMS_24
grid number of
Figure SMS_27
Discrete point C 2 The coordinates of (2) are:
Figure SMS_28
grid number of
Figure SMS_20
The coordinates of the discrete point D are:
Figure SMS_22
grid number of
Figure SMS_25
In some embodiments, before correcting the coordinates of at least one discrete point in at least one of the upper grids in at least one plane, the method further comprises the steps of:
calculating a sum of corrections in the Y direction for the X coordinate value of each corrected discrete point in the layer grid;
and when the sum is smaller than a preset first threshold value, continuing to correct in the current upper grid, otherwise, stopping correcting in the upper grid.
In some embodiments, calculating a sum of corrections in the Y-direction for the Z-coordinate value of each corrected discrete point in the layer grid;
and when the sum is smaller than a preset second threshold value, continuing to correct in the current upper grid, otherwise, stopping correcting in the upper grid.
In some embodiments, before the step of correcting coordinates of at least one discrete point in at least one of the upper grids in at least one plane, the method further comprises the step of:
calculating the sum of correction values of X coordinate values of each corrected discrete point in the current upper grid in the Y direction;
and when the sum is smaller than a preset first-layer correction threshold value, continuing to correct in the current upper-layer grid, otherwise, stopping correcting in the upper-layer grid.
In some embodiments, calculating a sum of correction values in the Y-direction for the Z-coordinate values of each corrected discrete point in the current upper grid;
and when the sum is smaller than a preset second-layer correction threshold value, continuing to correct in the current upper-layer grid, otherwise, stopping correcting in the upper-layer grid.
In some embodiments, the method further comprises the step of:
s104, setting boundary conditions, and exporting the target grid array into a target structure grid for simulating the complex terrain surface.
In some embodiments, S31 comprises:
reading vertex coordinate data preset by a user, and determining the target calculation domain based on the vertex coordinate data, wherein the vertex comprises: a first vertex (Xmin, zmin), a second vertex (Xmax, zmax);
judging whether the discrete point is positioned in the target calculation domain or not based on the vertex coordinate data, and identifying the discrete point positioned in the target calculation domain as a valid coordinate point;
and creating a one-dimensional array Xt, yt and Zt according to the coordinate data of the effective coordinate point by using an array creation method.
In some embodiments, NX is the number of coordinate values in the one-dimensional array Xn having the same numerical magnitude, and NZ is the number of discrete points along the Z direction; NZ is the number of discrete points along the Z direction; and NZ=N/NX, wherein N is the number of the effective coordinate points.
In some embodiments, S35 comprises:
reading a vertical grid point coordinate growth rate adjustment factor Fac preset by a user and the top height Ytop of a target calculation domain;
Constructing an array H (j) with the element range within the (0, 1) interval by using a hyperbolic tangent function tanh based on Fac and Ytop, and calculating a spacing coefficient dH (j) between adjacent vertical discrete points;
and calculating to obtain the vertical coordinates Yc of all discrete points in the target calculation domain in a point-by-point accumulation interval mode.
In some embodiments, the method of sampling in S36 includes: adjacent point interpolation, and/or spaced point extraction.
The invention also provides a system for rapidly generating the high-fidelity structural grid of the surface of the complex terrain, which corresponds to the method, and comprises the following steps:
a data acquisition module configured to acquire an STL format file having terrain data comprising: a plurality of triangular patches for representing geometric features of the complex terrain surface, the triangular patches being described by normal vectors and vertex coordinates, wherein the vertex coordinates are obtained from a projection coordinate system comprising: an X direction and a Z direction, and a vertical Y direction perpendicular to the X direction and the Z direction;
a data extraction module configured to extract a plurality of coordinate data from within a target range in the topographic data using a coordinate value extraction method, and store the plurality of coordinate data in the form of discrete points, wherein the coordinate data is represented as (X, Y, Z);
A grid generation module configured to generate a ground first layer grid array having a regular ordering based on the coordinate data, and stretch the ground first layer grid array from the Y direction to create a forming target grid array;
wherein the grid generation module comprises:
a calculation domain determining unit configured to determine a target calculation domain, obtain coordinate data of all discrete points in the target calculation domain, and create a one-dimensional array Xt, yt, zt according to the obtained coordinate data by using an array creation method, wherein the one-dimensional array Xt, yt, zt are respectively a set of coordinate values in X, Y, Z directions, and each direction has nx×nz coordinate data;
a primary ordering unit configured to perform primary ordering on the one-dimensional array Xt according to the size of the coordinate values in the one-dimensional array Xt, and synchronously change the order of the corresponding coordinate values Y, Z in the one-dimensional arrays Yt and Zt so as to correspondingly obtain one-dimensional arrays Xn, yn and Zn;
an array conversion unit configured to convert the one-dimensional arrays Xn, yn, zn, which have completed the first sorting, into three-dimensional arrays Xc, yc, zc of size [ NX ] [ NY ] [ NZ ], using an array conversion method, wherein the three-dimensional arrays Xc, yc, zc include first layer mesh data of the ground in the Y direction;
The secondary sequencing unit is configured to sequence the three-dimensional array Zc for the second time according to the size of the coordinate values in the three-dimensional array Zc along the Z direction, and synchronously change the positions of the corresponding coordinate values in the three-dimensional arrays Xc and Yc so that the three-dimensional arrays Xc, yc and Zc form a first layer of ground grid array in the Y direction;
the stretching unit is configured to calculate grid distribution coefficients in the Y direction from the ground to the top of the target calculation domain in the target calculation domain according to preset parameters, and stretch the first-layer grid array of the ground according to the grid distribution coefficients, so that a NY-1 layer grid array which is arranged on the first-layer grid of the ground and has the size of [ NX ] [1] [ NZ ] is created by stretching, and the first-layer grid array of the ground and the NY-1 layer grid array jointly form a calculation domain grid array;
a sampling unit configured to sample the computational domain grid array at a target resolution to obtain coordinate values X, Z of a target grid point;
an output unit configured to output the target grid array based on the coordinate values of the target grid points.
The beneficial technical effects are as follows:
The method starts with original terrain data (such as vector map data derived from a GIS system), and introduces key means such as secondary sorting, near-ground stretching and the like for generating the structural grid of a near-ground key region after comprehensively considering geometric characteristics of complex terrain surfaces (namely, large relief fluctuation of the terrain, the whole terrain surface can be regarded as the lower surface of a regular hexahedron in the process of dividing the structural grid) and the characteristics of the acquired coordinate data format of a projection coordinate system. The invention provides a grid generation mode of secondary sequencing and matching with near-ground stretching, so that the generated structural grid is more convenient for subsequent adjustment on precision (namely, is more beneficial to carrying out orthogonal correction on the grid of a near-ground area).
Further, the invention also provides a mode for correcting the horizontal coordinates of discrete points (also called grid points) by utilizing the included angle relation of adjacent micro-surface elements aiming at a new structural grid generated after secondary sorting and near-ground stretching treatment, the correction of the three-dimensional space grid structure is simplified on two planes (namely XY and ZY planes), the data calculation amount of the correction process is greatly reduced, and the requirement of the grid correction process (especially when the precision correction is carried out on a large-scale complex terrain grid) on the computer calculation force is remarkably reduced.
Therefore, the grid generation method provided by the invention can rapidly generate the high-fidelity structural grid aiming at the near-ground critical area under the synergistic effect of a plurality of means such as secondary sequencing, near-ground stretching, orthogonal correction and the like, so that accurate wind resource assessment can be rapidly and conveniently carried out on the near-ground critical area. The accurate wind resource assessment has critical influence on the safety operation and construction of wind power generation equipment or high-rise buildings (particularly oversized bridges and the like) in complicated mountain areas and hilly terrains, and has important significance on the implementation of air-drop materials by a conveyor or an unmanned aerial vehicle.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. Like elements or portions are generally identified by like reference numerals throughout the several figures. In the drawings, elements or portions thereof are not necessarily drawn to scale. It will be apparent to those of ordinary skill in the art that the drawings in the following description are of some embodiments of the invention and that other drawings may be derived from these drawings without inventive faculty.
FIG. 1a is a flow chart of a fast-generating structural grid in an exemplary embodiment of the present invention;
FIG. 1b is a flow chart of generating a structural grid by secondary ranking, near-ground stretching in an exemplary embodiment of the invention;
FIG. 2 is a flow chart of a method for quickly generating a structural grid according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a meshing process according to an embodiment of the present invention;
FIG. 4 is a schematic view of a complex hilly terrain;
FIG. 5 is a schematic diagram of a feature angle (α - β)/2 for quadrature correction in an exemplary embodiment of the present invention;
FIG. 6 is a graph illustrating the maximum deflection angle distribution of an orthogonal pre-correction grid according to an embodiment of the present invention;
FIG. 7 is a graph illustrating the maximum deflection angle distribution of an orthogonally corrected grid in accordance with one embodiment of the present invention;
FIG. 8 is a schematic diagram of a complex terrain surface grid and vertical grid distribution generated by a grid partitioning process in accordance with an embodiment of the present invention;
FIG. 9 is a diagram illustrating an overall view of a complex terrain mesh computation domain generated by a meshing process in accordance with an embodiment of the present invention;
fig. 10 is a schematic block diagram of a system for rapidly generating a high fidelity structural grid of a complex terrain surface in an exemplary embodiment of the invention.
Wherein 10 is a data acquisition module, 20 is a data extraction module, and 30 is a grid generation module.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It will be apparent that the described embodiments are some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In this document, suffixes such as "module", "component", or "unit" used to represent elements are used only for facilitating the description of the present invention, and have no particular meaning in themselves. Thus, "module," "component," or "unit" may be used in combination.
The terms "upper," "lower," "inner," "outer," "front," "rear," "one end," "the other end," and the like herein refer to an orientation or positional relationship based on that shown in the drawings, merely for convenience of description and to simplify the description, and do not denote or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus should not be construed as limiting the invention. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
The terms "mounted," "configured to," "connected," and the like, herein, are to be construed broadly as, for example, "connected," whether fixedly, detachably, or integrally connected, unless otherwise specifically defined and limited; the two components can be mechanically connected, can be directly connected or can be indirectly connected through an intermediate medium, and can be communicated with each other. The specific meaning of the above terms in the present invention will be understood in specific cases by those of ordinary skill in the art.
Herein, "and/or" includes any and all combinations of one or more of the associated listed items.
Herein, "plurality" means two or more, i.e., it includes two, three, four, five, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As used in this specification, the term "about" is typically expressed as +/-5% of the value, more typically +/-4% of the value, more typically +/-3% of the value, more typically +/-2% of the value, even more typically +/-1% of the value, and even more typically +/-0.5% of the value.
In this specification, certain embodiments may be disclosed in a format that is within a certain range. It should be appreciated that such a description of "within a certain range" is merely for convenience and brevity and should not be construed as a inflexible limitation on the disclosed ranges. Accordingly, the description of a range should be considered to have specifically disclosed all possible sub-ranges and individual numerical values within that range. For example, the description of ranges 1-6 should be considered as having specifically disclosed sub-ranges such as from 1 to 3, from 1 to 4, from 1 to 5, from 2 to 4, from 2 to 6, from 3 to 6, etc., as well as individual numbers within such ranges, e.g., 1,2,3,4,5, and 6. The above rule applies regardless of the breadth of the range.
Herein, the "near-ground layer (near surface layer)" also called the ground boundary layer (surface boundary layer) is a portion of the atmospheric boundary layer that exists stably, closest to the subsurface. The height of the near-ground layer is usually about 50 to 100 m, and can be determined by observing wind speed and air temperature profile, and can also be obtained by a similarity theory to obtain a parameterized height, such as a Monin-Obukhov length scale.
Herein, a "near-ground layer grid" is also referred to as a "near-ground critical area grid," which is a multi-layer structural grid used to describe or simulate the spatial area between a terrain surface to a near-ground layer. Alternatively, a "near-ground layer grid" may be a multi-layer structural grid used to describe a near-ground area that is customized by a user (e.g., an engineer). The near-ground area is a space area close to the surface of the terrain, and can be adaptively set by a user according to actual engineering application requirements or working experience.
The computational grids can be divided into structured grids (structured grids) and unstructured grids (unstructured grid) according to the connection relationship between the grid points. The structural grid is easy to realize boundary fitting of the region and is suitable for calculation of fluid, surface stress concentration and the like, so that the structural grid has obvious advantages compared with a non-structural grid in the CFD calculation process. However, the adjacencies between grid points of the structural grid are ordered, regular, and the cells are quadrilaterals of two dimensions, hexahedrons of three dimensions. The structural and ordered structure of the structural grid can limit the adaptability of the structural grid to complex geometric configuration/geometric appearance to a certain extent, so that grid generation is difficult when the grid problem of complex geometric appearance (such as a terrain surface) is faced, the manual workload of grid generation is obviously increased compared with that of non-structural grids, and the requirement on computer computational power is relatively high. At present, for the flow problem of complex geometric shapes in the common field, a person skilled in the art also tries to overcome the defect of poor geometric adaptability by adopting methods such as partition grid technology, overlap grid technology and the like, but the method brings a series of problems that the implicit boundary conditions of each interval of the partition grid are difficult to realize, each interval of the overlap grid searches for variable transmission corresponding points, variable interpolation is not conservative and the like. Therefore, how to quickly generate a high-fidelity structural grid is one of the key technical problems to be solved by the invention.
Example 1
A first aspect of the present invention provides a method of rapidly generating a high fidelity structural grid of a complex terrain surface, as shown in fig. 1a and 1b, the method comprising the steps of:
step S101: obtaining an STL format file having terrain data, the terrain data comprising: a plurality of triangular patches for representing geometric features of the complex terrain surface, the triangular patches being described by normal vectors and vertex coordinates, wherein the vertex coordinates are obtained from a projection coordinate system comprising: an X direction and a Z direction, and a vertical Y direction perpendicular to the X direction and the Z direction;
in some embodiments, vector map data of complex terrain surfaces may be acquired by a GIS system (geographical information system, geographic information system) and exported in STL format. Where the STL format file may represent a complex solid terrain surface (complex hilly terrain as shown in fig. 4) by a large number of triangular patches, each patch described by a vertical direction (i.e., normal vector) and three points representing triangle vertices (angles). The embodiment prefers STL format file with simple format and only describing geometric information of three-dimensional terrain to realize the subsequent accurate and rapid division of structural grids.
Step S102: and extracting a plurality of coordinate data from the topographic data by adopting a coordinate value extraction method, and storing the plurality of coordinate data in the form of discrete points, wherein the coordinate data is expressed as (X, Y, Z).
In some embodiments, the STL format file is exported as discrete points (i.e., topographical coordinate points) in DAT format. In this embodiment, tecplot software is used to export the STL format file into DAT format discrete point data, and by means of Tecplot software, discrete point coordinates of the surface of the depicted terrain can be conveniently saved as DAT format data file, so that repeated coordinate data (such as vertex coordinates shared by two adjacent triangles are repeatedly read) is avoided.
Step S103: a ground first layer grid array having a regular ordering is generated based on the coordinate data and stretched from the Y-direction to create a forming target grid array.
In some embodiments, the target grid array of the near-ground region is preferably generated from a quadratic order, near-ground coordinate stretching, and preferably output as a PLOT3D format.
Preferably, S103 in this embodiment includes the steps of:
S31, determining a target calculation domain, acquiring coordinate data of all discrete points in the target calculation domain, and creating a one-dimensional array Xt, yt and Zt according to the acquired coordinate data by using an array creation method, wherein the one-dimensional array Xt, yt and Zt are respectively sets of coordinate values in the X, Y, Z directions, and NX multiplied by NZ coordinate data are arranged in each direction;
s32, sequencing the one-dimensional array Xt for the first time according to the size of the coordinate values in the one-dimensional array Xt, and synchronously changing the sequence of corresponding coordinate values Y, Z in the one-dimensional arrays Yt and Zt to correspondingly obtain one-dimensional arrays Xn, yn and Zn;
s33, converting the one-dimensional arrays Xn, yn and Zn which are subjected to the first sorting into three-dimensional arrays Xc, yc and Zc with the size of [ NX ] [ NY ] [ NZ ], wherein the three-dimensional arrays Xc, yc and Zc comprise first-layer grid data of the ground (namely first-layer grid data close to the ground) in the Y direction;
s34, sorting the three-dimensional array Zc for the second time according to the coordinate values in the three-dimensional array Zc along the size of the Z direction, and synchronously changing the positions of the corresponding coordinate values in the three-dimensional array Xc and the Y c to enable the three-dimensional array Xc, the Y c and the Zc to form a first layer grid array of the ground in the Y direction;
S35, calculating grid distribution coefficients in the Y direction from the ground to the top of the target calculation domain in the target calculation domain according to preset parameters, and stretching the first-layer grid array of the ground through the grid distribution coefficients, so as to obtain an NY-1 layer grid array which is above the first-layer grid of the ground and has the size of [ NX ] [1] [ NZ ], wherein the first-layer grid array of the ground and the NY-1 layer grid array jointly form a calculation domain grid array;
s36, sampling the calculation domain grid array according to the target resolution to obtain a coordinate value X, Z of the target grid point;
s37 outputs the target grid array based on the coordinate values of the target grid points.
Wherein the dimension/size of each of the generated NY-1 layer grids is [ NX ] [1] [ NZ ], the total number of grid points is NX 1 x NZ, and the total number of grid points in the whole target calculation domain is NX NY x NZ.
In this embodiment, the original coordinate values are converted into a three-dimensional array format, so that the grid points (or discrete points) are more suitable for expressing the distribution characteristics of the terrain coordinate points in the three-dimensional space region of the original terrain, and further, the subsequent implementation of orthogonal correction on the plane is facilitated.
Further, in some embodiments, to ensure high fidelity of the near-surface layer grid, it is preferable to perform orthogonal correction on the near-surface layer grid to improve the quality of the near-surface layer grid, and before S36, the method further includes the steps of:
in the layer grids (preferably near-ground layer grids), coordinates of at least one discrete point in at least one upper layer grid are respectively corrected in at least one plane from a second layer grid through an included angle relation between the lower layer grid and an adjacent upper layer grid (namely the layer grid to be corrected currently).
Preferably, in some embodiments, orthogonal repair is employedCorrecting the horizontal coordinates of the discrete points in a positive mode, and numbering the grids in an XY plane
Figure SMS_29
Correction amount for correcting coordinate value X of discrete point D of (c)
Figure SMS_30
The method comprises the following steps:
Figure SMS_31
the coordinate value X' corrected by the discrete point D is as follows:
Figure SMS_32
wherein ,
Figure SMS_34
and
Figure SMS_38
respectively two characteristic angles of < CBD, < ABD and discrete point A in XY plane 1 The coordinates of (2) are:
Figure SMS_41
grid number of
Figure SMS_33
Discrete point B 1 The coordinates of (2) are:
Figure SMS_36
grid number of
Figure SMS_39
Discrete point C 1 The coordinates of (2) are:
Figure SMS_42
grid number of
Figure SMS_35
The coordinates of the discrete point D are:
Figure SMS_37
grid number of
Figure SMS_40
It will be appreciated that the same orthogonal correction may be used in the ZY plane to correct for another horizontal coordinate of the discrete point.
For example, in the ZY plane, the grid is numbered
Figure SMS_43
Correction of the coordinate value Z of the discrete point D of (C)
Figure SMS_44
The method comprises the following steps:
Figure SMS_45
the coordinate value Z' after the correction of the discrete point D is as follows:
Figure SMS_46
wherein ,
Figure SMS_48
and
Figure SMS_50
respectively two characteristic angles of +.CBD, +.ABD and discrete point A in ZY plane 2 The coordinates of (2) are:
Figure SMS_53
grid number of
Figure SMS_49
Discrete point B 2 The coordinates of (2) are:
Figure SMS_51
grid number of
Figure SMS_54
Discrete point C 2 The coordinates of (2) are:
Figure SMS_56
grid number of
Figure SMS_47
The coordinates of the discrete point D are:
Figure SMS_52
grid number of
Figure SMS_55
It will be appreciated that the grid number in embodiments of the present invention is determined based on the result of the quadratic ranking. Wherein the grid number reflects the distribution of the storage locations of the coordinate values of the discrete points after the secondary ordering. For example, i, j, k denote the ranking numbers (or, in other words, the storage location distribution) of the coordinate values in the X, Y, Z direction, respectively.
Further, in some embodiments, the adjusted correction threshold range is set and the correction amount is gradually reduced during correction of the horizontal coordinates layer by layer upwards, so as to avoid that negative volumes or grid size changes are too fast during correction of the near-ground layer grid.
The wind resource analysis focused in the embodiment of the invention is mainly applied to the engineering fields of wind power generation and the like, the hub height of the wind power generator is about 100m, and the accurate simulation of the wind speed distribution of the atmospheric boundary layer near the ground is critical to the engineering application of evaluating the wind power generation and the like. In addition to wind power generation, the heights of urban buildings, bridges and the like are mostly in the range of tens of meters to hundreds of meters, and the fidelity of the near-ground key grid is required to be ensured for aerodynamic analysis of high-rise buildings and bridges. According to the embodiment, grid correction is carried out on the critical ground-near area, wherein in the process of correcting the critical ground-near area layer by layer, an adjusted threshold value (such as a first threshold value) is set, the correction amount is gradually reduced, high fidelity of grids close to the ground area can be ensured, and meanwhile the problems of excessively rapid change of negative volume or grid size and the like can be avoided.
For example, in some embodiments, before correcting the coordinates of at least one discrete point in at least one of the upper grids in at least one plane, the method further comprises the steps of:
calculating the sum of corrected correction amounts of X coordinate values of each corrected discrete point in the near-ground layer grid in the Y direction;
and when the sum is smaller than a preset first threshold (which can be set by a user according to engineering application requirements), continuing to correct in the current upper grid, otherwise, stopping correcting in the upper grid.
Specifically, in some embodiments, the sum of correction amounts in the vertical direction for each horizontal coordinate point position is calculated, that is, grid point correction amounts are calculated
Figure SMS_57
Sum of (2)
Figure SMS_58
Figure SMS_59
Representative of
Figure SMS_60
Or (b)
Figure SMS_61
N is the arrangement number of the current layer grid in the vertical direction (Y direction).
When correction is performed in the XY plane, the sum of the correction amounts that have been corrected in the vertical direction at the position of each horizontal coordinate point (fixed i, k index) in the near-ground layer grid is calculated. When the sum is smaller than a preset first threshold value
Figure SMS_62
I.e.
Figure SMS_63
When the coordinate is corrected in the current plane, the coordinate is corrected continuously by the correction amount
Figure SMS_64
Otherwise, stopping correcting the coordinates in the current plane.
When correction is performed in the ZY plane, the sum of the correction amounts that have been corrected in the vertical direction at the position of each horizontal coordinate point (fixed i, k index) in the near-ground layer grid is calculated. When the sum is smaller than a preset second threshold value
Figure SMS_65
I.e.
Figure SMS_66
When the coordinate is corrected in the current plane, the coordinate is corrected continuously by the correction amount
Figure SMS_67
Otherwise, stopping correcting the coordinates in the current plane.
For another example, in some embodiments, before correcting the coordinates of at least one discrete point in at least one of the upper grids in at least one plane, the method further comprises the steps of:
calculating the sum of corrected corrections of the Z coordinate value of each corrected discrete point in the near-ground layer grid in the Y direction; and when the sum is smaller than a preset second threshold value, continuing to correct in the current upper grid, otherwise, stopping correcting in the upper grid.
Alternatively, in other embodiments, a corresponding correction threshold may be set for each layer of the layer grid, so that the correction amount for each layer of the grid is adjusted in a targeted manner. Specifically, in this embodiment, before the step of correcting, in at least one plane, the coordinates of at least one discrete point in at least one upper grid, the method further includes the steps of:
Calculating the sum of correction values of X coordinate values of each corrected discrete point in the current upper grid in the Y direction; and when the sum is smaller than a preset first-layer correction threshold value, continuing to correct in the current upper-layer grid, otherwise, stopping correcting in the upper-layer grid. Similarly, when the correction is made to the Z coordinate value, the correction method further includes: calculating the sum of correction values of Z coordinate values of each discrete point in the current upper grid in the Y direction; and when the sum is smaller than a preset second-layer correction threshold value, continuing to correct in the current upper-layer grid, otherwise, stopping correcting in the upper-layer grid.
Preferably, in some embodiments, the correction threshold of the layer mesh is gradually reduced from bottom to top, so as to avoid problems such as a negative volume or too fast mesh size change.
Further, in some embodiments, the method further comprises the step of: setting boundary conditions, and exporting the target grid array into a target structure grid for simulating the terrain surface.
Further, in some embodiments, S31 includes:
reading vertex coordinate data preset by a user, and determining the target calculation domain based on the vertex coordinate data, wherein the vertex comprises: a first vertex (Xmin, zmin), a second vertex (Xmax, zmax); judging whether the discrete point is positioned in the target calculation domain or not based on the vertex coordinate data, and identifying the discrete point positioned in the target calculation domain as a valid coordinate point;
And creating a one-dimensional array Xt, yt and Zt according to the coordinate data of the effective coordinate point by using an array creation method.
And NX is the number of coordinate values with the same value in the one-dimensional array Xn, NZ=N/NX, and N is the number of the effective coordinate points.
Further, in some embodiments, S35 includes:
reading a vertical grid point coordinate growth rate adjustment factor Fac preset by a user and the top Ytop of a target calculation domain (specifically, the target calculation domain is an air flow region above the ground, such as an air flow region near the ground;
constructing an array H (j) with the element range in the (0, 1) interval by using a hyperbolic tangent function tanh based on Fac and Ytop, and calculating a spacing coefficient dH (j) (namely a grid distribution coefficient) between adjacent vertical discrete points;
and calculating to obtain the vertical coordinates Yc of all discrete points in the target calculation domain in a point-by-point accumulation interval mode.
In some embodiments, the method of sampling in S36 includes: adjacent point interpolation, and/or spaced point extraction.
Referring to fig. 2 to 9, step S103 will be exemplarily described with reference to specific embodiments. It should be noted that the implementation of step S103 is given below as an exemplary illustration only, and does not represent all implementations of the embodiments of the present application.
Preferably, in this embodiment, the Fortran language program is used to implement automatic grid generation, so as to avoid or reduce the manual grid division of engineering personnel. Examples of the Fortran language program examples are as follows:
s31 comprises the steps of: and (3) reading the discrete point coordinate data in the DAT format, and simultaneously reading coordinate values Xmin, xmax, zmin, zmax of boundary vertexes of the calculation domain designated by engineering personnel, and preset parameters such as the top height Ytop of the target calculation domain, the vertical grid point coordinate growth rate adjustment factor Fac and the like. Wherein Xmin and Xmax represent minimum and maximum coordinates of the horizontal direction X, zmin and Zmax represent minimum and maximum coordinates of the other horizontal direction Z, and the terrain mesh is generated in a rectangular region (i.e., a target calculation domain) formed by (Xmin, zmin) and (Xmax, zmax);
judging whether the discrete points are positioned in the boundary range of the target calculation domain, and counting the points in the boundary range of the target calculation domain into one-dimensional arrays Xt, yt and Zt to count N effective coordinate points in total; the method comprises the steps of judging whether discrete points in a DAT format data file are located in a rectangular area formed by (Xmin, zmin) and (Xmax, zmax) point by point, wherein the Fortran language program is exemplified as follows:
N=0
open(10,file='terrain.dat')
do while(not(eof(10)))
read(10,*) Xtemp,Ytemp,Ztemp
if(Xmax>Xtemp .and. Xmin<Xtemp .and. Zmax>Ztemp .and. Zmin<Ztemp) then
Xt(N)=Xtemp
Yt(N)=Ytemp
Zt(N)=Ztemp
N=N+1
endif
enddo
s32 comprises the steps of: sequencing according to the size of Xt array elements (namely coordinate values X), and synchronously changing the sequence of corresponding elements (namely coordinate values Y, Z) in the Yt array and the Zt array to obtain arrays Xn, yn and Zn; the Xt, yt and Zt are synchronously ordered according to the size of the Xt array elements, and the Fortran language program is exemplified as follows:
do i=1,N-1
do m=i+1,N
if(Xt(i)>Xt(m)) then
Xtemp=Xt(i)
Xt(i)=Xt(m)
Xt(m)=Xtemp
Ytemp=Yt(i)
Yt(i)= Yt(m)
Yt(m)=Ytemp
Ztemp=Zt(i)
Zt(i)=Zt(m)
Zt(m)=Ztemp
endif
enddo
enddo
Xn=Xt
Yn=Yt
Zn=Zt
According to the characteristics of STL format topographic data, the number of elements with the same coordinate value in the Xn array is the number NX of coordinate points in the horizontal direction X in the boundary range of the target calculation domain, and the number of coordinate points in the horizontal direction Z is NZ=N/NX;
judging grid points along X and Z directions in a rectangular area formed by (Xmin, zmin) and (Xmax, zmax), wherein the Fortran language program is exemplified by:
NZ=1
do m=2,N
if(Xn(m)==Xn(1)) then
NZ=NZ+1
endif
enddo
NX=N/NZ
s33, S34 includes the steps of: the one-dimensional arrays Xn, yn, zn which have been synchronously ordered according to the values in the X direction are deformed into three-dimensional arrays Xc, yc, zc of the size [ NX ] [ NY ] [ NZ ] in a manner of synchronously changing the positions of the corresponding elements, and the three-dimensional arrays Xc and Yc are ordered for the second time according to the values of coordinates in the three-dimensional array Zc, and the Fortran language program adopted for the second order in this embodiment is exemplified as follows:
do i=0,NX-1
Xc(i,0,0:NZ-1)=Xn(i*NZ+1:i*NZ+NZ)
Yc(i,0,0:NZ-1)=Yn(i*NZ+1:i*NZ+NZ)
Zc(i,0,0:NZ-1)=Zn(i*NZ+1:i*NZ+NZ)
enddo
do i=0,NX-1
do k=0,NZ-1-1
do m=k+1,NZ-1
if(Zc(i,0,k).gt.Zc(i,0,m)) then
Ztemp=Zc(i,0,k)
Zc(i,0,k)=Zc(i,0,m)
Zc(i,0,m)=Ztemp
Ytemp=Yc(i,0,k)
Yc(i,0,k)=Yc(i,0,m)
Yc(i,0,m)=Ytemp
Xtemp=Xc(i,0,k)
Xc(i,0,k)=Xc(i,0,m)
Xc(i,0,m)=Xtemp
endif
enddo
enddo
enddo
examples of changes from one-dimensional array to three-dimensional array are, for example: the number of elements is N, the three-dimensional array Xc (0:NX-1, 0, 0:NZ-1) after transformation, the number of elements is NX 1 NZ (the number of elements is from 0), and N=NX 1 NZ. Xn and Xc store the X coordinates of all ground coordinate points.
S35 comprises the steps of: reading a vertical grid point coordinate growth rate adjustment factor Fac and a top height Ytop of a target calculation domain (Fac and Ytop can be adaptively set by engineering personnel based on the fluctuation condition of a terrain surface and the precision requirement of grids), constructing an array H (j) with an element range within a (0, 1) interval by using a hyperbolic tangent function tanh, calculating a spacing coefficient dH (j) between adjacent vertical coordinate points, and calculating the vertical coordinates Yc of all grid points in the calculation domain in a point-by-point accumulation spacing mode;
Obtaining a vertical coordinate array Yc (0: nx-1,0: ny-1,0: nz-1) of all grid points within the computation domain, the Fortran language program is exemplified by:
do j=0,NY-1
H(j)=tanh((j-NY+1)/(NY*1.0)*Fac)+1.0
enddo
do j=1,NY-1
dH(j)=H(j)-H(j-1)
enddo
do k=0,NZ-1
do i=0,NX-1
d(i,k)= Ytop-Yc(i,0,k)
enddo
enddo
do i=0,NX-1
do k=0,NZ-1
do j=1,NY-1
Yc(i,j,k)=Yc(i,j-1,k)+dH(j)*d(i,k)
enddo
enddo
enddo
at this time, since the grids are vertically stretched upward from the first layer of grids (ground grids), the horizontal direction coordinate arrays Xc (0:nx-1, j, 0:nz-1) and Zc (0:nx-1, j, 0:nz-1) of each layer of grids vertically coincide with the horizontal direction coordinate values of the first layer of grids, that is, xc (0:nx-1, 0, 0:nz-1) and Zc (0:nx-1, 0, 0:nz-1).
In order to further ensure that the near-ground critical area of the grid has high fidelity, after S34, the coordinates of the grid points are further corrected, and from the second layer of grid, the angles between the angular bisectors of the adjacent edges of the adjacent lower layer of grid and the Y axis in the XY and ZY planes are calculated respectively according to the angle relationship between the edges of the adjacent micro-surface elements in the adjacent lower layer of grid (as shown in fig. 5), and the horizontal coordinates X and Z coordinates of the grid points of the grid of the layer of grid are adjusted according to the angle values respectively, so as to obtain the corrected horizontal direction coordinate arrays Xc (0:nx-1, 0:ny-1, 0:nz-1) and Zc (0:nx-1, 0:ny-1, 0:nz-1) of all the grid points in the calculation domain, so as to reduce the deflection angle of the near-ground grid and improve the quality of the grid. In the process of adjusting and optimizing layer by layer upwards, an adjusting threshold value can be set, and the correction amount is gradually reduced, so that the occurrence of excessively rapid change of the negative volume or the grid size is avoided;
Taking correction of the X coordinates of grid points with grid numbers (i, j, k) as an example, the Fortran language program is exemplified by:
alph=atand( (Xc(i+1,j-1,k)-Xc(i,j-1,k))/(Yc(i+1,j-1,k)-Yc(i,j-1,k)) )
beta=atand( (Xc(i,j-1,k)-Xc(i-1,j-1,k))/(Yc(i,j-1,k)-Yc(i-1,j-1,k))*(-1.0) )
if(alph<0.0) then
alph=alph+180.0
endif
if(beta<0.0) then
beta=beta+180.0
endif
temp=(Yc(i,j,k)-Yc(i,j-1,k))*tand((alph-beta)/2.0)
Xc(i,j,k)=Xc(i,j-1,k)+temp
the correction for the X coordinate is proportional to the height of the grid in the vertical direction and the tangent of the characteristic angle (α - β)/2, where α is alph in the program and β is beta in the program. The characteristic angle refers to an included angle between an angular bisector of an adjacent edge of an adjacent lower grid and a Y axis, as shown in fig. 5, the angle DBE is the characteristic angle, the length of a horizontal line segment DE in the figure is an original correction amount of an X coordinate, and the actual correction amount can be limited by constraint conditions such as a threshold value.
The grid pairs before and after the orthogonal correction are shown in fig. 6 and 7 (the data in the left column in fig. 6 and 7 is the maximum included angle, the data in the right column is the number of grids in the corresponding included angle interval), and after the orthogonal correction, the maximum offset angles of the grids close to the ground are obviously improved.
S36 comprises the steps of: downsampling the horizontal direction coordinate arrays Xc and Zc according to the grid resolution requirement (namely target resolution), and obtaining the horizontal coordinates X, Z of the target grid points required by the CFD solving process by adopting the modes of interval point taking, interpolation and the like;
for example, taking X and Z directions as examples of grid dotting per interval istep and kstep, respectively, the Fortran language program is exemplified by:
kk=-1
do k=0,NZ-1,kstep
kk=kk+1
do j=0,NY-1
ii=0
do i=0,NX-1,istep
X(1,ii,j,kk)=Xc(i,k)
Y(2,ii,j,kk)=Yc(i,j,k)
Z(3,ii,j,kk)=Zc(i,k)
ii=ii+1
enddo
enddo
enddo
S37 comprises the steps of: outputting the target grid array corresponding to the target grid points acquired in the step S35 (preferably in a PLOT3D format), wherein the grid points actually output in the X and Z directions are NXr and NZr, and the grid points output in the Y direction are NY.
Examples of Fortran language programs are:
open(10, file='plot3dgrid.xyz', form='unformatted')
write(10) NXr,NY,NZr
write(10) (((X(1,i,j,k),i=0,NXr-1),j=0,NY-1),k=0,NZr-1),&
(((Y(2,i,j,k),i=0,NXr-1),j=0,NY-1),k=0,NZr-1),&
(((Z(3,i,j,k),i=0,NXr-1),j=0,NY-1),k=0,NZr-1)
close(10)
the complex terrain surface grid and vertical grid distribution generated by the grid division program are shown in fig. 8, and the whole view of the complex terrain grid calculation domain is shown in fig. 9.
Further, after outputting the target grid array in the PLOT3D format, the PLOT3D format may be further restored into a common CFD solving format such as CGNS. Specifically, grid division software such as Pointwise is used for reading PLOT3D format coordinate data, setting boundary conditions and deriving a common CFD solving format such as CGNS. The method can directly read the PLOT3D format file output by the HSMP program (namely the grid division program) by means of Pointwise grid division software widely applied in the CFD field, so that the PLOT3D data format is conveniently transferred into CFD universal formats such as CGNS and the like, and the grid format to be exported can be independently selected according to the type of a CFD solver.
Example two
As shown in fig. 10, the second aspect of the present invention further provides a system for rapidly generating a complex terrain surface hi-fi structural grid, comprising:
A data acquisition module 10 configured to acquire an STL format file having topographic data including: a plurality of triangular patches for representing geometric features of the complex terrain surface, the triangular patches being described by normal vectors and vertex coordinates, wherein the vertex coordinates are obtained from a projection coordinate system comprising: an X direction and a Z direction, and a vertical Y direction perpendicular to the X direction and the Z direction;
in some embodiments, the terrain data selected for use in embodiments of the present invention may be derived from a GIS system, which is a useful tool and technique for data processing and data application to geospatial based on computer technology.
Of course, in other embodiments, data of the terrain surface (e.g., vector map data) may be obtained by other means, such as through the open street map website, etc. Or, professional GIS software can be adopted to vector the high-definition map picture so as to obtain vector map data of the corresponding topography. And exporting the vector map data into STL format data by a data format conversion method (such as conversion software and the like)
A data extraction module 20 configured to extract a plurality of coordinate data from within a target range in the topographic data using a coordinate value extraction method, and store the plurality of coordinate data in the form of discrete points, wherein the coordinate data is represented as (X, Y, Z);
a grid generation module 30 configured to generate a ground first layer grid array having a regular ordering based on the coordinate data, and stretch the ground first layer grid array from the Y direction to create a forming target grid array;
wherein the mesh generation module 30 includes:
a calculation domain determining unit configured to determine a target calculation domain, obtain coordinate data of all discrete points in the target calculation domain, and create a one-dimensional array Xt, yt, zt according to the obtained coordinate data by using an array creation method, wherein the one-dimensional array Xt, yt, zt are respectively a set of coordinate values in X, Y, Z directions, and each direction has nx×nz coordinate data;
a primary ordering unit configured to perform primary ordering on the one-dimensional array Xt according to the size of the coordinate values in the one-dimensional array Xt, and synchronously change the order of the corresponding coordinate values Y, Z in the one-dimensional arrays Yt and Zt so as to correspondingly obtain one-dimensional arrays Xn, yn and Zn;
An array conversion unit configured to convert the one-dimensional arrays Xn, yn, zn, which have completed the first sorting, into three-dimensional arrays Xc, yc, zc of size [ NX ] [ NY ] [ NZ ], using an array conversion method, wherein the three-dimensional arrays Xc, yc, zc include first layer mesh data of the ground in the Y direction;
the secondary sequencing unit is configured to sequence the three-dimensional array Zc for the second time according to the size of the coordinate values in the three-dimensional array Zc along the Z direction, and synchronously change the positions of the corresponding coordinate values in the three-dimensional arrays Xc and Yc so that the three-dimensional arrays Xc, yc and Zc form a first layer of ground grid array in the Y direction;
the stretching unit is configured to calculate grid distribution coefficients in the Y direction from the ground to the top of the target calculation domain in the target calculation domain according to preset parameters, and stretch the first-layer grid array of the ground according to the grid distribution coefficients, so that a NY-1 layer grid array which is arranged on the first-layer grid of the ground and has the size of [ NX ] [1] [ NZ ] is created by stretching, and the first-layer grid array of the ground and the NY-1 layer grid array jointly form a calculation domain grid array;
A sampling unit configured to sample the computational domain grid array at a target resolution to obtain coordinate values X, Z of a target grid point;
an output unit configured to output the target grid array based on the coordinate values of the target grid points.
Further, in some embodiments, the system further comprises: and the deriving module is configured to set boundary conditions and derive the grid coordinate point array into a target structure grid for simulating the complex terrain surface.
Further, in some embodiments, grid generation module 30 further includes: and the orthogonal correction unit is configured to correct coordinates of at least one discrete point in at least one upper grid in at least one plane from a second grid through an included angle relation between a lower grid and an adjacent upper grid. The specific modifications can be seen from the above embodiments.
The system in the embodiment of the present invention may implement any method step in the first embodiment, which is not described herein.
It will be appreciated that the safety assessment of wind power plants and super high-rise buildings (e.g. ultra-large bridges) in near-ground areas is only one preferred application scenario of the invention. Of course, the high-fidelity structural grid generating method can also be widely applied to other wind resource evaluation or other related fields, such as weather forecast or flight safety analysis.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a computer terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (10)

1. A method for rapidly generating a high-fidelity structural grid on a surface of a complex terrain, comprising the steps of:
s101 acquires an STL format file having topographic data including: a plurality of triangular patches for representing geometric features of the complex terrain surface, the triangular patches being described by normal vectors and vertex coordinates, wherein the vertex coordinates are obtained from a projection coordinate system comprising: an X direction and a Z direction, and a vertical Y direction perpendicular to the X direction and the Z direction;
s102, extracting a plurality of coordinate data from a target range in the topographic data by adopting a coordinate value extraction method, and storing the plurality of coordinate data in the form of discrete points, wherein the coordinate data is expressed as (X, Y, Z);
S103, generating a first-layer ground grid array with regular ordering based on the coordinate data, and stretching the first-layer ground grid array from the Y direction to create a target grid array;
wherein S103 includes the steps of:
s31, determining a target calculation domain, acquiring coordinate data of all discrete points in the target calculation domain, and creating a one-dimensional array Xt, yt and Zt according to the acquired coordinate data by using an array creation method, wherein the one-dimensional array Xt, yt and Zt are respectively sets of coordinate values in the X, Y, Z directions, and NX multiplied by NZ coordinate data are arranged in each direction;
s32, sequencing the one-dimensional array Xt for the first time according to the size of the coordinate values in the one-dimensional array Xt, and synchronously changing the sequence of corresponding coordinate values Y, Z in the one-dimensional arrays Yt and Zt to correspondingly obtain one-dimensional arrays Xn, yn and Zn;
s33, converting the one-dimensional arrays Xn, yn and Zn which are subjected to the first sequencing into three-dimensional arrays Xc, yc and Zc with the size of [ NX ] [ NY ] [ NZ ], wherein the three-dimensional arrays Xc, yc and Zc comprise first-layer grid data of the ground in the Y direction;
s34, sorting the three-dimensional array Zc for the second time according to the coordinate values in the three-dimensional array Zc along the size of the Z direction, and synchronously changing the positions of the corresponding coordinate values in the three-dimensional array Xc and the Y c to enable the three-dimensional array Xc, the Y c and the Zc to form a first layer grid array of the ground in the Y direction;
S35, calculating grid distribution coefficients in the Y direction from the ground to the top of the target calculation domain in the target calculation domain according to preset parameters, and stretching the first-layer grid array of the ground through the grid distribution coefficients, so as to obtain an NY-1 layer grid array which is above the first-layer grid of the ground and has the size of [ NX ] [1] [ NZ ], wherein the first-layer grid array of the ground and the NY-1 layer grid array jointly form a calculation domain grid array;
s36, sampling the calculation domain grid array according to the target resolution to obtain a coordinate value X, Z of the target grid point;
s37 outputs the target grid array based on the coordinate values of the target grid points.
2. The method according to claim 1, characterized in that prior to S35, further comprising the step of:
in the layer grids, starting from the second layer grid, correcting the coordinates of at least one discrete point in at least one upper layer grid in at least one plane through the included angle relation between the lower layer grid and the adjacent upper layer grid;
wherein, in the XY plane, the grids are numbered
Figure QLYQS_1
Correction amount for correcting coordinate value X of discrete point D of (c)
Figure QLYQS_2
The method comprises the following steps:
Figure QLYQS_3
the coordinate value X' corrected by the discrete point D is as follows:
Figure QLYQS_4
wherein ,
Figure QLYQS_7
and />
Figure QLYQS_9
Respectively two characteristic angles of < CBD, < ABD and discrete point A in XY plane 1 The coordinates of (2) are:
Figure QLYQS_12
grid number->
Figure QLYQS_6
Discrete point B 1 The coordinates of (2) are: />
Figure QLYQS_10
Grid number->
Figure QLYQS_13
Discrete point C 1 The coordinates of (2) are:
Figure QLYQS_14
grid number->
Figure QLYQS_5
The coordinates of the discrete point D are:
Figure QLYQS_8
grid number->
Figure QLYQS_11
In the ZY plane, the grids are numbered
Figure QLYQS_15
Correction of the coordinate value Z of the discrete point D of (2)>
Figure QLYQS_16
The method comprises the following steps:
Figure QLYQS_17
the coordinate value Z' after the correction of the discrete point D is as follows:
Figure QLYQS_18
wherein ,
Figure QLYQS_21
and />
Figure QLYQS_22
Respectively two characteristic angles of +.CBD, +.ABD and discrete point A in ZY plane 2 The coordinates of (2) are:
Figure QLYQS_25
grid number->
Figure QLYQS_19
Discrete point B 2 The coordinates of (2) are:
Figure QLYQS_23
grid number->
Figure QLYQS_26
Discrete point C 2 The coordinates of (2) are:
Figure QLYQS_28
grid number->
Figure QLYQS_20
The coordinates of the discrete point D are:
Figure QLYQS_24
grid number->
Figure QLYQS_27
Wherein the grid number is used for representing the position distribution of the coordinate data after secondary sorting.
3. The method of claim 2, further comprising the step of, prior to modifying coordinates of at least one discrete point in at least one of the upper grids in at least one plane:
calculating a sum of corrections in the Y direction for the X coordinate value of each corrected discrete point in the layer grid;
When the sum is smaller than a preset first threshold value, continuing to correct in the current upper grid, otherwise, stopping correcting in the upper grid;
and/or the number of the groups of groups,
calculating a sum of corrections in the Y direction for the Z coordinate value of each corrected discrete point in the layer grid;
and when the sum is smaller than a preset second threshold value, continuing to correct in the current upper grid, otherwise, stopping correcting in the upper grid.
4. The method of claim 2, further comprising, prior to the step of correcting coordinates of at least one discrete point in at least one of the upper grids in at least one plane, the step of:
calculating the sum of correction values of X coordinate values of each corrected discrete point in the current upper grid in the Y direction;
when the sum is smaller than a preset first layer correction threshold value, continuing to correct in the current upper layer grid, otherwise, stopping correcting in the upper layer grid;
and/or the number of the groups of groups,
calculating the sum of correction values of the Z coordinate value of each corrected discrete point in the current upper grid in the Y direction;
And when the sum is smaller than a preset second-layer correction threshold value, continuing to correct in the current upper-layer grid, otherwise, stopping correcting in the upper-layer grid.
5. The method of claim 1, further comprising the step of:
s104, setting boundary conditions, and exporting the target grid array into a target structure grid for simulating the complex terrain surface.
6. The method of claim 1, wherein S31 comprises:
reading vertex coordinate data preset by a user, and determining the target calculation domain based on the vertex coordinate data, wherein the vertex comprises: a first vertex (Xmin, zmin), a second vertex (Xmax, zmax);
judging whether the discrete point is positioned in the target calculation domain or not based on the vertex coordinate data, and identifying the discrete point positioned in the target calculation domain as a valid coordinate point;
and creating a one-dimensional array Xt, yt and Zt according to the coordinate data of the effective coordinate point by using an array creation method.
7. The method of claim 6, wherein NX is the number of coordinate values having the same value size in the one-dimensional array Xn, and NZ is the number of discrete points along the Z direction; and NZ=N/NX, wherein N is the number of the effective coordinate points.
8. The method of claim 1, wherein S35 comprises:
reading a vertical grid point coordinate growth rate adjustment factor Fac preset by a user and the top height Ytop of a target calculation domain;
constructing an array H (j) with the element range within the (0, 1) interval by using a hyperbolic tangent function tanh based on Fac and Ytop, and calculating a spacing coefficient dH (j) between adjacent vertical discrete points;
and calculating to obtain the vertical coordinates Yc of all discrete points in the target calculation domain in a point-by-point accumulation interval mode.
9. The method of claim 1, wherein the method of sampling in S36 comprises: adjacent point interpolation, and/or spaced point extraction.
10. A system for rapidly generating a high-fidelity structural grid for a complex terrain surface, comprising:
a data acquisition module configured to acquire an STL format file having terrain data comprising: a plurality of triangular patches for representing geometric features of the complex terrain surface, the triangular patches being described by normal vectors and vertex coordinates, wherein the vertex coordinates are obtained from a projection coordinate system comprising: an X direction and a Z direction, and a vertical Y direction perpendicular to the X direction and the Z direction;
A data extraction module configured to extract a plurality of coordinate data from within a target range in the topographic data using a coordinate value extraction method, and store the plurality of coordinate data in the form of discrete points, wherein the coordinate data is represented as (X, Y, Z);
a grid generation module configured to generate a ground first layer grid array having a regular ordering based on the coordinate data, and stretch the ground first layer grid array from the Y direction to create a forming target grid array;
wherein the grid generation module comprises:
a calculation domain determining unit configured to determine a target calculation domain, obtain coordinate data of all discrete points in the target calculation domain, and create a one-dimensional array Xt, yt, zt according to the obtained coordinate data by using an array creation method, wherein the one-dimensional array Xt, yt, zt are respectively a set of coordinate values in X, Y, Z directions, and each direction has nx×nz coordinate data;
a primary ordering unit configured to perform primary ordering on the one-dimensional array Xt according to the size of the coordinate values in the one-dimensional array Xt, and synchronously change the order of the corresponding coordinate values Y, Z in the one-dimensional arrays Yt and Zt so as to correspondingly obtain one-dimensional arrays Xn, yn and Zn;
An array conversion unit configured to convert the one-dimensional arrays Xn, yn, zn, which have completed the first sorting, into three-dimensional arrays Xc, yc, zc of size [ NX ] [ NY ] [ NZ ], using an array conversion method, wherein the three-dimensional arrays Xc, yc, zc include first layer mesh data of the ground in the Y direction;
the secondary sequencing unit is configured to sequence the three-dimensional array Zc for the second time according to the size of the coordinate values in the three-dimensional array Zc along the Z direction, and synchronously change the positions of the corresponding coordinate values in the three-dimensional arrays Xc and Yc so that the three-dimensional arrays Xc, yc and Zc form a first layer of ground grid array in the Y direction;
the stretching unit is configured to calculate grid distribution coefficients in the Y direction from the ground to the top of the target calculation domain in the target calculation domain according to preset parameters, and stretch the first-layer grid array of the ground according to the grid distribution coefficients, so that a NY-1 layer grid array which is arranged on the first-layer grid of the ground and has the size of [ NX ] [1] [ NZ ] is created by stretching, and the first-layer grid array of the ground and the NY-1 layer grid array jointly form a calculation domain grid array;
a sampling unit configured to sample the computational domain grid array at a target resolution to obtain coordinate values X, Z of a target grid point;
An output unit configured to output the target grid array based on the coordinate values of the target grid points.
CN202310215984.4A 2023-03-08 2023-03-08 Method and system for rapidly generating high-fidelity structural grid on surface of complex terrain Active CN115908739B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310215984.4A CN115908739B (en) 2023-03-08 2023-03-08 Method and system for rapidly generating high-fidelity structural grid on surface of complex terrain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310215984.4A CN115908739B (en) 2023-03-08 2023-03-08 Method and system for rapidly generating high-fidelity structural grid on surface of complex terrain

Publications (2)

Publication Number Publication Date
CN115908739A CN115908739A (en) 2023-04-04
CN115908739B true CN115908739B (en) 2023-05-05

Family

ID=85771864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310215984.4A Active CN115908739B (en) 2023-03-08 2023-03-08 Method and system for rapidly generating high-fidelity structural grid on surface of complex terrain

Country Status (1)

Country Link
CN (1) CN115908739B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398943A (en) * 2008-10-08 2009-04-01 河海大学 Channel ground grid model representation method based on double-layer regularization
CN107833282A (en) * 2017-11-16 2018-03-23 广东电网有限责任公司电力科学研究院 A kind of terrain modeling and mess generation method and device
JP2018097519A (en) * 2016-12-12 2018-06-21 エーティーラボ株式会社 Mesh preparation apparatus, mesh preparation method, and mesh preparation program
CN108563867A (en) * 2018-04-13 2018-09-21 华中科技大学 A method of WRF and CFD coupled simulation wind fields are realized based on OpenFOAM
CN108648271A (en) * 2018-04-11 2018-10-12 华中科技大学 A kind of interpolation method generating complicated landform grid model based on GIS data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398943A (en) * 2008-10-08 2009-04-01 河海大学 Channel ground grid model representation method based on double-layer regularization
JP2018097519A (en) * 2016-12-12 2018-06-21 エーティーラボ株式会社 Mesh preparation apparatus, mesh preparation method, and mesh preparation program
CN107833282A (en) * 2017-11-16 2018-03-23 广东电网有限责任公司电力科学研究院 A kind of terrain modeling and mess generation method and device
CN108648271A (en) * 2018-04-11 2018-10-12 华中科技大学 A kind of interpolation method generating complicated landform grid model based on GIS data
CN108563867A (en) * 2018-04-13 2018-09-21 华中科技大学 A method of WRF and CFD coupled simulation wind fields are realized based on OpenFOAM

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
基于CAD等高线的三角网建模及地形重建;王婕;傅华明;;电子技术(第04期);12-14 *
复杂地形三维多分辨率模型构建方法研究;王治铭;中国优秀硕士学位论文全文数据库基础科学辑(第5期);A008-113 *
大规模地形散乱点的快速构网算法;李学军等;计算机仿真(第11期);211-214 *

Also Published As

Publication number Publication date
CN115908739A (en) 2023-04-04

Similar Documents

Publication Publication Date Title
CN105513133B (en) A kind of city wind environment numerical map makes and display methods
CN103268572B (en) A kind of microcosmic structure method of ten million multikilowatt large-scale wind electricity base wind measurement network
CN112699623B (en) High-precision heat flow calculation method based on unstructured grid regularized reconstruction technology
CN108763825B (en) Numerical simulation method for simulating wind field of complex terrain
CN115329691B (en) CFD and GIS-based ultra-large city wind environment simulation method
CN105576650A (en) Wind power prediction method and system based on assimilation technology and same wind band theory
CN107767453A (en) A kind of building LIDAR point cloud reconstruction and optimization methods of rule-based constraint
CN105718634A (en) Airfoil robust optimization design method based on non-probability interval analysis model
CN112163381B (en) Lateral boundary condition setting method suitable for complex terrain wind field flow numerical simulation
CN107393002A (en) Apparatus and method for extracting terrain boundary
CN111539109A (en) Real-time high-precision global multi-dimensional troposphere zenith delay grid model construction method
CN115761303A (en) Ground object classification method based on airborne laser radar point cloud and remote sensing image data
CN115758938B (en) Adhesive boundary flow field numerical simulation-oriented boundary layer grid generation method
CN114580310A (en) Method for realizing scale reduction processing of WRF (hand-wrenching simulation) wind field based on PALM (PALM fiber laser)
CN115187648A (en) Reverse modeling method and device for power transmission line body, electronic equipment and storage medium
CN115908739B (en) Method and system for rapidly generating high-fidelity structural grid on surface of complex terrain
CN105869210A (en) Interpolation data processing method in three-dimensional geological surface model
CN115795402B (en) Variational method-based multi-source precipitation data fusion method and system
CN113095012B (en) Splicing and fusing method for numerical simulation calculation results of wind power plant flow field partitions
CN113158598B (en) Foundation type wind power plant flow field CFD partition calculation method, device, equipment and medium
Araújo et al. An approach to simulate wind fields around an urban environment for wind energy application
CN115841568A (en) Transmission tower insulator reconstruction method based on standing book data
CN113012286B (en) Method for constructing road DEM based on dense point cloud data
CN112884269B (en) Wind power plant technology exploitable amount calculation method and system based on GIS
CN114297952A (en) Micro-terrain wind field analysis method and system for nuclear power plant

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant