1. Introduction
There are different forms of vortex in nature, such as air and water. Generally, vortex is a spiral structure formed by rapidly rotating fluid. In hydrodynamics, Reynolds number Re can be used to study whether there is vortex separation near the object. When Re > 4000, the fluid is turbulent, and a large number of vortices will be produced.
Fluid flow analysis usually calculates a huge data set composed of various vectors and scalars. In order to solve the problem of tremendous calculation, it has become a new trend to extract flow features and screen valuable information through flow feature visualization. The extraction of vortex features has great research value and is widely used in medicine [
1], ocean [
2], aviation [
3] and other fields. Therefore, how to extract vortex features accurately is a research hotspot in recent years.
Traditionally, flow visualization is classified into four categories: direct methods, geometry-based methods, texture-based methods and feature-based methods [
4]. Vortex extraction belongs to the area of feature-based methods, and flow features can abstract data to reduce calculation. Recently, great progress has been made in the visualization of vortex features. However, there is still no formal definition of vortex, which leads to great divergence among researchers in the vortex extraction. Furthermore, the current vortex extraction methods still own many problems, such as over dependence on threshold, low accuracy and large amount of calculation.
Rotation invariance [
5] proposed by Günther et al. is a reference frame invariant method, which can extract the vortices more accurately that perform equal-speed rotations. In this method, the rotation axis whose particles rotate around must be calculated in advance, so it cannot be used if frame performs any other type of movement. Besides, the predictor-corrector method [
6] proposed by Schindler et al. calculates correcting points through multiple prediction and correction steps, so as to extract vortex core lines. This method has no rotation invariance, so it may fail when the reference frame rotates.
In the current study, a new rotation invariant method is put forward to calculate vortex core lines by predictor-corrector method. The research slightly reduces the constraint of rotation invariance so that it can be used under movement of the frame. By combining the rotation invariance and predictor-corrector method, rotation invariant vortex core lines are obtained, and then each vortex feature can be extracted more accurately.
The research applies rotation invariance under the general circumstance, and meanwhile weaken the effect of rotation factors on the accuracy of results. Firstly, a specific axis must be obtained as the rotation axis of modified rotation invariance. Secondly, points whose cross product of parallel vector field is 0 are defined as seed candidate of vortex features. When calculating the real seed points, the present study uses rotation invariant Jacobian instead of the general Jacobian. According to the predictor-corrector method, a series of candidates of each seed point are gained, and the vortex axis, namely, vortex core line, is extracted.
The main contributions of this research are as follows:
Considering that original rotation invariance makes only sense for flows that induced by a rotating movement around an axis, there are some limitations. Hereby, the improvement of rotation invariance in the current study can be used in most cases.
It employs the modified rotation invariant method rather than the predictor-corrector method, and meanwhile uses the modified Jacobian to calculate the seed points.
When there are multiple rotating axes in data set, it divides the data set and extracts vortex core lines of each part respectively.
3. Rotation Invariant Predictor-Corrector Method
The rotation invariant predictor-corrector method implements a direct algorithm:
Calculate the cross product V × W at each particle;
If V × W = 0:
- 2.1.
Extract the point as a seed candidate;
- 2.1.
Calculate rotation invariant Jacobian Jr;
If there is a virtual eigenvalue in Jr, the point is extracted as a seed point;
By multiple prediction and correction steps, the correcting points are calculated;
Connect the seed point and correcting points to get a vortex core line.
The text continues here.
3.1. Extracting Seed Candidates by Parallel Vector Field
It is a tedious step to calculate Jacobian and its eigenvalues for each particle in the data set. Especially, when computing large data sets, it obviously becomes a key part that affects performance. Therefore, before extracting seed points, parallel vector field is used to preprocess the data set. In this step, it is required to screen quickly and simply. Herein, points satisfying the condition of parallel vector field are called seed candidates.
In this study, the seed candidates are extracted by searching for the parallel parts of two vector fields
V and
W in the fluid. Generally, at least one of the two vector fields
V and
W involves velocity gradient. And we use Levy criterion [
8] to calculate cross products.
According to Levy criterion, we have
where
u is the velocity and
(
) is a particle attribute,
is the velocity gradient, then the seed candidates are extracted where
V ×
W = 0. Due to practical reasons, the number of seed candidates whose cross products are exactly 0 may be too small. In this case, a threshold close to 0 is set, and points whose cross products are within the threshold range are regarded as seed candidates.
Meanwhile, the smoothed particle hydrodynamics (SPH) method is used to regard the fluid as a large number of particles which have the same size, each particle carries three-dimension positions, velocity, acceleration, mass and other attributes. Furthermore,
A(
r) of all particles in the neighborhood are weighted and summed to calculate a certain attribute
A(
r) of particles, e.g.,
gi, and it satisfies
where
mj is particle mass,
ρj is particle density, and
W (
r−
rj,
h) is the SPH kernel. In order to reduce the time complexity, the data in the raw data set is directly used for cross product calculation. Through the comparative experiment, it is found that the error is too small to be noticed.
3.2. Extracting Seed Points by Modified Jacobian
It is a necessary condition for the existence of vortex that Jacobian has complex eigenvalues. Therefore, eigenvalues of Jacobian of seed candidates are calculated. Only candidates with complex eigenvalues can be taken as the real vortex seed points. And when calculating Jacobian, it is necessary to search the neighborhood of SPH particles. In order to reduce the time complexity, we use the consistent grid to segment three-dimensional space, in which the edge length of each grid is 1.5 times the particle radius, which is the same as neighborhood range set in experiment. When searching the neighborhood in three-dimensional space, only two kinds of points will be searched, including the points in the grid located by the seed candidate and the points that belong to its around 3 × 3 × 3 grid. Then, particles whose distance from the seed point is 1.5 times less than radius are searched in these grids.
Next, the seed points are extracted under rotation invariant frame. Firstly, the rotation center and axis which the fluid around are calculated, as shown in
Figure 1. Herein,
x0 is the rotation center,
n is the three-dimensional rotation axis, and
x is a particle in data set, whose rotation center is
x0. A vertical line is made through point
x, which intersects the rotation axis
n at point
b,
v is the velocity of particle.
When data set has more than one rotation axis, it is segmented and the vortex features are extracted independently. Here we illustrate the case where there are two axes in the data set, as shown in
Figure 2.
x01 and
x02 are two rotation centers, so the data set is divided into two parts. A line (a plane in 3D space) parallel to the
z axis is made through the midpoint of segment
b1b2. This line (plane) is used as the dataset segmentation line (plane).
After the step of dataset segmentation, the complex scene is divided into several simple scenes with a single rotation center, then the modified rotation invariance method is used.
The size and density of elements have changed after domain transformation, in this case, calculation of Jacobian is complicated, so the calculation of rotation invariant Jacobian
is still carried out in Cartesian frame. We have
where
, and the three-dimensional matrix
The rotation invariant Jacobian Jr and its eigenvalues are calculated by formulas (8) and (9). Only the seed candidates with complex eigenvalues of rotation invariant Jacobian will become the real seed points, the remaining seed candidates are discarded. In order to reduce the calculation time of Jacobian, the neighborhood of SPH particles is set to 1.5 times the particle radius, so that the neighborhood range is minimum and reliable.
3.3. Predictor-Corrector
The vortex core line is connected by a series of correcting points starting from seed point. The step of finding the next correcting point from the seed point or one correcting point is called predictor-corrector. First, we calculate the gradient
of the component of
C = (
C1,
C2,
C3)
= V × W and select the largest pair
i,
j of
, if the value of cross product is positive, the cross product direction is taken as the tangent direction of vortex core line; if negative, the opposite direction is taken. The position of correcting candidate
where
X is the position of the seed point or previous correcting point,
s and
t are variable, which are used to calculate the step size of prediction. At the position of correcting candidate
X’, we have
where,
k =
i or
j. The correcting candidate
X’ is calculated by solving
s and
t and bringing them into formula (10). Here we consider a practical problem, if the correcting candidate does not belong to any particle in the data set, it will be regarded as the nearest particle in the neighborhood as the real correcting point, and also the starting point of the next prediction step, as shown in
Figure 3. If there are no other points in the neighborhood, the prediction and correction step of seed point
X is finished.
If the correcting points obtained by the prediction and correction steps still meet the vortex constraint, that is, the Jacobian has complex eigenvalues, the above prediction and correction steps are repeated. When the Jacobian has only real eigenvalues, or there is no other particle in the neighborhood of candidate, or reaches the boundary of fluid, the vortex core line of this seed point is finished.
In the drawing step, the correcting points which belong to the same seed point are connected by Bezier curve, and they compose the vortex core line. Coordinates
B(
T) of points on Bezier curve can be described as
where
T∈[0,1],
T =
i/(
n + 1), and
P0,
P1, ...,
Pn−1,
Pn are the control points of Bezier curve, namely seed point and a series of correcting points.
In order to have a better extraction result, Bezier curve will show vortex strength and direction of vortex core line. Since the absolute value of imaginary part of Jacobian eigenvalue is positively correlated with the vortex strength, we take the absolute value as vortex strength and display it in the form of the width of Bezier curve. By changing the width between two control points, a vortex core line with a positive correlation between width and vortex strength is obtained. As shown in
Figure 4, where
X0, ...,
X5 are the control points of Bezier curve. The RGB color gradient is used to represent the direction of vortex core line. From the seed point to the last correcting point, the RGB value changes from (255, 0, 0) to (0, 0, 255).
4. Results
Based on the rotation invariant predictor-corrector method, we implemented two sets of experiments of vortex feature extraction and compared with the original predictor-corrector method in the same experimental condition. The experiments are carried on a system with an AMD Ryzen 5 2600 CPU with 8 GB RAM, and the drawing step uses OpenGL library.
We mainly take four sets of experiments, and each step has a comparative experiment to confirm the accuracy of our method. Moreover, the comparative experiment uses the original predictor-corrector method [
6]. In order to reduce the occlusion of sight, particle radius in the figures is reduced by 10 times.
The first test data set is SPH simulation for tracking cylinder movement, as shown in
Figure 5, which is described as follows. There is a vertical cylinder in right half of the cuboid tank with fluid, and the lower part of the cylinder is in fluid. The data set simulates its movement to the left. In addition, there are 78,988 fluid particles and 8000 time steps in the test data set.
The vortex core line extraction results are shown in
Figure 6 when cylinder moves to the 4968 time step. For instance,
Figure 6a shows the rotation invariant vortex core line extraction, and
Figure 6b displays the vortex core line extraction in the comparative experiment. At this time step, Re = 43, so the condition of generating Karman vortex street has not been reached. When fluid passes round the cylinder, it does not produce regular vortex features, and only generate features on both sides of the moving path of the cylinder. The beginning part of vortex core line is red, and it turns blue gradually. The width and density of vortex core line is positively correlated with the strength of vortex. The red line in
Figure 6a is the rotation invariant axis. In the step of selecting rotation axis, we carry out many experiments and finally extract a particle which is always near the bottom rotation center of the cylinder. Starting from the particle, a straight line along the
z-axis direction in three-dimensional space is made as the rotation invariant axis.
Because the velocity of fluid around the cylinder is faster than that of other regions, differences between the extraction results can be clearly seen. Furthermore, there is less false positive in our method. Compared with the original predictor-corrector method, it can reflect the vortex feature region more clearly and accurately.
The second test data set is used to simulate the Karman vortex street. In this simulation, a cylinder obstacle is fixed and fluid particles move from top to bottom. There are 71,352 fluid particles and 500 time steps in the test data set. Besides, in
Figure 7, the extraction results with Re = 70 has been shown. Moreover,
Figure 7a presents the rotation invariant vortex core line extraction, and
Figure 7b depicts the vortex core line extraction in the comparative experiment. The round blank part in figure is the position of cylinder. In
Figure 7a, the red line at the center of obstacle is the rotation invariant axis.
Theoretically, Karman vortex street has been generated when Re = 70, and vortices with opposite rotation direction and regular arrangement are extracted behind the obstacle. However, the original predictor-corrector method owns many false positives around obstacle and feature regions. Compared with the original predictor-corrector method, our method extracts five vortex feature regions more obviously, and its false positives are greatly reduced. Additionally, the accuracy of our method can be confirmed by results of several papers [
26,
27,
28] using similar data set.
Our third dataset is a simulation of the agitator case with 5054 fluid particles and 200 time steps, as shown in
Figure 8. In this case, particles fall out of the air, and there is a paddle at the bottom that alternately moves clockwise and anticlockwise. At the beginning, the paddle rotates clockwise by 30 degrees, and later, its rotation angle of each movement turns to 60 degrees. Importantly, the experiment mainly displays vortex features in the front of rotation path, top and both ends of the paddle. In
Figure 9a, the red line at the center of paddle is the rotation invariant axis.
The fourth test data set is SPH simulation of the falling movement of spheres, which is described as follows. It has 3174 particles and 400 time steps. There are two spheres of the same size above a cuboid tank with fluid, which fall into the cuboid tank at the same time. The results of vortex core line extraction are shown in
Figure 10.
There are two spheres fall off in this experiment, so we divide the data set into two parts and extract vortex core lines respectively. From the data set, we know the coordinates of the center of the spheres when they fall. Then, we make a red line along the z-axis in three-dimensional space at the center of each sphere as the axis of rotation invariance. Rotation center of these spheres are connected and the middle point between them is taken as the segmentation point of data set. At this point, the data set is divided into two parts by a plane composed of the perpendicular bisector of two spheres and a red line parallel to the z-axis.
The experiment shows vortex features in following regions:
The left and right sides of two spheres;
The region between two spheres;
The region closes to fluid boundary.
According to
Figure 10, the extraction results of our multi-axis scene rotation invariant predictor-corrector method are similar to the original predictor-corrector method, which can ensure the accuracy. At present, we simply seek data set segmentation plane at the midpoint of two axes. Obviously, this method ignores many factors, such as vortex intensity. In the future, we will discuss how to segment the data set more reasonably. A more effective method is to calculate the segmentation plane based on vortex strength or direction of fluid, but this will undoubtedly increase the amount of calculation.
In terms of performance, compared with the original predictor-corrector method, we have made several improvements. Firstly, in order to reduce the computing time of Jacobian, the neighborhood of SPH particles is set to 1.5 times the particle radius, so that neighborhood range is kept minimum and reliable. In addition, the consistent grid is used to improve the performance of searching neighborhood particles. Secondly, when calculating the rotation invariant Jacobian, an additional correction term must be calculated, which slightly increases the calculated amount. Finally, the work of calculating rotation invariant axes and segmenting data set is carried out in pre-treatment, and performance of formal calculation is not reduced. The overall performance of our method is slightly lower than that of the original method, but when the particle number in the data set increases gradually, the performance difference between the two methods becomes smaller, mainly for the following two reasons:
When the particle number increases, the number of seed points increases much less than that of non-seed points, the proportion of filtering time of non-seed points in the total time increases gradually, and the proportion of computing time of rotation invariant Jacobian decreases.
In our method, the criterion of seed points is whether the rotation invariant Jacobian has virtual eigenvalues or not, instead of using the general Jacobian to calculate, which makes the steps of extracting seed points stricter and the number of seed points is less than that of the original method. As a result, the calculation times of rotation invariant Jacobian are much less than that of the original method in the prediction and correction steps.
Therefore, with the increase of the particle number, the proportion of the time of filtering non seed points in the total time increases gradually, and the proportion of the calculation time of rotation invariant Jacobian in the total time decreases.
For the cylinder movement data, we set six levels of particle number to calculate the average time of each frame. As can be seen clearly in
Figure 11, with the increase of the particle number, the performance of our method tends to the original method.
In the future, we will seek an appropriate data set, which is used to confirm rotation invariance to improve the accuracy of predictor-corrector method under movement of the reference frame. Furthermore, we will investigate the rotation invariant predictor-corrector method on the GPU to promote performance.
5. Conclusions
Above all, it comes to a conclusion that the current study is equipped with two strengths. On the one hand, it modified the predictor-corrector method to adapt to the reference frame which performs any type of movement. In general, there are two types of scenes. In the first kind of scene, there is only one rotation axis, rotation invariance can be used directly. And the second kind of scene is a complex scene with multiple rotation axes, whose data set is divided, and rotation axes and vortex core lines are calculated separately.
On the other hand, the modified predictor-corrector method is applied to rotation invariance, which reduces the influence of the frame that performs rotation on the accuracy of results. The calculation of rotation axis and data set segmentation are carried out in pretreatment procedures, and the results are directly brought into the formal process of vortex extraction. We modify several steps of the original method. Compared with the original predictor-corrector method, the noise of our method is less, and the contour of the feature area is more obvious; in terms of performance, although the overall performance is slightly lower than the original method, the performance of our method tends to the original method in the data with large particle number.
Nevertheless, since the rotation invariant predictor-corrector method has divided the vortex extraction into smaller parts, such as the calculation of seed points, and prediction and correction steps by using rotation invariance, which inevitably inherits problems of the line-based method. One of the problems is that the vortex core line is over segmented, which makes it impossible to accurately present the direction and strength of vortex even if seed points are accurately calculated. In the present study, the possible factors of breaking up vortex core line are reduced. The only basis for judging seed points and correction points relies on that the rotation invariant Jacobian has imaginary eigenvalues. More importantly, the constraint of parallel vector field and the prediction and correction steps should be appropriately decreased to ensure the output quality of vortex core line.
In the future, the authors will mainly improve the method from the following aspects.
First of all, when selecting the axis, the subjectivity should be reduced as much as possible, and a method will be examined to directly extract the axis from the data set. Secondly, when the data set has multiple axes, it is necessary to propose a intelligent method for segmenting it. Thirdly, there is a phenomenon that vortex core lines are sheltered from each other, and adaptive processing will be used in areas with higher density of vortex features.