How to analyze and visualize the 3D velocity field?

I am trying to use best practices in computing fluid to analyze and visualize the velocity field .

Given 6 arrays of positions and velocities of moving particles: x,y,z and vx,vy,vz respectively.

I want to visualize and calculate the induced velocity field and its properties, such as: curl , divergence , isosurfaces , etc.

Here is a modest script volume of visualization that I could use without calling meshgrid (to avoid interpolation and more noise).

Ultimately, one of the things I'm not sure about is how to wisely create a grid of my 50 points in space, and secondly, how to use CFD approaches to visualize the velocity field, regardless of the small number of data points.

 close all rng default t=0.1:0.1:10; x = sin(t)'; y = cos(t)'; z = t.^0.2'; vx=y;vy=x;vz=z; figure subplot(2,3,1); quiver3(x,y,z,vx,vy,vz); hold on streamribbon({ [xyz] }, {vx},{vy},{vz}); subplot(2,3,2); [curl_val, cav] = curl([x,y,z],[vx,vy,vz]); surfc([x,y,z],cav); subplot(2,3,3); surfc([x,y,z],curl_val); w = sqrt( vx.^2 + vy.^2 + vz.^2 ); subplot(2,3,4); quiver3(x,y,z,vx,vy,vz); streamtube({ [xyz] }, {w}); subplot(2,3,5); quiver3(x,y,z,vx,vy,vz); subplot(2,3,6); surfc([x,y,z],[vx,vy,vz]); 

enter image description here

When I run the above script (excluding data generation) on real data , I get the following graphs, t is very informative:

enter image description here

+5
source share
1 answer

I strongly suspect that the problem here is with the data, and not with the visualization technique. But overall, the problem is one or more of the following:

1) You do not have enough data to capture the main dynamics (the dynamics in space works at a higher spatial frequency than you chose)

2) The data is too noisy for the amount of data collected.

3) The flow is mainly turbulent, and therefore, hoping for a good laminar-like plot will not happen.

When you encounter problems with data visualization, the first rule of thumb is to always discard any visualization that tries to approximate the derivative (or gradient) in any way. The reason is that when you try to approximate the derivative with real data, noise almost always makes this estimate meaningless. For example, suppose we have a cosine that is damaged by some noise, and we are trying to numerically estimate the derivative from the data

 figure % Create a signal dt = .1; t = 0:.1:10; x = cos(t); % Add some noise y = x + .5 * randn(size(x)); % Compute the first order approximation of the derivatives of the signals dx = diff(x)/dt; dy = diff(y)/dt; % Plot everything subplot(2,1,1) plot(t,x,t,y) axis tight subplot(2,1,2) plot(t(2:end),dx,t(2:end),dy) axis tight 

enter image description here

In the first graph, which shows raw data, the noise does not look bad, but when we look at the derivative estimate! Oh ... The noise really amplifies. Therefore, forget about higher flow order properties, such as curl and vorticity, that require data gradients.

So what can we do in such cases? Essentially, just look at the raw data. If there is a pattern, it will prove itself. For example, let's look at your original velocity vectors from 3 different points of view:

 data = dlmread('data.csv','\s') x = data(:,1); y = data(:,2); z = data(:,3); vx = data(:,4); vy = data(:,5); vz = data(:,6); close all figure subplot(1,3,1); quiver3(x,y,z,vx,vy,vz); view([1,0,0]) subplot(1,3,2); quiver3(x,y,z,vx,vy,vz); view([0,1,0]) subplot(1,3,3); quiver3(x,y,z,vx,vy,vz); view([0,0,1]) 

enter image description here

The only thing that looks even slightly structured is the last plot. However, this plot tells us that we are also likely to experience turbulence (in addition to noise) that we can deal with.

In particular, from view 3, it definitely seems that you are taking measurements of speed in a stream that hugs an object tightly. In this case, your measurements are probably too dense, though ... and probably in the boundary layer. If this is the case (measurements are in the boundary layer), then you can get time-varying effects in the stream, which means that it makes no sense to look at anything without the time component as well. The β€œgood” plots that you have in your answer are really very useful when the flow is laminar, where we see these nice consistent flow lines. If it is turbulent, then there is no noticeable picture in the stream, no matter how strong you look.

So, in conclusion, I don’t think you can find a good visualization for your data, because either the sensors you used were too noisy or the stream was too stormy.

As an aside ... consider what happens when we look at the original velocity vectors from your "nice" dataset:

enter image description here

This, my friend, is a well-trained pet. You have a wild mountain lion in your arms.

+10
source

Source: https://habr.com/ru/post/1263605/


All Articles