A method for generating a steel bar corrosion field based on spatial correlation
By generating spatially correlated random fields and fusing depth dependencies, the problem of insufficient spatial variability and depth dependencies in existing corrosion modeling technologies is solved, achieving efficient generation of 3D solid models, supporting flexible modeling driven by finite parameters, and suitable for finite element analysis and 3D printing.
Patent Information
- Application Number
- CN202611259717.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-11-06
AI Technical Summary
Existing methods for modeling steel corrosion cannot accurately reflect the spatial variability and depth dependence of corrosion, cannot generate three-dimensional solid models, and have low modeling efficiency, making them unsuitable for direct use in finite element analysis and 3D printing.
A spatial correlation-based approach is adopted, which generates a spatially correlated random field through convolution, and combines depth dependency and 3D surface reconstruction technology to directly output a 3D solid model. The steps include obtaining the geometric parameters of the steel bars and the input parameters of the corrosion rate, generating a spatially correlated random field, fusing the depth field and the corrosion rate field, reconstructing the 3D surface point cloud and generating an STL triangular mesh model.
It achieves accurate modeling of the spatial variability of corrosion, effectively characterizes the dependence of corrosion depth, and generates a three-dimensional solid model that can be directly used for finite element analysis and 3D printing, thereby improving modeling efficiency and engineering applicability.
Smart Images

