Method and device for calculating optical transmission path in three-dimensional dynamic fluid random medium
The flow field data is simplified by the clustering algorithm and voxel interpolation algorithm, and combined with the gradient maximum adaptive step algorithm, it solves the problem of low efficiency of ray tracing in three-dimensional dynamic fluid random media, and achieves an efficient and accurate light transmission path. calculate.
Patent Information
- Application Number
- CN202410957455.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-07-17
AI Technical Summary
The existing technology has low efficiency in calculating ray tracing in three-dimensional dynamic fluid random media, and it is difficult to effectively solve the intersection points of irregular optical windows, resulting in huge consumption of computing resources and time, and large errors.
The clustering algorithm and voxel interpolation algorithm are used to simplify the flow field data, and combined with the gradient maximum adaptive step algorithm, the intersection calculation of the ray tracing and the optical window is realized, and the step size is adaptively adjusted to improve calculation efficiency and accuracy.
It greatly improves the interpolation calculation efficiency in the ray tracing process, solves the problem of difficulty in solving the intersection of light rays and irregular optical windows, and ensures the improvement of calculation accuracy and efficiency.
Smart Images

Figure CN118734098A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of numerical simulation, and in particular to a method and device for calculating a light transmission path in a three-dimensional dynamic fluid random medium. Background Art
[0002] Fluid random media are substances or materials with random properties. The properties or behavior of these media are unpredictable to a certain extent and may vary randomly.
[0003] When a hypersonic vehicle flies, a high-frequency and high-speed random flow field is generated around it. The optical properties of this random flow field can be studied through experimental methods, such as wind tunnel experiments or flight tests. The experimental method is very expensive, and the conditions are uncontrollable, and the time and space parameters cannot be flexibly changed. Therefore, the analysis of dynamic optical properties in fluid random media through numerical simulation methods has important theoretical significance and application value.
[0004] When performing dynamic digital simulation on a dynamic flow field, transient simulation is used. In order to make the calculation converge, the time step is generally selected to be 1 / 10 or 1 / 100 of the time required for the fluid to pass through the flow field. Therefore, not all simulated flow fields need to be optically analyzed, and the flow field data that needs to be analyzed needs to be determined based on the dynamic changes of the flow field.
[0005] The propagation trajectory of light in the digital flow field is simulated through the ray tracing algorithm. The optical tracing method is to solve the numerical solution of the light equation. During the solution process, the interpolation algorithm needs to be run multiple times in the flow field. Repeated interpolation operations require a lot of computing resources and time.
[0006] The end point of optical tracing is the entrance pupil of the optical system. After the light passes through the optical window, it is no longer deflected, so it is necessary to determine the intersection of the light and the optical window. However, solving the mathematical model of the irregular optical window alone is not only inefficient, but also introduces new errors.
[0007] Therefore, it is necessary to develop an efficient computational method for the analysis of optical properties in dynamic random media. Summary of the invention
[0008] The embodiments of the present invention provide a method and device for calculating a light transmission path in a three-dimensional dynamic fluid random medium, so as to at least solve the technical problem of low efficiency of existing ray tracing.
[0009] According to an embodiment of the present invention, a method for calculating a light transmission path in a three-dimensional dynamic fluid random medium is provided, comprising the following steps:
[0010] S101: Based on the clustering algorithm, the data-driven evaluation parameters of the three-dimensional dynamic flow field are selected by iterative difference of the evaluation parameters;
[0011] S102: rotating and translating the three-dimensional dynamic flow field coordinates;
[0012] S103: interpolating the discrete flow field using a voxel interpolation algorithm;
[0013] S104: Determine the intersection point of the ray tracing and the optical window, calculate the adaptive range of the tracing step length, and use the gradient maximum adaptive step length algorithm to complete the optical tracing.
[0014] Furthermore, in step S101, the data-driven evaluation parameters for the three-dimensional dynamic flow field include:
[0015] The data of three-dimensional dynamic flow field is four-dimensional data composed of three-dimensional coordinates of nodes and flow field information data. When the node positions remain unchanged, the three-dimensional flow field data is simplified to one-dimensional flow field information data.
[0016] Different components of the flow field are fluids with different flow states. The fluids in the flow field are divided into k groups according to their flow states, and all flow field data are assigned to k clusters using the K-means clustering algorithm.
[0017] The simplified flow field information data is classified and the flow field is evaluated using the classification results.
[0018] Furthermore, in step S101, selecting flow field data by iterative difference of evaluation parameters includes:
[0019] After obtaining the Flow Field Cluster Evaluation value of the continuous flow field, the flow field is iteratively selected; the next group of flow field data to be analyzed after the a-th group of flow field data is selected, and when the FFCE of the a+n-th group of flow field data is a+n When the preset conditions are met, it is considered that the a+nth group of flow field data needs to be analyzed; the preset conditions are as follows:
[0020]
[0021] if Then the a+1th flow field is considered to be the flow field that needs to be analyzed;
[0022] if It is considered that the a+1th flow field is not the flow field that needs to be analyzed; next, FFCE a+1 Continue to iterate forward as a new starting point until a+n flow fields meet At this time, the a+nth flow field is the flow field that needs to be analyzed.
[0023] Furthermore, in step S103, the voxel interpolation algorithm includes:
[0024] Introduce voxels into the flow field and interpolate the flow field;
[0025] The flow field is divided into several voxels of the same size. If there is only one flow field point in the voxel, the refractive index in the voxel area is the value of the flow field point it contains; if the voxel contains several flow field points, the refractive index data in the voxel area is the average value of the flow field points it contains; if there is no flow field point in the voxel, the voxel is interpolated.
[0026] Furthermore, the voxel size solution method includes:
[0027] It is considered that the voxel size meets the requirement when the ratio of flow field points with the same voxel position to the total flow field points is less than or equal to γ; the algorithm for solving the voxel size is performed as follows:
[0028] (1) Setting a larger initial voxel size according to the size of the flow field grid;
[0029] (2) Calculate the voxel position of each flow field information point;
[0030] (3) Find whether there are the same voxel positions and calculate the proportion μ of flow field information points at the same voxel position to the total flow field information points;
[0031] (4) Reduce the size of the voxel and repeat steps (2)-(3) until μ<γ.
[0032] Further, the optical probe comprises:
[0033] The optical probe interpolates the refractive index field near the tracing light and solves the intersection point between the light and the optical window;
[0034] Let the angle of incidence of the light be [α, β, γ], the distance between the image plane and the infinitely distant plane be tl, and the initial point of the light be (x1, y1, z1);
[0035] The construction algorithm of the light probe is as follows:
[0036] (1) Calculate the light emission direction vector [cosα, cosβ, cosγ];
[0037] (2) Calculate the points [x r ,y r ,z r ];
[0038] (3) Calculate the distance from the aircraft surface node to [x r ,y r ,z r ]; the point on the light probe corresponding to the minimum distance is the starting point of the light on the conformal optical window (xs ,y s ,z s ); for the starting point on the optical window (x s ,y s ,z s ) to detect the flow field after
[0039] (4) Constructing an extended matrix er of the optical probe; the er matrix consists of an r×r×r matrix, where r>3; sliding er along the light probe to extend the light probe into a columnar region; obtaining the coordinates of all voxels that the light trace passes through and will be used through the extended light probe;
[0040] (5) After obtaining the required voxel coordinates using the ray probe at all the initial points of the rays, first remove the duplicate voxel coordinates, and then record and remove the voxel coordinates that overlap with the original nodes;
[0041] (6) Interpolate the voxels detected by the optical probe.
[0042] Furthermore, the gradient maximum adaptive step size algorithm includes:
[0043] Based on the algorithm for solving the voxel size, the range of the adaptive step size is solved: the voxel size when all flow field points do not have the same voxel position is the minimum value S of the adaptive step size low , when the proportion of flow field points at the same voxel position to the total flow field points is less than or equal to γ, the voxel size is the maximum value of the adaptive step size S high ;
[0044] The flow field refractive index gradient is continuously recorded during the ray tracing process;
[0045] If the new gradient value Greater than the maximum value recorded Set the step size to the minimum value Slow; if the new gradient value Less than the minimum value recorded Set the step size to the maximum value S high ; If the new gradient value Less than the maximum value recorded and is greater than the minimum value recorded The step size adaptation rate is designed according to the classical PD control theory.
[0046] According to another embodiment of the present invention, there is provided a device for calculating a light transmission path in a three-dimensional dynamic fluid random medium, comprising:
[0047] A flow field data selection unit, for selecting flow field data by using iterative difference of the evaluation parameters for data-driven evaluation parameters of the three-dimensional dynamic flow field based on a clustering algorithm;
[0048] A rotation and translation unit, used for rotating and translating the coordinates of the three-dimensional dynamic flow field;
[0049] An interpolation unit, used for interpolating the discrete flow field using a voxel interpolation algorithm;
[0050] The intersection determination unit is used to determine the intersection of the ray tracing and the optical window, calculate the adaptive range of the tracing step length, and complete the optical tracing using the gradient maximum adaptive step length algorithm.
[0051] A storage medium stores a program file capable of realizing any one of the above-mentioned methods for calculating a light transmission path in a three-dimensional dynamic fluid random medium.
[0052] A processor is used to run a program, wherein when the program is run, the method for calculating the light transmission path in a three-dimensional dynamic fluid random medium described above is executed.
[0053] The method and device for calculating the light transmission path in the three-dimensional dynamic fluid random medium in the embodiment of the present invention can effectively reduce unnecessary analysis, and propose a new flow field interpolation method and algorithm, which greatly improves the efficiency of interpolation calculation in the ray tracing process. Based on the characteristics of flow field voxels and interpolation algorithms, the problem of difficulty in solving the intersection of light and irregular optical windows is solved. Finally, the proposed adaptive step size algorithm for iteration in a continuous flow field not only improves the calculation efficiency, but also ensures sufficient calculation accuracy. The present invention can greatly improve the calculation efficiency and accuracy of the light transmission path in the three-dimensional dynamic fluid random medium. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0055] Figure 1 It is a flow chart of the method for calculating the light transmission path in the three-dimensional dynamic fluid random medium of the present invention;
[0056] Figure 2 This is a diagram of the flow field data dimensionality reduction and clustering algorithm classification results in the present invention;
[0057] Figure 3 This is a flow field coordinate conversion result diagram in the present invention;
[0058] Figure 4 The interpolation rule of the three-dimensional flow field and the gradient maximum adaptive step length algorithm diagram in the present invention;
[0059] Figure 5 This is a module diagram of a device for calculating a light transmission path in a three-dimensional dynamic fluid random medium of the present invention. DETAILED DESCRIPTION
[0060] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0061] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0062] Example 1
[0063] According to an embodiment of the present invention, a method for calculating a light transmission path in a three-dimensional dynamic fluid random medium is provided. Figure 1 , including the following steps:
[0064] S101: Based on the clustering algorithm, the data-driven evaluation parameters of the three-dimensional dynamic flow field are selected by iterative difference of the evaluation parameters;
[0065] S102: rotating and translating the three-dimensional dynamic flow field coordinates;
[0066] S103: interpolating the discrete flow field using a voxel interpolation algorithm;
[0067] S104: Determine the intersection point of the ray tracing and the optical window, calculate the adaptive range of the tracing step length, and use the gradient maximum adaptive step length algorithm to complete the optical tracing.
[0068] The method for calculating the light transmission path in the three-dimensional dynamic fluid random medium in the embodiment of the present invention can effectively reduce unnecessary analysis, and proposes a new flow field interpolation method and algorithm, which greatly improves the efficiency of interpolation calculation in the ray tracing process. Based on the characteristics of flow field voxels and interpolation algorithms, the problem of difficulty in solving the intersection of light and irregular optical windows is solved. Finally, the proposed adaptive step size algorithm for iteration in a continuous flow field not only improves the calculation efficiency, but also ensures sufficient calculation accuracy. The present invention can greatly improve the calculation efficiency and accuracy of the light transmission path in the three-dimensional dynamic fluid random medium.
[0069] Specifically, see Figure 2-4 , the specific process of the present invention includes:
[0070] 1. Based on the clustering algorithm, a data-driven evaluation parameter for three-dimensional dynamic flow field is proposed, and the flow field is selected by iterative difference of the evaluation parameters.
[0071] The data of the three-dimensional flow field is four-dimensional data composed of the three-dimensional coordinates of the nodes and the flow field data. When the node position remains unchanged, the three-dimensional flow field data is simplified to one-dimensional flow field data. Different components of the flow field are fluids with different flow states. There are obvious differences in the flow field data of each component. Therefore, the fluid in the flow field can be divided into k groups according to its flow state. The amount of data in the three-dimensional flow field is a geometric multiple of that in the three-dimensional flow field. In order to cope with the huge amount of data, the CLARA algorithm is used here to assign all the flow field data to k clusters.
[0072] After classifying the simplified flow field information data, the classification results are used to evaluate the flow field.
[0073] Define the evaluation parameters Flow Field Cluster Evaluation (FFCE).
[0074]
[0075] In the formula, K numi , i = 1, 2, 3, ... k represents the number of simplified flow field data contained in each cluster; K ci , i=1,2,3,...k represents the centroid of each cluster; DP i , i=1,2,3,...k represents the distance from each simplified flow field data in each cluster to the cluster centroid; f a (K numi ) is about K numi The weighting function of b (DP i ) is about DP i The discrete degree function of .
[0076] Each parameter has different physical meanings: K numi Represents the amount of different flow field components. The change of this parameter in different flow fields reflects the dynamic characteristics of the continuous flow field. ci Represents the average density of different flow field components and reflects the intensity of the flow field. i Represents the dynamic range of different flow field components.
[0077] After obtaining the FFCE value of the continuous flow field, the flow field is iteratively selected. The next group of flow field data to be analyzed after the ath group of flow field data is selected. When the FFCE value of the a+nth group of flow field data is a+n When the following conditions are met, it is considered that the a+nth group of flow field data needs to be analyzed:
[0078]
[0079] if Then the a+1th flow field is considered to be the flow field that needs to be analyzed;
[0080] if It is considered that the a+1th flow field is not the flow field that needs to be analyzed. Then, FFCE a+1 Continue to iterate forward as a new starting point until a+n flow fields meet At this time, the a+nth flow field is the flow field that needs to be analyzed.
[0081] 2: Rotate and translate the three-dimensional flow field coordinates
[0082] The coordinates of the original nodes in the flow field are translated and rotated. Determine the new origin (x0, y0, z0) relative to the original coordinate origin; θ is the angle of counterclockwise rotation around the coordinate axis. For a three-dimensional flow field, the new node coordinates (x t ,y t ,z t ) is calculated as follows:
[0083] (x t ,y t ,z t )=T+R×(x,y,z)' (2)
[0084] Wherein, T is the translation matrix, T = (x0, y0, z0)'; R is the rotation matrix.
[0085] The rotation matrix R after the coordinate point rotates counterclockwise around the x-axis by θ x for:
[0086]
[0087] The rotation matrix R after the coordinate point is rotated counterclockwise around the y-axis by θy for:
[0088]
[0089] The rotation matrix R after the coordinate point is rotated counterclockwise around the z axis by θ z for:
[0090]
[0091] 3: Interpolate the discrete flow field using voxel interpolation algorithm
[0092] According to the Gladstone-Dale formula, the density field of the flow field is converted into the refractive index field. The refractive index in the flow field can be expressed as:
[0093] n=1+K GD ·ρ (6)
[0094] Where n represents the corresponding refractive index, ρ represents the flow field density, K GD It is called the GD constant.
[0095] The idea of voxels is introduced into the flow field to interpolate the flow field. A voxel is a square or cube whose value can differentiate the entire flow field area. The flow field is divided into several voxels of the same size. If there is only one flow field point in a voxel, the refractive index in the voxel area is considered to be the value of the flow field point it contains. If a voxel contains several flow field points, the refractive index data in the voxel area is considered to be the average value of the flow field points it contains. If there is no flow field point in the voxel, then the voxel needs to be interpolated. The interpolation method is the distance weighted inverse method.
[0096]
[0097] In the formula, sn i represents the refractive index of the nearest voxel to the interpolation point, d i represents the distance between the interpolation voxels that are most recently searched, and N represents the refractive index of the interpolation voxel. The methods for finding the nearest neighbor voxels include K Nearest Neighbors (KNN) and the like.
[0098] It is considered that the voxel size meets the requirement when the proportion of flow field points with the same voxel position to the total flow field points is less than or equal to γ. The algorithm for solving the voxel size is executed as follows:
[0099] (1) Set a larger initial voxel size according to the size of the flow field grid.
[0100] (2) Calculate the voxel position of each flow field point.
[0101] (3) Find out whether there are the same voxel positions and calculate the proportion μ of flow field points with the same voxel position to the total flow field points.
[0102] (4) Reduce the size of the voxel and repeat steps (2)-(3) until μ<γ.
[0103] 4: Determine the intersection of the ray trace and the optical window, calculate the adaptive range of the ray trace step length, and implement the adaptive step length algorithm
[0104] After completing the conversion and interpolation of the refractive index field of the flow field, the inverse optical tracing method is used to trace the light of the flow field. The light starts from the entrance pupil of the optical system and intersects with the optical window. The intersection of the light and the optical window is calculated by combining the differential characteristics of the voxel and the interpolation characteristics of the interpolation algorithm. The algorithm flow is as follows:
[0105] (1) Extract the surface of the target model separately.
[0106] (2) Set the entrance pupil position, entrance pupil size, and incident angle of light.
[0107] (3) Trace the light back toward the optical window.
[0108] (4) At the same time, the KNN algorithm is used to continuously search for the nearest flow field point.
[0109] (5) Repeat steps (3)-(4) until the distance between the end of the ray and the nearest point changes from continuously decreasing to continuously increasing. The point corresponding to the minimum distance on the ray is taken as the starting point of the optical tracing.
[0110] Step-by-step ray tracing is done by numerically solving the ray equation. The ray equation is as follows:
[0111]
[0112] In the formula represents the refractive index gradient of the flow field, represents the light vector, and s represents the path length. The solution to the light equation is the fourth-order Runge-Kutta method.
[0113] Based on the algorithm for solving the voxel size, the range of the adaptive step size can be solved. The voxel size when all flow field points do not have the same voxel position is the minimum value S of the adaptive step size. low , when the proportion of flow field points at the same voxel position to the total flow field points is less than or equal to γ, the voxel size is the maximum value of the adaptive step size S high .
[0114] The flow field refractive index gradient is continuously recorded during the ray tracing process.
[0115] If the new gradient value Greater than the maximum value recorded Set the step size to the minimum value S low ;
[0116] If the new gradient value Less than the minimum value recorded Set the step size to the maximum value S high ;
[0117] If the new gradient value Less than the maximum value recorded and is greater than the minimum value recorded The step length is calculated based on the classical control theory - PD control. The calculation method is as follows:
[0118]
[0119] e(t)=gradn-gradn min (10)
[0120] Where: u(t) is the output of the controller;
[0121] e(t) is the error at the current moment, that is, the difference between the expected value and the actual value;
[0122] K p is the proportional gain, which controls the influence of the proportional part;
[0123] K d is the derivative gain, which controls the influence of the derivative part;
[0124] is the rate of change of the error, that is, the derivative of the error.
[0125] Where K p and K d The setting is adjusted based on the current known refractive index gradient value.
[0126]
[0127] kn+kl=1 (13)
[0128] Where GD is the difference in refractive index gradient. The maximum and minimum values of GD are synchronized to the next flow field and updated iteratively.
[0129] Example 2
[0130] According to another embodiment of the present invention, a device for calculating a light transmission path in a three-dimensional dynamic fluid random medium is provided. Figure 5 ,include:
[0131] The flow field data selection unit 201 is used to select flow field data by iterative difference of the evaluation parameters based on the data-driven evaluation parameters of the three-dimensional dynamic flow field based on the clustering algorithm;
[0132] A rotation and translation unit 202, used to rotate and translate the three-dimensional dynamic flow field coordinates;
[0133] An interpolation unit 203, used to interpolate the discrete flow field using a voxel interpolation algorithm;
[0134] The intersection determination unit 204 is used to determine the intersection of the ray tracing and the optical window, calculate the adaptive range of the tracing step length, and complete the optical tracing using the gradient maximum adaptive step length algorithm.
[0135] The device for calculating the light transmission path in the three-dimensional dynamic fluid random medium in the embodiment of the present invention can effectively reduce unnecessary analysis, and proposes a new flow field interpolation method and algorithm, which greatly improves the efficiency of interpolation calculation in the ray tracing process. Based on the characteristics of flow field voxels and interpolation algorithms, the problem of difficulty in solving the intersection of light and irregular optical windows is solved. Finally, the proposed adaptive step size algorithm for iteration in a continuous flow field not only improves the calculation efficiency, but also ensures sufficient calculation accuracy. The present invention can greatly improve the calculation efficiency and accuracy of the light transmission path in the three-dimensional dynamic fluid random medium.
[0136] Specifically, see Figure 2-4 , the specific process of the present invention includes:
[0137] 1. Based on the clustering algorithm, a data-driven evaluation parameter for three-dimensional dynamic flow field is proposed, and the flow field is selected by iterative difference of the evaluation parameters.
[0138] The data of the three-dimensional flow field is four-dimensional data composed of the three-dimensional coordinates of the nodes and the flow field data. When the node position remains unchanged, the three-dimensional flow field data is simplified to one-dimensional flow field data. Different components of the flow field are fluids with different flow states. There are obvious differences in the flow field data of each component. Therefore, the fluid in the flow field can be divided into k groups according to its flow state. The amount of data in the three-dimensional flow field is a geometric multiple of that in the three-dimensional flow field. In order to cope with the huge amount of data, the CLARA algorithm is used here to assign all the flow field data to k clusters.
[0139] After classifying the simplified flow field information data, the classification results are used to evaluate the flow field.
[0140] Define the evaluation parameters Flow Field Cluster Evaluation (FFCE).
[0141]
[0142] In the formula, Knumi , i = 1, 2, 3, ... k represents the number of simplified flow field data contained in each cluster; K ci , i=1,2,3,...k represents the centroid of each cluster; DP i , i=1,2,3,...k represents the distance from each simplified flow field data in each cluster to the cluster centroid; f a (K numi ) is about K numi The weighting function of b (DP i ) is about DP i The discrete degree function of .
[0143] Each parameter has different physical meanings: K numi Represents the amount of different flow field components. The change of this parameter in different flow fields reflects the dynamic characteristics of the continuous flow field. ci Represents the average density of different flow field components and reflects the intensity of the flow field. i Represents the dynamic range of different flow field components.
[0144] After obtaining the FFCE value of the continuous flow field, the flow field is iteratively selected. The next group of flow field data to be analyzed after the ath group of flow field data is selected. When the FFCE value of the a+nth group of flow field data is a+n When the following conditions are met, it is considered that the a+nth group of flow field data needs to be analyzed.
[0145]
[0146] if The a+1th flow field is considered to be the flow field that needs to be analyzed.
[0147] if It is considered that the a+1th flow field is not the flow field that needs to be analyzed. Then, FFCE a+1 Continue to iterate forward as a new starting point until a+n flow fields meet At this time, the a+nth flow field is the flow field that needs to be analyzed.
[0148] 2: Rotate and translate the three-dimensional flow field coordinates
[0149] The coordinates of the original nodes in the flow field are translated and rotated. Determine the new origin (x0, y0, z0) relative to the original coordinate origin; θ is the angle of counterclockwise rotation around the coordinate axis. For a three-dimensional flow field, the new node coordinates (x t ,y t ,z t ) is calculated as follows:
[0150] (xt ,y t ,z t )=T+R×(x,y,z)' (2)
[0151] Wherein, T is the translation matrix, T = (x0, y0, z0)'; R is the rotation matrix.
[0152] The rotation matrix R after the coordinate point rotates counterclockwise around the x-axis by θ x for:
[0153]
[0154] The rotation matrix R after the coordinate point is rotated counterclockwise around the y-axis by θ y for:
[0155]
[0156] The rotation matrix R after the coordinate point is rotated counterclockwise around the z axis by θ z for:
[0157]
[0158] 3: Interpolate the discrete flow field using voxel interpolation algorithm
[0159] According to the Gladstone-Dale formula, the density field of the flow field is converted into the refractive index field. The refractive index in the flow field can be expressed as:
[0160] n=1+K GD ·ρ (6)
[0161] Where n represents the corresponding refractive index, ρ represents the flow field density, K GD It is called the GD constant.
[0162] The idea of voxels is introduced into the flow field to interpolate the flow field. A voxel is a square or cube whose value can differentiate the entire flow field area. The flow field is divided into several voxels of the same size. If there is only one flow field point in a voxel, the refractive index in the voxel area is considered to be the value of the flow field point it contains. If a voxel contains several flow field points, the refractive index data in the voxel area is considered to be the average value of the flow field points it contains. If there is no flow field point in the voxel, then the voxel needs to be interpolated. The interpolation method is the distance weighted inverse method.
[0163]
[0164] In the formula, sn i represents the refractive index of the nearest voxel to the interpolation point, d irepresents the distance between the interpolation voxels that are most recently searched, and N represents the refractive index of the interpolation voxel. The methods for finding the nearest neighbor voxels include K Nearest Neighbors (KNN) and the like.
[0165] It is considered that the voxel size meets the requirement when the proportion of flow field points with the same voxel position to the total flow field points is less than or equal to γ. The algorithm for solving the voxel size is executed as follows:
[0166] (1) Set a larger initial voxel size according to the size of the flow field grid.
[0167] (2) Calculate the voxel position of each flow field point.
[0168] (3) Find out whether there are the same voxel positions and calculate the proportion μ of flow field points with the same voxel position to the total flow field points.
[0169] (4) Reduce the size of the voxel and repeat steps (2)-(3) until μ<γ.
[0170] 4: Determine the intersection of the ray trace and the optical window, calculate the adaptive range of the ray trace step length, and implement the adaptive step length algorithm
[0171] After completing the conversion and interpolation of the refractive index field of the flow field, the inverse optical tracing method is used to trace the light of the flow field. The light starts from the entrance pupil of the optical system and intersects with the optical window. The intersection of the light and the optical window is calculated by combining the differential characteristics of the voxel and the interpolation characteristics of the interpolation algorithm. The algorithm flow is as follows:
[0172] (1) Extract the surface of the target model separately.
[0173] (2) Set the entrance pupil position, entrance pupil size, and incident angle of light.
[0174] (3) Trace the light back toward the optical window.
[0175] (4) At the same time, the KNN algorithm is used to continuously search for the nearest flow field point.
[0176] (5) Repeat steps (3)-(4) until the distance between the end of the ray and the nearest point changes from continuously decreasing to continuously increasing. The point corresponding to the minimum distance on the ray is taken as the starting point of the optical tracing.
[0177] Step-by-step ray tracing is done by numerically solving the ray equation. The ray equation is as follows:
[0178]
[0179] In the formula represents the refractive index gradient of the flow field, represents the light vector, and s represents the path length. The solution to the light equation is the fourth-order Runge-Kutta method.
[0180] Based on the algorithm for solving the voxel size, the range of the adaptive step size can be solved. The voxel size when all flow field points do not have the same voxel position is the minimum value S of the adaptive step size. low , when the proportion of flow field points at the same voxel position to the total flow field points is less than or equal to γ, the voxel size is the maximum value of the adaptive step size S high .
[0181] The flow field refractive index gradient is continuously recorded during the ray tracing process.
[0182] If the new gradient value Greater than the maximum value recorded Set the step size to the minimum value S low ;
[0183] If the new gradient value Less than the minimum value recorded Set the step size to the maximum value S high ;
[0184] If the new gradient value Less than the maximum value recorded and is greater than the minimum value recorded The step length is calculated based on the classical control theory - PD control. The calculation method is as follows:
[0185]
[0186] e(t)=gradn-gradn min (10)
[0187] Where: u(t) is the output of the controller;
[0188] e(t) is the error at the current moment, that is, the difference between the expected value and the actual value;
[0189] K p is the proportional gain, which controls the influence of the proportional part;
[0190] K d is the derivative gain, which controls the influence of the derivative part;
[0191] is the rate of change of the error, that is, the derivative of the error.
[0192] Where K p and K d The setting is adjusted based on the current known refractive index gradient value.
[0193]
[0194] kn+kl=1 (13)
[0195] Where GD is the difference in refractive index gradient. The maximum and minimum values of GD are synchronized to the next flow field and updated iteratively.
[0196] Example 3
[0197] A storage medium stores a program file capable of realizing any one of the above-mentioned methods for calculating a light transmission path in a three-dimensional dynamic fluid random medium.
[0198] Example 4
[0199] A processor is used to run a program, wherein when the program is run, the method for calculating the light transmission path in a three-dimensional dynamic fluid random medium described above is executed.
[0200] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0201] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0202] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the system embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0203] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0204] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0205] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0206] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for calculating the light transmission path in a three-dimensional dynamic fluid random medium, characterized in that: The following steps are involved: S101: Based on the clustering algorithm, the data-driven evaluation parameters of the three-dimensional dynamic flow field are selected by iterative difference of the evaluation parameters; S102: rotating and translating the three-dimensional dynamic flow field coordinates; S103: interpolating the discrete flow field using a voxel interpolation algorithm; S104: Determine the intersection point of the ray tracing and the optical window, calculate the adaptive range of the tracing step length, and use the gradient maximum adaptive step length algorithm to complete the optical tracing.
2. The method for calculating the light transmission path in a three-dimensional dynamic fluid random medium according to claim 1, characterized in that: In step S101, the data-driven evaluation parameters for the three-dimensional dynamic flow field include: The data of three-dimensional dynamic flow field is four-dimensional data composed of three-dimensional coordinates of nodes and flow field information data. When the node positions remain unchanged, the three-dimensional flow field data is simplified to one-dimensional flow field information data. Different components of the flow field are fluids with different flow states. The fluids in the flow field are divided into k groups according to their flow states, and all flow field data are assigned to k clusters using the K-means clustering algorithm. The simplified flow field information data is classified and the flow field is evaluated using the classification results.
3. The method for calculating the light transmission path in a three-dimensional dynamic fluid random medium according to claim 2, characterized in that: In step S101, selecting flow field data using iterative difference of evaluation parameters includes: After obtaining the Flow Field Cluster Evaluation value of the continuous flow field, the flow field is iteratively selected; the next group of flow field data to be analyzed after the a-th group of flow field data is selected, and when the FFCE of the a+n-th group of flow field data is a+n When the preset conditions are met, it is considered that the a+nth group of flow field data needs to be analyzed; the preset conditions are as follows: if Then the a+1th flow field is considered to be the flow field that needs to be analyzed; if It is considered that the a+1th flow field is not the flow field that needs to be analyzed; next, FFCE a+1 Continue to iterate forward as a new starting point until a+n flow fields meet At this time, the a+nth flow field is the flow field that needs to be analyzed.
4. The method for calculating the light transmission path in a three-dimensional dynamic fluid random medium according to claim 1, characterized in that: In step S103, the voxel interpolation algorithm includes: Introduce voxels into the flow field and interpolate the flow field; The flow field is divided into several voxels of the same size. If there is only one flow field point in the voxel, the refractive index in the voxel area is the value of the flow field point it contains; if the voxel contains several flow field points, the refractive index data in the voxel area is the average value of the flow field points it contains; if there is no flow field point in the voxel, the voxel is interpolated.
5. The method for calculating the light transmission path in a three-dimensional dynamic fluid random medium according to claim 4, characterized in that: The voxel size solution methods include: It is considered that the voxel size meets the requirement when the ratio of flow field points with the same voxel position to the total flow field points is less than or equal to γ; the algorithm for solving the voxel size is performed as follows: (1) Setting a larger initial voxel size according to the size of the flow field grid; (2) Calculate the voxel position of each flow field information point; (3) Find whether there are the same voxel positions and calculate the proportion μ of flow field information points at the same voxel position to the total flow field information points; (4) Reduce the size of the voxel and repeat steps (2)-(3) until μ<γ.
6. The method for calculating the light transmission path in a three-dimensional dynamic fluid random medium according to claim 4, characterized in that: Optical probes include: The optical probe interpolates the refractive index field near the tracing light and solves the intersection point between the light and the optical window; Let the angle of incidence of the light be [α, β, γ], the distance between the image plane and the infinitely distant plane be tl, and the initial point of the light be (x1, y1, z1); The construction algorithm of the light probe is as follows: (1) Calculate the light emission direction vector [cosα, cosβ, cosγ]; (2) Calculate the points [x r ,y r ,z r ]; (3) Calculate the distance from the aircraft surface node to [x r ,y r ,z r ]; the point on the light probe corresponding to the minimum distance is the starting point of the light on the conformal optical window (x s ,y s ,z s ); for the starting point on the optical window (x s ,y s ,z s ) to detect the flow field after (4) Constructing an extended matrix er of the optical probe; the er matrix consists of an r×r×r matrix, where r>3; sliding er along the light probe to extend the light probe into a columnar region; obtaining the coordinates of all voxels that the light trace passes through and will be used through the extended light probe; (5) After obtaining the required voxel coordinates using the ray probe at all the initial points of the rays, first remove the duplicate voxel coordinates, and then record and remove the voxel coordinates that overlap with the original nodes; (6) Interpolate the voxels detected by the optical probe.
7. The method for calculating the light transmission path in a three-dimensional dynamic fluid random medium according to claim 6, characterized in that: The gradient maximum adaptive step size algorithm includes: Based on the algorithm for solving the voxel size, the range of the adaptive step size is solved: the voxel size when all flow field points do not have the same voxel position is the minimum value S of the adaptive step size low , when the proportion of flow field points at the same voxel position to the total flow field points is less than or equal to γ, the voxel size is the maximum value of the adaptive step size S high ; The flow field refractive index gradient is continuously recorded during the ray tracing process; If the new gradient value Greater than the maximum value recorded Set the step size to the minimum value S low ; If the new gradient value Less than the minimum value recorded Set the step size to the maximum value S high ; If the new gradient value Less than the maximum value recorded and is greater than the minimum value recorded The step size adaptation rate is designed according to the classical PD control theory.
8. A device for calculating the light transmission path in a three-dimensional dynamic fluid random medium, characterized in that: include: A flow field data selection unit, for selecting flow field data by using iterative difference of the evaluation parameters for data-driven evaluation parameters of the three-dimensional dynamic flow field based on a clustering algorithm; A rotation and translation unit, used for rotating and translating the coordinates of the three-dimensional dynamic flow field; An interpolation unit, used for interpolating the discrete flow field using a voxel interpolation algorithm; The intersection determination unit is used to determine the intersection of the ray tracing and the optical window, calculate the adaptive range of the tracing step length, and complete the optical tracing using the gradient maximum adaptive step length algorithm.
Citation Information
Patent Citations
Moving object segmentation method based on optical flow field clustering
CN104156932A
Numerical computation method for pneumatic optical transmission effect on imaging quality of high-speed aircraft
CN107832532A
Multi-particle-size filler filling type composite material fluidity simulation method
CN114357902A
Hood radiation light transmission calculation method in aerodynamic thermal environment
CN116186995A
Method and system for evaluating optical disturbances occurring in a supersonic flow field
US20050225747A1
Cited By
Modeling method of shock wave light field in hypersonic flow field
CN121009835A
Modeling method of shock wave light field in hypersonic flow field
CN121009835B
