Clear Filters
Clear Filters

How to plot streamlines in matlab ???

23 views (last 30 days)
ANTONIO LEUZZI
ANTONIO LEUZZI on 25 Feb 2019
Answered: ANTONIO LEUZZI on 28 Mar 2019
Hi everybody, I m new. I ve this question like title. I have to plot streamlines with circular cylinder, from PIV data of velocity. For each data I ve one value of X Y U V (2D model), a matrix with n rows x 4 columns. From this matrix, that represents the average values of velocity, I ve just elaborated a quiver plot with the cylinder but I need of your help to understand how can I use streamline function in matlab or if is necessary to write the strem function like fluid mechanics theory. In annex the matrix
Thanks
  6 Comments
Bob Thompson
Bob Thompson on 25 Feb 2019
How are you identifying which points connect to form a streamline?
ANTONIO LEUZZI
ANTONIO LEUZZI on 25 Feb 2019
this is my problem Bob; I tried in different ways to buil the grid first and after to plot the U and V values on meshgrid X and Y, but the result is always a square grid. I Know how to not consider the cylinder (NaN values for U and V in the coordinates X and Y of its position respect the grid) but at this point I m not sure of my grid. Have you confidence with stream function?

Sign in to comment.

Answers (3)

Bob Thompson
Bob Thompson on 25 Feb 2019
Try using the quiver function. It's not perfect streamlines, but it should give you an idea of what the velocity field looks like, which should essentially achieve the same affect. This should still plot in a 'square' because I suspect that is what is available for your (x,y) data, so that will be the bounds of your 2D plot area. Based on the image you attached you should be getting a grid that is roughly rectangular anyway, as it is a cross section of your flow perpendicular to the cylinder you are flowing around.
data = xlsread('Cartel1.xlsx');
quiver(data(:,1),data(:,2),data(:,3),data(:,4));

ANTONIO LEUZZI
ANTONIO LEUZZI on 26 Feb 2019
Sorry Bob but I think that you don t Know or you aren t understanding my problem!!! If you read with attention my previously messages I ve write that I ve already plotted quiver data!!!!!!!!! My problem is HOW TO PLOT STREAMLINE WITH MY VELOCITY DATA??? HOW TO CREATE A GRID OF POINT ??? Are you understandong now?
  12 Comments
Jan
Jan on 7 Mar 2019
@ANTONIO LEUZZI: Uppercase means shouting in an internet forum. With bold type also and a bunch of exclamation marks your message looks excited. Calm down.
Post the current code and a copy of the complete error message.
ANTONIO LEUZZI
ANTONIO LEUZZI on 7 Mar 2019
There wasn t absolutely my intention to shout but I ve highlighted ineffectiveness for resolving thsi problem despite Bob's help!!!!! I m sorry for this misunderstood and thanks for your suggest

Sign in to comment.


ANTONIO LEUZZI
ANTONIO LEUZZI on 28 Mar 2019
Hei guys. Unfortunately I ve not complete this part of code yet. I would still need of your help. I will try to be clearest possible. Than, I ve PIV measurements that consist of X,Y,U,V data, or rather each value has got an X displacement and a Y dispalcement at wich corrispond U velocity component (of dispalcement) and V velocity component (of displacement) respectively. So I ve a matrix of this value. My ask is hoe to plot streamlines with the presence of a cylinder? I ve attached the code with the data. In this code you can find first part in wich the data were arranged and in wich were erased spikes values. After that there s a second part in wich I ve computed main velocity, for U and V, plotted velocity profiles, for U and V and computed Reynolds Shear Stress. I attached even an Excel file with the matrix of data. I know the stream function in matlab bu I think that in my case would need another way to plot the stremlines.
untitled.jpg
This image is the velocity displacement with a quiver function. Streamlines follow easily the row wise. As you can see from the Excel file, Y length is 166.0957 that is the legth of the regitred PIV image; also for X length. But the process of the data in PIV were made for each Y value constant corrispond all X values and so U values and V values. Than streamlines follow X data posted on the same ordinate.
I don t try to extract them. Please help me. ANd thanks for your help

Categories

Find more on Vector Fields in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!