Single-phase flow field real-time synchronous measurement method and system
By using an optical flow estimation model based on the Transformer architecture and a flow-attention mechanism, the problem of low computational efficiency in traditional particle image velocimetry algorithms for flow field measurement is solved. This enables high-precision, real-time measurement of single-phase flow fields and real-time monitoring of complex flows, improving computational efficiency and robustness.
Patent Information
- Application Number
- CN202510718005.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-05-30
AI Technical Summary
Traditional particle image velocimetry algorithms suffer from low computational efficiency, limited dynamic range, sensitivity to image quality, and insufficient three-dimensional adaptability in flow field measurements, making it difficult to meet the measurement requirements of high real-time performance and multi-physics coupling.
An optical flow estimation model based on the Transformer architecture is adopted. A source competition mechanism and a sink allocation mechanism are constructed using the flow-attention mechanism. Feature extraction and flow field prediction are performed through the optical flow estimation model. Combined with a multi-level decoder and a cyclic update strategy, high-resolution optical flow features are generated.
It achieves high-precision, real-time measurement of single-phase flow fields, improves computational efficiency and robustness, adapts to complex flow scenarios, reduces system complexity and manual post-processing costs, and supports real-time monitoring and closed-loop control.
Smart Images

Figure CN120598909B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flow field measurement technology, and in particular to a method and system for real-time synchronous measurement of single-phase flow fields. Background Technology
[0002] While traditional algorithms for particle image velocimetry (PIV) are widely used in flow field measurements, their computational complexity increases exponentially with the number of windows and image resolution due to window-by-window cross-correlation operations to match particle image pairs. This results in low computational efficiency, limited dynamic range, sensitivity to image quality, and insufficient 3D adaptability. Although optimizations have been implemented using methods such as window deformation and multi-grid iteration, the core framework still struggles to fully meet the measurement requirements of high real-time performance, strong unsteadiness, and multi-physics coupling. Summary of the Invention
[0003] The purpose of this invention is to provide a method and system for real-time synchronous measurement of single-phase flow fields, aiming to solve or improve at least one of the above-mentioned technical problems.
[0004] To achieve the above objectives, the present invention provides the following solution:
[0005] A method for real-time synchronous measurement of single-phase flow fields includes:
[0006] Acquire image data of the target phase; the target phase is either a gas phase or a liquid phase.
[0007] An optical flow estimation model based on the Transformer architecture is constructed. The optical flow estimation model includes an encoder and a multi-level decoder with connections, and adopts a stream-attention mechanism. The stream-attention mechanism is used to build a source competition mechanism by retaining the incoming data information stream, realize information aggregation in non-trivial scenarios, and then form a sink allocation mechanism by saving the source output stream to filter and select the aggregated information.
[0008] The optical flow estimation model is used to extract features from the image data, and the flow field of the target phase is predicted based on the extracted features to obtain the final target flow field.
[0009] Optionally, the optical flow estimation model is used to extract features from the image data, and the flow field of the target phase is predicted based on the extracted features to obtain the final target flow field, specifically including:
[0010] The image data is input into the optical flow estimation model, and scale features are extracted using an encoder to obtain two frames of features. The two frames of features are then input into the first and second computing terminals respectively for self-attention calculation. The calculation results are then used to calculate the correlation between pixels through cross-attention. The first computing terminal calculates the query vector, and the second computing terminal calculates the key and value vectors.
[0011] Based on the inter-pixel correlation, a matching cost is dynamically generated, and relative position encoding is introduced to determine feature encoding information; the matching cost is used to replace the cost volume in the traditional optical flow estimation model.
[0012] The 4D-related encoding in the feature encoding information is decoded using a multi-level decoder and a flow-attention mechanism to generate optical flow features. Based on the optical flow features, the flow field of the target phase is predicted to obtain the final target flow field.
[0013] Optionally, the decoding operation employs a cyclic update, specifically including: iterating from low to high resolution, generating an optical flow increment in each iteration, and adding the generated optical flow increment to the current optical flow field sequentially after upsampling and feature fusion operations, until an optical flow feature with the same resolution as the input image is generated.
[0014] Optionally, the step of using a multi-level decoder and a flow-attention mechanism to decode the 4D-related codes in the feature encoding information to generate optical flow features, and then using these optical flow features to predict the flow field of the target phase to obtain the final target flow field, specifically includes:
[0015] The 4D-related encoding in the feature encoding information is decoded using a multi-level decoder and a stream-attention mechanism, and the similarity between the features of two frames is calculated based on the 4D associated volume to construct a pixel-level matching relationship.
[0016] Optical flow features are generated based on the pixel-level matching relationship, and the flow field of the target phase is predicted based on the optical flow features to obtain the final target flow field.
[0017] Optionally, the formula for the 4D associated volume is expressed as:
[0018]
[0019] Among them, V 4D Let f(t,x,y,z) represent the 4D associated volume; f(t,x,y,z) represent the density function in 4D space; t represents the time dimension; x,y,z represent the spatial dimensions. This formula is used to calculate the total volume within the time interval (t1,t2) and the spatial regions (x1,x2), (y1,y2), and (z1,z2).
[0020] Optionally, the formula for the flow-attention mechanism is expressed as:
[0021] Competition:
[0022] Aggregation:
[0023] Allocation:
[0024] Where ⊙ represents element-wise multiplication; The source of competition is represented by a non-trivial reweighting based on the conservation of incoming flow, where m represents the length of the input sequence and d represents the vector dimension. V represents the amount of information flowing out of the source; V represents the Value vector; A∈R m×d The aggregated source information is used for associative calculations via matrix multiplication; φ() represents a nonlinear function that enables decomposable attention weight calculations; I represents the inflow information to the sink; Q represents the query vector; K represents the key vector; R∈R n×d To obtain the results of stream attention, n represents the length of the input sequence; Competition represents competition; Aggregation represents aggregation; Allocation represents allocation; Softmax represents normalizing the relevance score to make it a probability distribution; and Sigmoid represents generating attention weights.
[0025] This invention also provides a real-time synchronous measurement system for single-phase flow fields, which applies the method described above and includes: two generation pipelines for gas phase and liquid phase and corresponding hardware devices; wherein, the hardware device corresponding to the gas phase generation pipeline is constructed from a laser light source, a camera, tracer particles, an optical system, a quartz glass pipe and a host computer; the hardware device corresponding to the liquid phase generation pipeline is constructed from a laser light source, a camera, tracer particles, an optical system, a correction box and a host computer.
[0026] Optionally, the number of cameras is one or two.
[0027] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0028] This invention discloses a method and system for real-time synchronous measurement of single-phase flow fields. The method includes acquiring image data of a target phase, which can be a gas phase or a liquid phase; constructing an optical flow estimation model based on a Transformer architecture; the optical flow estimation model includes an encoder and a connected multi-level decoder, and employs a flow-attention mechanism; the flow-attention mechanism is used to construct a source competition mechanism by retaining the incoming data information stream to achieve information aggregation in non-trivial scenarios, and then to form a sink allocation mechanism by saving the source output stream to filter and select the aggregated information; the optical flow estimation model is used to extract features from the image data, and the flow field of the target phase is predicted based on the extracted features to obtain the final target flow field. This invention enables high-precision, real-time measurement of single-phase flow fields. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a detailed schematic diagram of the gas phase hardware system architecture in this embodiment;
[0031] Figure 2 This is a detailed schematic diagram of the liquid phase hardware system architecture in this embodiment;
[0032] Figure 3 This is a schematic diagram of the overall structure of the FlowFormer encoder-decoder in this embodiment;
[0033] Figure 4 This is a diagram of the FlowFormer structure in this embodiment;
[0034] Figure 5 This is a structural diagram of the flow-attention mechanism in this embodiment;
[0035] Figure 6 This is a schematic diagram of the CNN convolution and sampling process in this embodiment;
[0036] Figure 7 This is a schematic diagram illustrating the principle of the convolutional neural network in this embodiment;
[0037] Figure 8 This is a schematic diagram of the software design structure of the system in this embodiment. Detailed Implementation
[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] The purpose of this invention is to provide a method and system for real-time synchronous measurement of single-phase flow fields, aiming to solve or improve at least one of the above-mentioned technical problems.
[0040] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0041] like Figure 1As shown, the present invention provides a method for real-time synchronous measurement of a single-phase flow field, comprising:
[0042] Image data of the target phase is acquired; the target phase is either gas or liquid.
[0043] An optical flow estimation model based on the Transformer architecture is constructed. The optical flow estimation model includes an encoder and a multi-level decoder with connections, and adopts a stream-attention mechanism. The stream-attention mechanism is used to build a source competition mechanism by retaining the incoming data information stream, realize information aggregation in non-trivial scenarios, and then form a sink allocation mechanism by saving the source output stream to filter and select the aggregated information.
[0044] The optical flow estimation model is used to extract features from the image data, and the flow field of the target phase is predicted based on the extracted features to obtain the final target flow field.
[0045] As a specific implementation method, the implementation process of each of the above steps will be described.
[0046] First, a measurement system applying the above method is constructed. In this real-time synchronous measurement system of a single-phase flow field, the single-phase flow is either liquid or gas. The core components include a host computer, a camera array (1-2 units), a laser source, a transparent pipe, and a correction box. The transparent pipe and correction box are organically integrated into the observation system, significantly improving the accuracy of the flow field measurement.
[0047] First, an experimental platform was designed and built to simulate liquid / gas phase flow, dynamically acquire single-phase flow data, and generate high-quality datasets. The platform generates a controllable flow field to capture its trajectory. Two generation pipelines, one for the gas phase and one for the liquid phase, were designed. The gas generation device consists of an air compressor, a pressure vessel, and a gas flow meter. The air compressor provides the required gas flow rate. The maximum pressure of the device reaches 0.8 MPa, and the power is set to 1000 W. This device can accurately simulate single-phase flow fields of pure liquid and pure gas, and can be used to study the flow characteristics and evolution of single phases.
[0048] The hardware of the gas phase system consists of a laser light source, camera, tracer particles, optical system, quartz glass tube, and host computer. An ultrasonic high-pressure atomizing nozzle is installed in a 10mm inner diameter standard gas phase pipeline to atomize dioctyl sebacate (DEHS) solution into aerosol particles with a diameter of 5-6 micrometers, serving as gas phase tracer particles. During gas phase experiments, since both the inside and outside of the pipeline are in the gas phase (same fluid medium), no optical calibration box is needed for circular pipe sections, and PIV measurements can be performed directly. For gas-liquid two-phase flow gas phase velocity distribution measurement experiments, a more transparent quartz glass tube should be used as the test section. Acrylic pipes are made of methyl methacrylate monomer (MMA) polymerized because, without a calibration box, laser irradiation will cause the monomer particles to reflect light with the same brightness as the tracer particles, making it difficult to distinguish particles on the pipe wall. Furthermore, care must be taken to keep the pipe wall clean and free of scratches during the experiment.
[0049] The hardware of the liquid phase system consists of a laser source, camera, tracer particles, correction box, optical system, and host computer. Each component has a clear function and works together to achieve flow field measurement. The laser source illuminates the tracer particles in the flow field; the camera captures images of the tracer particles' motion; the tracer particles are tiny particles used to mark the movement of the flow field; the host computer controls the operation of the hardware and is responsible for image data acquisition and subsequent processing, enabling image analysis, velocity field calculation, and result visualization; the optical system can adjust the shape and direction of the laser beam and the imaging effect of the camera.
[0050] The present invention utilizes the Thousand-Eyed Wolf X150 camera to acquire single-phase flow field data. This camera employs a maximum resolution of 2560×1920 pixels, uses GigE gigabit Ethernet for data transmission, and achieves a frame rate of 2000 FPS at the highest resolution. This high-performance configuration ensures the system can capture high-resolution, high-frame-rate particle images. Furthermore, the camera can synchronize data to a host computer with high real-time synchronization accuracy, maintaining a reliable connection between the camera and the host computer, and exhibiting strong anti-interference capabilities during the data synchronization process. This idea was first innovatively proposed by our group and has now been technically implemented in this invention.
[0051] The system's algorithm design involves multiple steps: image preprocessing, velocity field estimation, data correction, and finally, physical field transformation. This invention develops an algorithm for PIV (Particle Image Velocity Measurement). Existing PIV algorithms are mainly traditional cross-correlation algorithms, but these are complex, time-consuming, computationally intensive, and require complex optimization processes, making them unsuitable for real-time measurement. With the continuous development of deep learning, introducing deep learning technology into particle image velocimetry can automatically extract motion information from images, process data in real-time, and generate high-precision velocity fields, significantly improving operational efficiency.
[0052] Convolutional Neural Networks (CNNs) are discriminative training algorithms used in supervised learning to train multi-layered network structures. As a deep learning framework, CNNs aim to minimize data preprocessing requirements while achieving good performance. In a CNN architecture, a small portion of an image is called a local receptive field, serving as the input to the bottom layer of the hierarchical structure. Information is progressively transferred between different network layers, with each layer extracting salient features from observations that remain invariant to translation, scaling, and rotation. The essential components of a CNN include the input layer, convolutional layers, pooling layers, fully connected layers, and the output layer.
[0053] Convolutional layers extract local features through convolution kernels. The input matrix X is subjected to a sliding window dot product operation with the convolution kernel K.
[0054]
[0055] Where X and Y are output features; K is the convolution kernel and Y is the input feature; Y(i,j) represents the value of the output feature map at position (i,j); X(i+m,j+n) represents the value of the input matrix at position (i+m,j+n); and K(m,n) represents the value of the convolution kernel at position (m,n).
[0056] Activation functions are a crucial component of neural networks, introducing non-linear characteristics that allow the network to learn complex function mappings. Some common activation functions include:
[0057] The Sigmoid function maps input values to the interval (0, 1). It is smooth and differentiable. Its expression is:
[0058]
[0059] Where x is the input vector.
[0060] The Tanh function maps input values to the interval (-1, 1). The average value of the tanh function's output is 0, which alleviates the vanishing gradient problem to some extent. Its expression is:
[0061]
[0062] Where x is the input vector.
[0063] The ReLU function outputs 0 when the input value is less than 0, and outputs the same value when the input value is greater than or equal to 0. This characteristic makes it computationally efficient and effectively mitigates the gradient vanishing problem. Its expression is:
[0064]
[0065] Where x is the input vector.
[0066] Pooling layers are primarily used to downsample (reduce dimensionality) feature maps, preserving key features while reducing computational cost. Assume H... i It is a pooling layer:
[0067] H i =subsampling(H i-1 )
[0068] Where H i The pooling layer is used for pooling; subsampling is used to compress the input feature map, extract the main features, and simplify the computational complexity of the network.
[0069] After alternating through multiple convolutional and downsampling layers, the convolutional neural network uses fully connected layers to classify the extracted features, ultimately obtaining a probability distribution Y based on the input (where l i (Representing the i-th tag category):
[0070] y(i)=P(L=l i |H0;(W,b))
[0071] Where Y(i) represents the value at the i-th position of the output of the convolutional layer, indicating the relationship between that position and category l. i The predicted probability; L = l i H0 represents the true label of the sample; H0 represents the null hypothesis, which refers to the baseline model where the input features have no predictive power for the label; W represents the weight matrix of the convolution kernel; b represents the bias term.
[0072] In a convolutional neural network (CNN), the residual is the difference between the input H0 after forward propagation and the expected value calculated using a loss function. Common loss functions include:
[0073]
[0074] Where MSE represents the squared mean of the prediction error; W and b represent the optimization objectives, which are adjusted through backpropagation to minimize MSE; n represents the normalization factor, ensuring that the loss is independent of the sample size; Y(i) These represent the core comparison items, namely the actual value and the model prediction value, respectively.
[0075]
[0076] Where NLL represents negative log-likelihood loss; Y(i) represents the class probability predicted by the model; W is the convolution kernel weight; b represents the bias of the fully connected layer; (Y) represents the number of samples; and log represents the logarithm of the predicted probability.
[0077] To mitigate overfitting, the final loss function typically incorporates an L2 norm regularization term to limit the magnitude of model parameters and reduce the risk of overfitting.
[0078]
[0079] Where E(W,b) represents the total loss function after regularization; L(W,b) represents the original loss function; λ is used to control the intensity of overfitting; W T W represents the squared L2 norm of the weight matrix W; W represents the model weights to be compressed; b represents the bias term.
[0080] During training, convolutional neural networks typically employ gradient descent as the optimization method. In each iteration, the model calculates the gradient of the loss function with respect to the parameters of each layer (weights W and biases b), and updates these trainable parameters along the reverse direction of the gradient, thereby gradually minimizing the loss function. The residual structure effectively alleviates the vanishing gradient problem by providing a direct gradient path, making parameter updates in deep networks more efficient.
[0081]
[0082] Among them, W i η represents the i-th weight value, and η represents the learning rate parameter, which is used to control the strength of residual backpropagation. This indicates that the loss function is applied to the weights W. i The gradient.
[0083]
[0084] Among them, b i η represents the i-th bias value; η represents the learning rate parameter, which controls the strength of residual backpropagation. This indicates that the loss function is affected by the bias b. i The gradient.
[0085] With the development of deep learning technology, the performance of optical flow estimation models is also gradually improving. This invention combines deep learning algorithms with unidirectional flow field measurement for real-time synchronization and applies it to particle image velocimetry.
[0086] FlowFormer is an optical flow estimation model based on the Transformer architecture. It addresses the challenges of traditional methods in complex motion and large displacement scenes through an innovative attention mechanism. By utilizing self-attention and cross-attention mechanisms, it captures long-distance dependencies between images, improving its ability to handle large displacements and complex motions.
[0087] The FlowFormer encoder-decoder architecture extracts multi-scale features, which are used to construct a 4D correlation code to capture dense matching relationships between images. The 4D correlation code is represented as a four-dimensional tensor that measures the matching cost between pixels in an image pair. This multi-scale feature architecture preserves spatial details. Features from two frames are used as the query and key / value pairs, respectively, and pixel correlations are calculated through cross-attention. Matching costs are dynamically generated (replacing traditional cost volume) to enhance matching robustness; relative position encoding is introduced to enhance the model's perception of local motion patterns. Context is fused through a multi-level Transformer decoder, and a high-resolution optical flow is output in conjunction with an upsampling module.
[0088] FlowFormer uses a Transformer decoder to decode 4D-related codes, thereby generating optical flow features. The 4D associated volume calculates the similarity between features from two frames, constructing pixel-level matching relationships. The formula for the 4D associated volume is expressed as:
[0089]
[0090] Among them, V 4D Let f(t,x,y,z) represent the 4D associated volume; f(t,x,y,z) represent the density function in 4D space; t represents the time dimension; x,y,z represent the spatial dimensions. This formula is used to calculate the total volume within the time interval (t1,t2) and the spatial regions (x1,x2), (y1,y2), and (z1,z2).
[0091] The Transformer decoder effectively captures the global dependencies between image pairs using a multi-head self-attention mechanism, thereby significantly improving the accuracy of optical flow estimation. The formula for this self-attention mechanism structure is as follows:
[0092]
[0093] Where Attention represents the attention mechanism; Q is the query vector, K is the key vector, V is the value vector, d is the dimension coefficient, and Softmax represents the normalization function.
[0094] However, current mainstream attention mechanisms generally suffer from quadratic complexity. To address this, we introduce the flow conservation property into the attention mechanism. Flow networks, as a directed graph structure, achieve precise control over information flow through flow capacity constraints. Inspired by this, the attention mechanism can also leverage learnable flow capacity to aggregate source information to the output. Specifically, a source competition mechanism is constructed by preserving the inflow, enabling information aggregation in non-trivial scenarios; then, a sink allocation mechanism is formed by saving the source output flow to filter and select aggregated information. Because it follows the flow conservation principle, the competition mechanism can be completed without relying on specific inductive bias. Applying this flow-attention mechanism to FlowFormer of this invention allows the model to achieve linear complexity while avoiding attention degradation and introducing no specific inductive bias, thereby significantly improving computational speed and demonstrating superior performance.
[0095] The global equation for the flow-attention mechanism is formalized as follows:
[0096] Competition:
[0097] Aggregation:
[0098] Allocation:
[0099] Where ⊙ represents element-wise multiplication; The source of competition is represented by a non-trivial reweighting based on the conservation of incoming flow, where m represents the length of the input sequence and d represents the vector dimension. V represents the amount of information flowing out of the source; V represents the Value vector; A∈R m×d The aggregated source information is used for associative calculations via matrix multiplication; φ() represents a nonlinear function that enables decomposable attention weight calculations; I represents the inflow information to the sink; Q represents the query vector; K represents the key vector; R∈R n×d To obtain the results of stream attention, n represents the length of the input sequence; Competition represents competition; Aggregation represents aggregation; Allocation represents allocation; Softmax represents normalizing the relevance score to make it a probability distribution; and Sigmoid represents generating attention weights.
[0100] In the decoding phase, Flowformer uses a loop update module, such as... Figure 3As shown, FlowFormer employs a iterative update mechanism to progressively optimize the optical flow field. Specifically, through multiple iterations, an optical flow increment is generated each time and accumulated into the current optical flow field, gradually converging the prediction results to the true optical flow. This iterative optimization strategy enables FlowFormer to handle large displacement and occlusion problems in complex scenes. During multi-scale prediction, FlowFormer first generates an initial optical flow estimate at low resolution, then gradually recovers the high-resolution optical flow field through upsampling combined with feature fusion operations, finally outputting an optical flow result with the same resolution as the input image. Here, tx represents the feature information of SourceInput after feature encoding, FFN is a feedforward multilayer neural network, and the corp operation extracts a local 9×9 cost patch from a local window centered on a local 9×9 point in the feature map Mx. This cost patch is used to efficiently calculate the matching cost within the local window and serves as the input for subsequent optical flow optimization.
[0101] FlowFormer excels at handling complex motions and large displacements, which is crucial for PIV (Potentially Induced Volume) because fluid motion often involves irregular and rapidly changing flows. Traditional PIV methods may struggle with large displacements or high dynamic ranges, while FlowFormer's attention mechanism and iterative optimization offer a better solution. Integrating FlowFormer into existing PIV systems allows for direct processing of image pairs, outputting velocity vector fields, which replaces traditional cross-correlation algorithms. This enables real-time monitoring or feedback control in experiments. FlowFormer is computationally more efficient than traditional CNN models. Transformer architectures typically require significant resources, and achieving dynamic real-time measurement necessitates underlying optimization algorithms. Ultimately, CUDA (Compute Unified Device Architecture) acceleration technology was chosen to optimize the algorithm. Algorithms designed and implemented on the CUDA platform fully utilize the parallel computing power of GPUs, significantly improving computational efficiency and meeting the requirements for real-time performance and high performance.
[0102] Compared to the deep learning model FlowFormer, traditional algorithms are faster, but their accuracy is lower. FlowFormer, due to its Transformer architecture, achieves the best accuracy.
[0103] like Figure 6 and Figure 7 As shown, in Figure 6The diagram illustrates the CNN convolution and sampling process. To extract local features from the input data, the convolution kernel slides across the input data with a specified stride, covering local regions. At each location, a dot product is performed between the convolution kernel and the input region, and the results are summed and a bias term is added. Then, a non-linear activation function (such as ReLU) is used to enhance the model's expressive power. Figure 7 The diagram illustrates the principle of a convolutional neural network. After inputting an image, the convolutional kernel slides across the input data, calculating the dot product of local regions to generate feature maps. Non-linearity is introduced to enable the network to fit complex functions. Pooling layers downsample the feature maps, preserving key features and reducing dimensionality. Fully connected layers map the flattened feature vectors to the output space.
[0104] The beneficial effects of this invention are as follows:
[0105] (1) High real-time performance. By leveraging the global modeling capabilities of deep learning, it overcomes the limitations of local search in traditional algorithms, achieving a leapfrog improvement in accuracy, speed, and robustness. Simultaneously, it reduces system complexity and manual post-processing costs, providing a new tool for real-time monitoring and closed-loop control of complex flows. The Transformer architecture is naturally adapted to GPU parallel computing, resulting in faster processing speeds compared to the serial cross-correlation calculations of traditional PIV. Combined with the lightweight model (FlowFormer) and CUDA acceleration technology, end-to-end latency can be compressed to a very short level, supporting real-time feedback.
[0106] (2) High precision. FlowFormer can capture long-distance particle displacements (traditional FFT cross-correlation is limited by window size), reducing mismatches and improving the spatial resolution of the velocity field in large gradient flow fields such as turbulence and shear layers. Through the continuous displacement modeling capability of Transformer, the optical flow estimation accuracy is improved, which is better than the sub-pixel interpolation limitation of traditional PIV algorithm.
[0107] (3) High efficiency and reduced complexity. Due to the introduction of the flow-attention model, the model can achieve linear complexity while avoiding the attention degradation problem and without introducing specific inductive bias, thereby significantly improving the computation speed and showing better performance.
[0108] (4) High flexibility. The same model can be adapted to different flow velocity ranges without the need to redesign the cross-correlation window parameters. It directly outputs the physical unit velocity field, eliminating the cumbersome steps such as cross-correlation peak detection and vector verification in traditional PIV.
[0109] As a specific embodiment, the following experimental procedure is provided.
[0110] Example 1: Real-time monitoring of turbulence in a transparent pipe
[0111] In real-time monitoring and measurement of turbulence in transparent pipes, suitable tracer particles must be selected to accurately capture liquid flow information. Melamine-formaldehyde resin particles with a particle size of 20 μm were chosen. These particles are encapsulated with rhodamine dye and possess fluorescent properties; they are called fluorescent tracer particles. Furthermore, these particles have excellent hydrophilicity, enabling them to fully bind to the liquid phase and more closely follow its flow, greatly reducing tracking errors caused by differences in particle and liquid phase properties, thus providing strong support for obtaining accurate experimental data.
[0112] A high-speed camera with high frame rate and high resolution, the Thousand-Eye Wolf X150, was selected to acquire liquid phase data. This camera achieves a maximum resolution of 2560×1920 pixels and uses GigE gigabit Ethernet for data connection. At its highest resolution, the frame rate can reach up to 2000 FPS, sufficient to capture the details of the liquid flow field. The camera was mounted in a suitable location to ensure clear imaging of the single-phase flow field area.
[0113] A high-power continuous laser source is used to illuminate the tracer particles in the flow field. An optical system adjusts the laser to a suitable shape and intensity, ensuring uniform illumination of the measurement area. The tracer particles are uniformly mixed into the liquid phase to ensure uniform distribution within the flow field. A high-speed data acquisition card is used to quickly and accurately transmit image data acquired by the camera to a computer for processing. Detailed figures are shown below. Figure 2 , Figure 3 .
[0114] A high-speed camera and laser light source were activated to continuously capture images of the liquid flow field. Flow field images under different conditions, including varying flow velocities and flow patterns, were collected to obtain rich experimental data. Professional image annotation tools were used to annotate the acquired image data, marking the true optical flow information of each pixel as a label for training the model. The acquired image data underwent preprocessing, including image denoising and normalization, to improve data quality and model training effectiveness. The FlowFormer series of models were selected, and the models were adjusted and optimized according to actual needs.
[0115] The established real-time synchronous measurement system for single-phase flow fields was tested to verify its real-time performance and accuracy. The system's performance was evaluated by comparing it with traditional measurement methods. Based on the test results, the system was optimized and adjusted. Simultaneously, the deep learning model was further optimized to improve its performance.
[0116] The single-phase flow field data obtained from the system measurements are analyzed to create flow field distribution diagrams and velocity vector diagrams, visually demonstrating the characteristics and variation patterns of the liquid phase flow field. The effectiveness and reliability of the system are verified through the analysis of experimental results, providing data support for related research.
[0117] Example 2: Real-time Measurement of Gas Phase Flow Field in Quartz Glass Pipe
[0118] When performing real-time measurements of the gas phase flow field in quartz glass pipes, suitable tracer particles must be selected to accurately capture gas phase flow information. An ultrasonic high-pressure atomizing nozzle based on surface tension theory is used, installed in a standard gas phase pipeline with an inner diameter of 10mm. Dioctyl sebacate (DEHS) solution is atomized into aerosol particles with a particle size of 5-6 micrometers using a high-pressure atomizer, serving as the gas phase tracer particles. A high-power continuous laser light source is used to illuminate the tracer particles in the flow field. A high-speed camera with high frame rate and high resolution, the Qianyanlang X150 camera, is selected to acquire gas phase data. The acquired data is synchronized to the host computer, and the high-speed camera and laser light source are activated to continuously capture the gas phase flow field. The FlowFormer series model is selected to process the relevant data in real time, and the model is adjusted and optimized according to actual needs.
[0119] The single-phase flow field data obtained from the system measurements are analyzed to create flow field distribution diagrams and velocity vector diagrams, visually demonstrating the characteristics and variation patterns of the liquid phase flow field. The effectiveness and reliability of the system are verified through the analysis of experimental results, providing data support for related research.
[0120] Through the above embodiments, a real-time synchronous measurement system for single-phase flow fields can be constructed to achieve high-precision, real-time measurement of single-phase flow fields. For example... Figure 8 As shown, relying on the image post-processing program, particle image velocimetry program, and high-speed camera configuration program, the three programs work closely together to build a closed-loop system covering the entire chain from image acquisition and data processing to result output.
[0121] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0122] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for real-time synchronous measurement of single-phase flow field, characterized in that, include: Acquire image data of the target phase; The target phase is either a gas phase or a liquid phase; Construct an optical flow estimation model based on the Transformer architecture; The optical flow estimation model includes an encoder and a multi-level decoder with connections, and employs a flow-attention mechanism; The stream-attention mechanism is used to build a source competition mechanism by retaining the incoming data information stream, thereby realizing information aggregation in non-trivial scenarios. Then, by saving the source output stream, a sink allocation mechanism is formed to filter and select the aggregated information. The optical flow estimation model is used to extract features from the image data, and the flow field of the target phase is predicted based on the extracted features to obtain the final target flow field; specifically, this includes: The image data is input into the optical flow estimation model, and scale features are extracted using an encoder to obtain two frames of features. The two frames of features are then input into the first and second computing terminals respectively for self-attention calculation. The calculation results are then used to calculate the correlation between pixels through cross-attention. The first computing terminal calculates the query vector, and the second computing terminal calculates the key and value vectors. Based on the inter-pixel correlation, a matching cost is dynamically generated, and relative position encoding is introduced to determine feature encoding information; the matching cost is used to replace the cost volume in the traditional optical flow estimation model. The 4D-related encoding in the feature encoding information is decoded using a multi-level decoder and a stream-attention mechanism, and the similarity between the features of two frames is calculated based on the 4D associated volume to construct a pixel-level matching relationship. Optical flow features are generated based on the pixel-level matching relationship, and the flow field of the target phase is predicted based on the optical flow features to obtain the final target flow field. The formula for the 4D associated volume is expressed as follows: Among them, V 4D The formula represents the 4D associated volume; f(t,x,y,z) represents the density function in 4D space; t represents the time dimension; x,y,z represent the spatial dimensions; this formula is used to calculate the total volume within the time interval (t1,t2) and the spatial regions (x1,x2), (y1,y2), (z1,z2).
2. The method for real-time synchronous measurement of single-phase flow field according to claim 1, characterized in that, The decoding operation employs a cyclic update, specifically including: iterating from low to high resolution, generating an optical flow increment in each iteration, and then adding the generated optical flow increment to the current optical flow field sequentially after upsampling and feature fusion operations, until an optical flow feature with the same resolution as the input image is generated.
3. The method for real-time synchronous measurement of single-phase flow field according to claim 1, characterized in that, The formula for the stream-attention mechanism is expressed as follows: Competition: Aggregation: Allocation: Where ⊙ represents element-wise multiplication; The source of competition is represented by a non-trivial reweighting based on the conservation of incoming flow, where m represents the length of the input sequence and d represents the vector dimension. V represents the amount of information flowing out of the source; V represents the Value vector; A∈R m×d The aggregated source information is used for associative calculations via matrix multiplication; φ() represents a nonlinear function that enables decomposable attention weight calculations; I represents the inflow information to the sink; Q represents the query vector; K represents the key vector; R∈R n×d To obtain the results of stream attention, n represents the length of the input sequence; Competition represents competition; Aggregation represents aggregation; Allocation represents allocation; Softmax represents normalizing the relevance score to make it a probability distribution; and Sigmoid represents generating attention weights.
4. A real-time synchronous measurement system for single-phase flow fields, using the method as described in any one of claims 1-3, characterized in that, include: The system includes two generation pipelines for the gas phase and the liquid phase, along with corresponding hardware devices. The hardware device for the gas phase generation pipeline consists of a laser light source, a camera, tracer particles, an optical system, a quartz glass pipe, and a host computer. The hardware device for the liquid phase generation pipeline consists of a laser light source, a camera, tracer particles, an optical system, a correction box, and a host computer.
5. The single-phase flow field real-time synchronous measurement system according to claim 4, characterized in that, The number of cameras is one or two.