Figure CN123052188A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of building engineering technology, and in particular relates to a method for generating steel corrosion fields based on spatial correlation. Background Technology
[0002] During long-term service, steel corrosion is the primary factor leading to structural performance degradation in reinforced concrete structures. Accurately obtaining the actual geometry and remaining cross-sectional distribution of corroded steel bars is crucial for assessing the remaining life of structures, designing reinforcement schemes, and constructing digital twin systems.
[0003] Currently, the main technical problems with methods for modeling steel reinforcement corrosion are as follows: First, existing methods mostly adopt the assumption of uniform corrosion, ignoring the non-uniform distribution characteristics of corrosion on the surface of steel bars along the axial and circumferential directions. This fails to reflect the spatial variability of corrosion in actual structures, resulting in insufficient model accuracy.
[0004] Second, there is a significant positive correlation between the corrosion depth and the original surface depth of the reinforcing bar, meaning that the original depression is more prone to corrosion. Existing methods lack an effective characterization of this depth dependence.
[0005] Third, corrosion is spatially correlated, exhibiting similarity within a certain range. Existing methods struggle to generate corrosion fields that simultaneously satisfy spatial variability and depth dependence.
[0006] Fourth, existing methods generate corrosion models that are mostly in the form of two-dimensional data or point clouds, which cannot be directly output as three-dimensional solid models that can be used for 3D printing or finite element analysis. They require additional geometric reconstruction and mesh generation, which is inefficient.
[0007] Fifth, existing methods cannot automatically generate three-dimensional solid models based on limited corrosion parameters input by the user (such as average corrosion rate, maximum corrosion rate of cross section, and maximum corrosion rate of depth).
[0008] Therefore, there is an urgent need for a steel reinforcement corrosion modeling method that can simultaneously consider spatial variability and depth dependence, and can directly output a three-dimensional solid model. Summary of the Invention
[0009] The purpose of this invention is to provide a method for generating steel corrosion fields based on spatial correlation. By integrating spatial correlation modeling, depth dependency and three-dimensional surface reconstruction technology, a high-fidelity three-dimensional solid model of steel corrosion is generated, providing a geometric model that can be indirectly used for finite element analysis for durability assessment of reinforced concrete structures.
[0010] To achieve the above objectives, the present invention adopts the following technical solution: A method for generating steel corrosion fields based on spatial correlation includes the following steps: Step 1: Obtain the geometric parameters of the reinforcing bars and the input parameters of the corrosion rate; calculate the corrosion characteristic parameters and spatial variation parameters based on the input parameters of the corrosion rate. Step 2: Cut the STL model of the steel reinforcement, extract the contour points of each section, and obtain the surface depth data of the contour points. Based on the depth data, use the linear interpolation method to obtain the depth field. Step 3: Generate a spatially correlated random field with specified spatial variation parameters using a convolution method; Step 4: Convert the spatially correlated Gaussian field into a uniformly distributed field through probability integral transformation, and obtain the final corrosion rate field and corrosion rate value based on the uniformly distributed field and the depth field. Step 5: Generate a three-dimensional surface point cloud of the corroded steel bars based on the final corrosion rate field; Step 6: Reconstruct the triangular mesh model based on the 3D surface point cloud.
[0011] Furthermore, the geometric parameters of the reinforcing bars in step 1 include the diameter of the reinforcing bars. axial length Corrosion characteristic parameters include the average corrosion rate of the cross section. Maximum corrosion rate of cross section and maximum depth of corrosion rate .
[0012] Furthermore, the corrosion characteristic parameters and spatial variation parameters are calculated in detail as follows: Cross-sectional average corrosion based on corrosion rate input parameters The maximum corrosion rate of the cross section was calculated. Maximum depth corrosion rate And the average corrosion rate by depth, the specific calculation formula is as follows: Maximum corrosion rate of cross section: ; Maximum depth corrosion rate: ; Average corrosion rate at depth: ; Spatial variation parameters were obtained by calculating the average corrosion rate based on depth. : .
[0013] Furthermore, step 2 specifically includes: The surface depth data of the steel bar surface contour points is obtained by cutting the steel bar STL model layer by layer along the length of the steel bar, extracting the contour points of each section, and calculating the radial distance from the contour points to the centroid of the section. And extract the discrete coordinates of each measurement point from the surface depth data of the rebar according to the set step size; The depth field is obtained by interpolating the discrete coordinates of the measurement points using a linear interpolation method.
[0014] Furthermore, the discrete coordinates of the measurement points are interpolated using a linear interpolation method to obtain the depth field as follows: (1) The discrete coordinate points are set according to the preset axial step size. and circumferential arc length resolution Uniformly distributed grid nodes are constructed in both the axial and circumferential directions of the reinforcing bars. This forms a regular axial-circumferential two-dimensional grid; (2) Using the linear interpolation method, interpolation calculations are performed on the discrete coordinate points falling around each grid cell, as follows: For any target mesh node, linear interpolation is performed on the discrete coordinate points between two axially adjacent original measurement sections to obtain the depth values corresponding to the target's circumferential position on the two sections. A second linear interpolation is then performed along the circumferential direction to obtain the depth value at the mesh node. The depth values of the mesh nodes are then arranged regularly in both the axial and circumferential directions to obtain the depth field. .
[0015] Furthermore, step 3 specifically includes: Based on the number and spatial arrangement of grid nodes, an initial empty matrix with the same row and column dimensions is constructed. Using the probability density function of a standard normal distribution as the sampling basis, a pseudo-random number generation algorithm is used to independently sample each independent unit in the initial empty matrix to obtain random variables. These random variables are then arranged according to their spatial positions within the grid to obtain a normal random field. ; Based on spatial variation parameters a Construct an exponential covariance kernel function and calculate the kernel function value corresponding to each offset within the kernel window. The kernel weight matrix is obtained by summing and normalizing the kernel function values. ; Using two-dimensional convolution to transform normal random fields With kernel weight matrix Perform convolution to obtain a spatially correlated Gaussian field. The generated spatially correlated Gaussian field is then standardized.
[0016] Furthermore, step 4 specifically includes: Using the cumulative distribution function of the standard normal distribution spatially related Gaussian fields The value of each point is converted into a cumulative probability value in the interval [0,1] to obtain a uniform distribution field. ; uniformly distributed field The basic corrosion field is obtained by performing an inverse transformation on the quantile function of the log-normal distribution; The rank mixing method is used to fuse the basic corrosion field and the depth field to obtain the final corrosion rate field. And based on the final corrosion rate field With depth field To obtain the corrosion rate value; Furthermore, the final corrosion field and depth field are obtained using the following methods: Basic rust field and depth field The values at each grid node are sorted in ascending order, with the smallest value assigned rank 1 and the largest value assigned rank N, resulting in a rank matrix. and ; Using deep correlation coefficient Performing a linear mixture of two rank matrices yields the mixed rank. ; Mixed rank Mapping back to the quantiles of the underlying corrosion field yields the final corrosion rate field that incorporates depth-related parameters. ; Calculate the final corrosion rate field with fusion depth correlation The average value, if compared with the average corrosion value of the cross section If the relative deviation exceeds 5%, a scaling adjustment will be performed. ; Check the corrosion rate Does the value exceed the theoretical maximum corrosion rate? If it exceeds, a logistic function is used to map it to (0.5). , Within the specified interval, the specific calculation formula is as follows: in This is a hardness parameter that controls the steepness of the cutoff curve. The larger the value, the closer it is to a hard truncation. The smaller the size, the smoother the transition; The corrosion rate value to be cut off; This represents the theoretical maximum corrosion rate. This is the final corrosion rate value output after gentle truncation treatment.
[0017] Furthermore, step 5 specifically includes: Along the axial direction of the reinforcing bar by length Discretized A cross section, along the circumferential direction at an angle Discretized ( ) points, forming a discrete grid of points; For each discrete grid point, from the final corrosion rate field Interpolation yields the corrosion rate value at that point. From the depth field Interpolation to obtain the original depth Calculate the corrosion depth: ; And calculate the radius after corrosion: ; Calculate the three-dimensional coordinates based on the radius after corrosion to generate a point cloud: .
[0018] Furthermore, step 6 specifically includes: Point cloud by angle The vertices are stored sequentially in an array, with each vertex containing three-dimensional coordinates. ; Traverse the vertex array, for the current vertex Take three adjacent points: , and Generate triangles and ; Using modular arithmetic to handle angular and directional boundaries: ,when When it is the last row, it automatically wraps back to row 0 to ensure that the cylindrical surface is circumferentially closed. For both ends of the reinforcing bar, connect the boundary vertex with the center point of the end face to form a triangular sector closed model; Assemble the vertex array and the triangle fan closure model into an STL triangular mesh model.
[0019] The beneficial effects of this invention are as follows: 1. Achieving accurate modeling of the spatial variability of corrosion: This invention generates a spatially correlated random field with specified spatial variability parameters through convolution, and maps it to a uniformly distributed field by means of probability integral transformation. This breaks through the limitations of the traditional uniform corrosion assumption and can truly reflect the non-uniform distribution characteristics of corrosion along the axial and circumferential directions of the steel bar, thereby improving the geometric fidelity of corrosion morphology.
[0020] 2. Effective characterization of corrosion depth dependence: This invention uses a rank mixing method to fuse the foundation corrosion field with the surface depth field of the reinforcing steel. By controlling the coupling strength between the two through the depth correlation coefficient, it accurately depicts the physical law that the original depression is more prone to corrosion, thus solving the defect of existing methods that lack the ability to characterize depth dependence.
[0021] 3. Achieving the coordinated generation of spatial correlation and depth dependence: This invention integrates the generation of spatially correlated random fields with rank-mixed depth in the same framework, so that the generated corrosion rate field simultaneously satisfies the spatial variation parameter control and the depth positive correlation constraint, overcoming the shortcomings of existing methods that are difficult to take into account both spatial statistical features.
[0022] 4. End-to-end automated generation of 3D solid models: This invention directly generates 3D surface point clouds from the corrosion rate field and automatically reconstructs them into STL triangular mesh models, realizing automated output from corrosion input parameters to 3D solid models that can be directly used for finite element analysis and 3D printing, greatly improving modeling efficiency.
[0023] 5. Supports flexible modeling driven by limited parameters: This invention only requires users to provide limited input parameters such as the average corrosion rate of the cross section, the maximum corrosion rate of the cross section, and the maximum depth corrosion rate. It can automatically calculate all corrosion characteristic parameters and spatial variation parameters and complete the entire process modeling, which reduces the data acquisition threshold and enhances the engineering applicability and convenience of the method. Attached Figure Description
[0024] Figure 1 This is a flowchart of the method for generating steel corrosion fields based on spatial correlation provided by the present invention; Figure 2 This is a flowchart of the operation of the Python software of this invention; Figure 3 This is an interactive diagram of the parameter input interface in the example of this invention; Figure 4 This is an interactive diagram of the STL file data extraction interface in the example of this invention; Figure 5 This is a diagram of the result output interface in the example of this invention; Figure 6 This is an example diagram of the STL model of the corroded steel bar generated in the example of this invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0026] The application principle of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0027] Please refer to Figure 1 and Figure 2 A method for generating steel corrosion fields based on spatial correlation includes the following steps: Step 1: Obtain the geometric parameters of the reinforcing bars and the input parameters for the corrosion rate.
[0028] Collect the geometric parameters of the same type of steel bars, including the bar diameter. axial length ; Obtain the corrosion rate input parameters, including the average corrosion rate of the cross section. Maximum corrosion rate of cross section and maximum depth of corrosion rate At least one parameter in the process, specifically step 1 includes: (1) Confirm the original diameter of the reinforcing bar And the type of reinforcing steel. For actual engineering projects, the diameter of the reinforcing steel is determined by measuring with vernier calipers or referring to the design drawings, in mm.
[0029] (2) Axial length of reinforcing bar The length is determined based on the application scenario. For reinforcement bars in actual structural members, the length is the net length of the reinforcement bars in the direction of force application; for standard specimens, the length is determined according to the test requirements; for numerical simulation studies, the length is set according to the analysis needs. Unit: mm.
[0030] (3) The corrosion rate input parameter is within the range of [0,1]. The cross-sectional corrosion rate input parameter can be obtained through on-site electrochemical testing, laboratory accelerated corrosion tests, or corrosion survey data of similar structures.
[0031] (4) Cross-sectional average corrosion based on corrosion rate input parameters Obtain the maximum corrosion rate of the cross section Maximum depth corrosion rate And the average corrosion rate by depth, the specific calculation formula is as follows: , The average corrosion rate at depth: Spatial variability parameters were calculated based on the average corrosion rate at depth. : .
[0032] Step 2: Import the original reinforcement STL model (please refer to...) Figure 4 The surface depth data of the rebar surface contour points is obtained by cutting the STL model layer by layer along the length of the rebar, extracting the contour points of each section, and calculating the radial distance from the contour points to the centroid of the section. The surface depth refers to the radial distance (i.e., radius) from the central axis of the rebar to the surface of the rebar. Discrete coordinate points for each measurement point are then extracted from the rebar surface depth data according to a set step size. These discrete coordinate points include axial coordinates. Coordinates, circumference Coordinates and original depth Coordinates, through Figure 3 The interface shown reads data and interpolates the discrete coordinates of the measurement points into a depth field with a regular grid using a linear interpolation method, as detailed below:
[0033] (1) The discrete coordinate points are set according to the preset axial step size. and circumferential arc length resolution Uniformly distributed grid nodes are constructed in both the axial and circumferential directions of the reinforcing bars. This forms a regular axial-circumferential two-dimensional grid.
[0034] (2) Using the linear interpolation method, interpolation calculations are performed on the discrete coordinate points falling around each grid cell, as follows: For any target grid node, linear interpolation is performed on the discrete coordinate points between two adjacent original measurement sections along its axis to obtain depth estimates corresponding to the target's circumferential position on each section. A second linear interpolation is then performed along the circumferential direction to obtain the depth value at the grid node. This process is essentially two-dimensional linear interpolation (bilinear interpolation), which fully utilizes the spatial distribution information of the original discrete coordinate points and assigns a reasonable depth data to each regular grid through a step-by-step linear approximation. After interpolation of all grid nodes is completed, the depth values of the grid nodes collectively constitute a depth field that is regularly arranged in both the axial and circumferential directions. This depth field fully reflects the radial distance distribution of each point on the rebar surface. Throughout the interpolation process, the linear interpolation method, with its computational simplicity and stable results, effectively transforms sparse, non-uniform original discrete coordinate points into dense, uniform, regular grid data, while maintaining arc length resolution. The introduction of this method ensures that the circumferential interpolation step size can adapt to the changes in different cross-sectional radii, making the final generated depth field more closely match the actual shape of the steel reinforcement surface in terms of geometric description, and providing an accurate and regular data foundation for subsequent surface feature extraction and defect judgment.
[0035] Among them, arc length resolution Based on the original diameter of the reinforcing bar d and circumferential angle step size The calculation is as follows: In the formula The circumferential angle step size is... The circumferential arc length resolution (unit: mm) is the physical arc length between two adjacent measurement points on the unfolded circumference.
[0036] Step 3: Generate a spatially correlated random field. A convolutional method is used to generate a spatially correlated random field with specified spatial variability parameters, as follows:
[0037] (1) Generate independent standard normal random fields ; Based on the number and spatial arrangement of grid nodes, an initial empty matrix with the same row and column dimensions is constructed, where each cell corresponds to a grid location in the depth field. Subsequently, the probability density function of a standard normal distribution (mean 0, standard deviation 1) is used as the sampling basis. A pseudo-random number generation algorithm is used to independently sample each independent cell in the initial empty matrix, thus obtaining a set of statistically independent random variables. Arranging these random variables according to their grid spatial locations forms the initial independent standard normal random field. To ensure the reproducibility and experimental verifiability of the results from the independent standard normal random field, this application includes a random number seed input control in the interactive interface. Users can set a fixed integer value as the initial seed for the random number generator before the generation operation. When the seed value is fixed, the generation path of the pseudo-random number sequence is uniquely determined, ensuring that the normal random field values obtained each time the program is run are exactly the same, facilitating subsequent comparative analysis and result reproduction. The operation entry point for this generation process on the interface is as follows: Figure 3 As shown, users complete seed settings and trigger random field generation through this interface. The generated independent standard normal random field will serve as the basic input data for subsequent related random field construction or reliability analysis. Throughout the generation process, the random variables of all grid nodes strictly follow a standard normal distribution and are independent of each other. Their joint probability density function is the product of the marginal probability density functions of each node, mathematically guaranteeing the independent and identically distributed characteristics of the random field.
[0038] (2) Construct the exponential covariance kernel function; Based on spatial variation parameters a Construct an exponential covariance kernel function and calculate the kernel function value corresponding to each offset within the kernel window. The kernel weight matrix is obtained by summing and normalizing the kernel function values. : in a For spatial variation parameters, h The distance between any two grid nodes in the grid. The function value of the exponential covariance kernel. This is a normalized kernel weight matrix, and the sum of its elements is 1.
[0039] (3) Generate a spatially correlated Gaussian field through convolution operations; Using two-dimensional convolution to transform independent standard normal random fields With the normalized kernel weight matrix Perform convolution to obtain a spatially correlated Gaussian field. The specific calculation formula is as follows: To address the boundary effects caused by insufficient neighborhood information at the grid boundaries in convolution operations, this application employs periodic boundary conditions to extend the rectangular computational region. The core of this boundary condition lies in treating the rectangular depth field region spatially as a torus topology, where the left and right boundaries of the depth field are interconnected, and the upper and lower boundaries are interconnected. In actual convolution calculations, when the sliding window of the exponential covariance kernel function exceeds a certain boundary of the depth field region, the required data value is not set to zero or symmetrically extended. Instead, it is retrieved from the corresponding position on the opposite side of that boundary. For example, when the left side of the window exceeds the left boundary, data is extracted from the corresponding position on the right boundary; when the upper side of the window exceeds the upper boundary, data is extracted from the corresponding position on the lower boundary. This approach ensures that the convolution operation has consistent and complete neighborhood information throughout the entire grid region, avoiding statistical distortion caused by boundary truncation. Simultaneously, it maintains data continuity and periodicity in the circumferential direction, allowing the generated spatially correlated Gaussian field to transition smoothly at the boundaries, consistent with the physical continuity of the reinforcing steel surface in the circumferential direction. The field data output after convolution is the final spatially correlated Gaussian field. This field retains the mean and variance characteristics of the independent standard normal random field, and at the same time, it introduces controllable spatial correlation through the kernel function, which can serve as an important input for subsequent random field simulation or reliability analysis.
[0040] (4) Standardize the generated spatially correlated Gaussian field so that it follows a log-normal distribution.
[0041] Step 4: Generate a corrosion rate field: (1) Convert the spatially correlated Gaussian field into a uniformly distributed field by probability integral transformation; Using the cumulative distribution function of the standard normal distribution spatially related Gaussian fields The value of each point is converted into a cumulative probability value in the interval [0,1] to obtain a uniform distribution field. .
[0042] (2) The corrosion of reinforcing bars needs to be reflected in a specific reduction in depth, while a uniformly distributed field can only provide a cumulative probability. It is necessary to transform the abstract probability value into a specific corrosion rate (a real number between 0 and 1) so that the actual corrosion depth and remaining depth at each point on the reinforcing bar can be calculated. Therefore, this application uses a uniformly distributed field... The quantile function of the log-normal distribution (i.e., the inverse function of the cumulative distribution function) Perform an inverse transformation to convert it into a basic corrosion field with the target statistical characteristics:
[0043] in and The average corrosion of the cross section obtained in step 1 and maximum depth of corrosion rate The parameters of the log-normal distribution are obtained by inverse calculation. Lognorm.ppf is the "percent point function" of the log-normal distribution, which is the inverse function of the cumulative distribution function (CDF).
[0044] (3) In order to reflect the positive correlation between the corrosion rate and the original reinforcement depth, the rank mixing method is used to fuse the foundation corrosion field and the depth field: Calculate the basic corrosion field separately and depth field The rank is used to obtain the rank matrix. and Specifically, the value at each grid point is ranked in ascending order across the entire dataset, with the smallest value assigned rank 1 and the largest value assigned rank N (where N is the total number of grid points), resulting in a rank matrix. and .
[0045] And introduce deep correlation coefficient The value ranges from 0 to 1 and is used to characterize the dependence of the final corrosion rate on the original depth. The depth correlation coefficient is used... Performing a linear mixture of two rank matrices yields the mixed rank. :
[0046] in, The larger the value, the stronger the dependence of the corrosion rate on the original depth. There is no deep correlation at that time. The corrosion rate is entirely determined by the depth.
[0047] Mixed rank Mapping back to the quantiles of the underlying corrosion field yields the final corrosion rate field that incorporates depth-related parameters. The details are as follows: Following the ascending order of rank of each grid point in the mixed-rank system, the original values of all grid points in the basic corrosion field are sequentially refilled into their corresponding grid positions in ascending order. This ensures that the grid point with the smallest mixed-rank receives the minimum value in the basic corrosion field, and the grid point with the largest mixed-rank receives the maximum value. Through this mapping process, a final corrosion rate field incorporating depth correlation is ultimately generated. This method can, while completely preserving the original distribution morphology and statistical characteristics of the basic corrosion field, achieve a final corrosion rate field according to a specified depth correlation coefficient. By introducing a positive correlation with depth, we ensure that grid locations with greater depth are assigned larger corrosion rate values, thereby truly reflecting the physical law that the degree of corrosion on the steel surface intensifies with increasing depth.
[0048] (4) Calculate the final corrosion rate field related to the fusion depth. The actual average value, if compared with the average corrosion of the cross section If the relative deviation exceeds 5%, a scaling adjustment will be performed. After adjustment, the corrosion rate of some grid points decreased. It may exceed the theoretical maximum corrosion rate. To avoid numerical accumulation and abrupt distribution changes caused by hard truncation, a logistic function is used to perform a nonlinear mapping of the entire field, smoothly constraining the excessive corrosion rate value to (0.5). , Within the specified range, the details are as follows:
[0049] Check the corrosion rate Does the value exceed the theoretical maximum corrosion rate? If it exceeds, a logistic function is used to map it to (0.5). , Within the range. First control The maximum value was compressed to near the theoretical maximum corrosion rate. But not greater than the theoretical maximum corrosion rate Through hardness parameters Control other over-limits and The compression ratio between the maximum values is used to achieve non-linear compression of the excessive corrosion rate to (0.5). , Within this range, the greater the excess, the greater the compression, but the compressed values still maintain their original relative order and remain below the theoretical maximum corrosion rate. 0.5 higher than the lower limit The corrosion rate after compression is as follows:
[0050] in This is a hardness parameter that controls the steepness of the cutoff curve. The larger the value, the closer it is to a hard truncation. The smaller the size, the smoother the transition; The corrosion rate value to be cut off; This represents the theoretical maximum corrosion rate. This is the final corrosion rate value output after gentle truncation treatment.
[0051] This application employs a logistic function for gentle truncation, avoiding sharp spikes in the probability density function caused by a large number of outliers accumulating at the same threshold. Secondly, the truncated data retains its original relative order; larger values before truncation remain relatively larger than smaller values after truncation, ensuring the relative contrast of the spatial distribution within the corrosion rate field is not disrupted. Thirdly, the continuity of the truncation function guarantees the first-order smoothness of the entire field near the threshold, avoiding data discontinuities caused by numerical jumps, thus ensuring the consistency of the statistical characteristics of the final corrosion rate field data and the effectiveness of subsequent analysis. Users can independently adjust the maximum corrosion rate value through an interactive interface to control the truncation severity, meeting the flexibility requirements of data boundary processing in different application scenarios.
[0052] Step 5: Generate a 3D point cloud of the corroded steel reinforcement. Based on the corrosion rate field generated in Step 4, generate a 3D surface point cloud of the corroded steel reinforcement:
[0053] (1) Along the axial direction of the reinforcing bar by length Discretized The cross section (can be entered in the axial grid point count in the interactive interface, see...) Figure 3 ), along the circumferential direction by angle Discretized The number of points (can be entered in the circumferential grid point count field in the interactive interface, see...) Figure 3 ), forming discrete grid points .
[0054] (2) For each discrete grid point From the corrosion rate field Interpolation yields the corrosion rate value at that point. From the depth field Interpolation to obtain the original depth Calculate the corrosion depth: ; (3) Calculate the radius after corrosion: Ensure the radius is non-negative; if the calculated result is less than 0, then take 0.
[0055] (4) Calculate the three-dimensional coordinates based on the radius after corrosion to generate a point cloud: .
[0056] Step 6: Reconstruct the 3D surface mesh. Based on the point cloud generated in Step 5. Reconstruct the triangular mesh model:
[0057] (1) Arrange the point cloud by angle The vertices are stored in a vertex array in priority order, and each vertex contains three-dimensional coordinates. .
[0058] (2) Traverse the vertex array, for the current vertex Take three adjacent points: , and Generate triangles and .
[0059] (3) Use modular arithmetic to handle angular and directional boundaries: ,when When it is the last row, it automatically wraps back to row 0 to ensure that the cylindrical surface is circumferentially closed.
[0060] (4) Add end caps. For both ends of the reinforcing bar ( and Connect the boundary vertices with the center point of the end face to form a triangular sector closed model.
[0061] (5) Assemble the vertex array and the triangular fan closure model into an STL triangular mesh model. The output interface is as follows. Figure 5 As shown, the program's running status can be displayed, and the final STL file of the corroded steel bar is obtained as follows. Figure 6 As shown.
[0062] The relevant code program in this application is as follows: (1) Core algorithm for STL surface depth data extraction def extract_precise_contours(self, z_step=0.5, angle_step=1, min_points=50): bounds = self.mesh.vectors.min(axis=(0,1)), self.mesh.vectors.max(axis=(0,1)) z_levels = np.arange(bounds[0][2], bounds[1][2], z_step) angle_grid = np.arange(0, 360, angle_step) all_data = [] valid_z_levels = [] total_z = len(z_levels) for idx, z in enumerate(z_levels): self.update_progress(10 + int(70 * idx / total_z)) try: contour = self._get_precise_contour(z) if len(contour) <min_points:continue centroid = self._calculate_robust_centroid(contour) if centroid is None: continue distances, angles = self._calculate_radial_distances(contour,centroid) aligned_distances = self._align_to_angle_grid(distances, angles,angle_grid) for angle, dist in zip(angle_grid, aligned_distances): all_data.append({ 'STL file name': self.stl_name, 'Z': z, 'Angle': angle, 'Radius': dist, 'Deviation': dist - self.nominal_radius }) valid_z_levels.append(z) except Exception: continue if not all_data: raise ValueError("No valid contour data is extracted") self.results = pd.DataFrame(all_data) (2) Spatially correlated random field generation def generate_spatially_correlated_field(self, grid_shape, range_a, x_resolution=1.0, y_resolution=1.0): ny, nx = grid_shape independent_gaussian = np.random.normal(0, 1, grid_shape) kernel_radius = max(1, int(np.ceil(range_a / min(x_resolution, y_resolution) / 2))) y_kernel, x_kernel = np.mgrid[-kernel_radius:kernel_radius+1, -kernel_radius:kernel_radius+1] kernel_dist = np.sqrt((x_kernel * x_resolution)**2 + (y_kernel * y_resolution)**2) kernel_weights = np.exp(-kernel_dist / range_a) kernel_weights = kernel_weights / np.sum(kernel_weights) correlated_gaussian = convolve2d(independent_gaussian, kernel_weights, mode='same', boundary='wrap') correlated_gaussian = (correlated_gaussian - np.mean(correlated_gaussian)) / np.std(correlated_gaussian) return correlated_gaussian def apply_lognormal_transformation(self, gaussian_field, params): uniform_field = norm.cdf(gaussian_field) epsilon = 1e-10 uniform_field = np.clip(uniform_field, epsilon, 1 - epsilon) mu_log = params['mu_log'] sigma_log = params['sigma_log'] scale = params['scale'] lognormal_field = lognorm.ppf(uniform_field, s=sigma_log, scale=scale) return lognormal_field (3) Depth Correlation Fusion def incorporate_depth_correlation(self, base_field, depth_field,strength=0.45): if strength == 0: return base_field base_flat = base_field.flatten() depth_flat = depth_field.flatten() base_rank = np.argsort(np.argsort(base_flat)) depth_rank = np.argsort(np.argsort(depth_flat)) mixed_rank = base_rank * (1 - strength) + depth_rank * strength sorted_base = np.sort(base_flat) mixed_field_flat = sorted_base[np.argsort(np.argsort(mixed_rank))] return mixed_field_flat.reshape(base_field.shape) (4) 3D Point Cloud Generation def generate_3d_points(self, X_grid, Theta_grid, depth_grid): X_flat = X_grid.flatten() Theta_flat = Theta_grid.flatten() R_flat = depth_grid.flatten() x_cart = X_flat y_cart = R_flat * np.cos(Theta_flat) z_cart = R_flat * np.sin(Theta_flat) points_3d = np.column_stack([x_cart, y_cart, z_cart]) return points_3d, depth_grid (5) 3D surface mesh reconstruction def create_surface_mesh_with_continuity(self, X_grid, Theta_grid,effective_radius): num_theta, num_x = X_grid.shape vertices = for i in range(num_theta): for j in range(num_x): x = X_grid[i, j] theta = Theta_grid[i, j] r = effective_radius[i, j] vertices.append([x, r * np.cos(theta), r * np.sin(theta)]) vertices = np.array(vertices) faces = for i in range(num_theta): for j in range(num_x - 1): next_i = (i + 1) % num_theta v00 = i * num_x + j v01 = i * num_x + (j + 1) v10 = next_i * num_x + j v11 = next_i * num_x + (j + 1) faces.extend([[v00, v10, v01], [v01, v10, v11]]) faces = np.array(faces) return vertices, faces, (num_theta, num_x) The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for generating steel reinforcement corrosion fields based on spatial correlation, characterized in that, Includes the following steps: Step 1: Obtain the geometric parameters of the reinforcing bars and the input parameters of the corrosion rate; calculate the corrosion characteristic parameters and spatial variation parameters based on the input parameters of the corrosion rate. Step 2: Cut the STL model of the steel reinforcement, extract the contour points of each section, and obtain the surface depth data of the contour points. Based on the depth data, use the linear interpolation method to obtain the depth field. Step 3: Generate a spatially correlated random field with specified spatial variation parameters using a convolution method; Step 4: Convert the spatially correlated Gaussian field into a uniformly distributed field through probability integral transformation, and obtain the final corrosion rate field and corrosion rate value based on the uniformly distributed field and the depth field. Step 5: Generate a three-dimensional surface point cloud of the corroded steel bars based on the final corrosion rate field; Step 6: Reconstruct the triangular mesh model based on the 3D surface point cloud.
2. The method according to claim 1, characterized in that, The geometric parameters of the reinforcing bars in step 1 include the diameter of the reinforcing bars. axial length ; Corrosion characteristic parameters include the average corrosion rate of the cross section. Maximum corrosion rate of cross section and maximum depth of corrosion rate .
3. The method according to claim 2, characterized in that, The specific calculations for corrosion characteristic parameters and spatial variation parameters are as follows: Cross-sectional average corrosion based on corrosion rate input parameters The maximum corrosion rate of the cross section was calculated. Maximum depth corrosion rate And the average corrosion rate by depth, the specific calculation formula is as follows: Maximum corrosion rate of cross section: ; Maximum depth corrosion rate: ; Average corrosion rate at depth: ; Spatial variation parameters were obtained by calculating the average corrosion rate based on depth. : .
4. The method according to claim 1, characterized in that, Step 2 specifically includes: The surface depth data of the steel bar surface contour points is obtained by cutting the steel bar STL model layer by layer along the length of the steel bar, extracting the contour points of each section, and calculating the radial distance from the contour points to the centroid of the section. And extract the discrete coordinates of each measurement point from the surface depth data of the rebar according to the set step size; The depth field is obtained by interpolating the discrete coordinates of the measurement points using a linear interpolation method.
5. The method according to claim 4, characterized in that, The depth field is obtained by interpolating the discrete coordinates of the measurement points using a linear interpolation method, as follows: (1) The discrete coordinate points are set according to the preset axial step size. and circumferential arc length resolution Uniformly distributed grid nodes are constructed in both the axial and circumferential directions of the reinforcing bars. This forms a regular axial-circumferential two-dimensional grid; (2) Using the linear interpolation method, interpolation calculations are performed on the discrete coordinate points falling around each grid cell, as follows: For any target mesh node, linear interpolation is performed on the discrete coordinate points between two axially adjacent original measurement sections to obtain the depth values corresponding to the target's circumferential position on the two sections. A second linear interpolation is then performed along the circumferential direction to obtain the depth value at the mesh node. The depth values of the mesh nodes are then arranged regularly in both the axial and circumferential directions to obtain the depth field. .
6. The method according to claim 1, characterized in that, Step 3 specifically includes: Based on the number and spatial arrangement of grid nodes, an initial empty matrix with the same row and column dimensions is constructed. Using the probability density function of a standard normal distribution as the sampling basis, a pseudo-random number generation algorithm is used to independently sample each independent unit in the initial empty matrix to obtain random variables. These random variables are then arranged according to their spatial positions within the grid to obtain a normal random field. ; Based on spatial variation parameters a Construct an exponential covariance kernel function and calculate the kernel function value corresponding to each offset within the kernel window. The kernel weight matrix is obtained by summing and normalizing the kernel function values. ; Using two-dimensional convolution to transform normal random fields With kernel weight matrix Perform convolution to obtain a spatially correlated Gaussian field. The generated spatially correlated Gaussian field is then standardized.
7. The method according to claim 1, characterized in that, Step 4 specifically includes: Using the cumulative distribution function of the standard normal distribution spatially related Gaussian fields The value of each point is converted into a cumulative probability value in the interval [0,1] to obtain a uniform distribution field. ; uniformly distributed field The basic corrosion field is obtained by performing an inverse transformation on the quantile function of the log-normal distribution; The rank mixing method is used to fuse the basic corrosion field and the depth field to obtain the final corrosion rate field. And based on the final corrosion rate field With depth field The corrosion rate value is obtained.
8. The method according to claim 7, characterized in that, The final method for obtaining the corrosion field and depth field is as follows: Basic rust field and depth field The values at each grid node are sorted in ascending order, with the smallest value assigned rank 1 and the largest value assigned rank N, resulting in a rank matrix. and ; Using deep correlation coefficient Performing a linear mixture of two rank matrices yields the mixed rank. ; Mixed rank Mapping back to the quantiles of the underlying corrosion field yields the final corrosion rate field that incorporates depth-related parameters. ; Calculate the final corrosion rate field with fusion depth correlation The average value, if compared with the average corrosion value of the cross section If the relative deviation exceeds 5%, a scaling adjustment will be performed. ; Check the corrosion rate Does the value exceed the theoretical maximum corrosion rate? If it exceeds, a logistic function is used to map it to (0.5). , Within the specified interval, the specific calculation formula is as follows: in This is a hardness parameter that controls the steepness of the cutoff curve. The larger the value, the closer it is to a hard truncation. The smaller the size, the smoother the transition; The corrosion rate value to be cut off; This represents the theoretical maximum corrosion rate. This is the final corrosion rate value output after gentle truncation treatment.
9. The method according to claim 1, characterized in that, Step 5 specifically includes: Along the axial direction of the reinforcing bar by length Discretized A cross section, along the circumferential direction at an angle Discretized ( ) points, forming a discrete grid of points; For each discrete grid point, from the final corrosion rate field Interpolation yields the corrosion rate value at that point. From the depth field Interpolation to obtain the original depth Calculate the corrosion depth: ; And calculate the radius after corrosion: ; Calculate the three-dimensional coordinates based on the radius after corrosion to generate a point cloud: .
10. The method according to claim 1, characterized in that, Step 6 specifically includes: Point cloud by angle The vertices are stored sequentially in an array, with each vertex containing three-dimensional coordinates. ; Traverse the vertex array, for the current vertex Take three adjacent points: , and Generate triangles and ; Using modular arithmetic to handle angular and directional boundaries: ,when When it is the last row, it automatically wraps back to row 0 to ensure that the cylindrical surface is circumferentially closed. For both ends of the reinforcing bar, connect the boundary vertex with the center point of the end face to form a triangular sector closed model; Assemble the vertex array and the triangle fan closure model into an STL triangular mesh model.
