How can I graph stream lines in 3d?

In summary, to trace out a streamline, you can choose a starting point on the grid, calculate the step size based on the velocity components, and check if the adjacent points satisfy the given condition. This process can be repeated until no new points are added to the streamline.
  • #1
Fox5
11
0

Homework Statement


Given a set of points in 3d space (x,y,z) each having a velocity vector (u,v,w), create a general algorithm for tracing out a stream line.
The points are locked to a grid, so data points are evenly along an axis. (ie, increment along x only and it's always the same change in x to the next point, and the same holds for y and z) The points are monotonically increasing, so steady-state has already been achieved.
You are allowed to pick your starting point.

Homework Equations


From wikipedia:
en.wikipedia.org/wiki/Streamlines%2C_streaklines%2C_and_pathlines
Streamlines are a family of curves that are instantaneously tangent to the velocity vector of the flow. This means that if a point is picked then at that point the flow moves in a certain direction. Moving a small distance along this direction and then finding out where the flow now points would draw out a streamline.

Also, wikipedia states dx/u = dy/v = dz/w.


The Attempt at a Solution


I have no idea. I would imagine that given point(x1, y1, z1), I could search through a list of other points (maybe only adjacent points?), and then see if (x2-x1)/u2 = (y2-y1)/v2 = (z2-z1)/w where (x2,y2,z2,u2,v2,w2) are the position and velocity components of the 2nd point. If the check passes, then connect the two points and continue the process for the next point (ignoring the current one) and continue until no points satisfy the algorithm.
I don't know if that works though, and it seems like it would generate non-unique solutions anyway. After all, couldn't more than one adjacent point satisfy the condition?
 
Physics news on Phys.org
  • #2


Your proposed solution is a good starting point, but it may not generate unique solutions as you mentioned. Here is a more detailed algorithm that takes into account the monotonicity of the points and the grid structure:

1. Choose a starting point (x1, y1, z1) and its corresponding velocity vector (u1, v1, w1). This can be any point on the grid, but it may be helpful to choose a point with a high velocity to start with.

2. Calculate the step size for each coordinate based on the velocity components: dx = u1*dt, dy = v1*dt, dz = w1*dt. The value of dt can be chosen based on the desired accuracy and the magnitude of the velocity vectors.

3. Move to the next point by adding the step size to the current point: x2 = x1 + dx, y2 = y1 + dy, z2 = z1 + dz.

4. Check if the new point (x2, y2, z2) is within the grid boundaries. If it is outside, stop the algorithm.

5. Check if the new point is adjacent to the previous point (x1, y1, z1). This means that only one coordinate should have changed by the step size, and the other two coordinates should be the same. For example, if x1 = 1, y1 = 2, z1 = 3 and the step size is dx = 0.5, then the adjacent points are (x2, y2, z2) = (1.5, 2, 3), (0.5, 2, 3), (1, 2.5, 3), (1, 1.5, 3), (1, 2, 3.5), (1, 2, 2.5).

6. If the new point is not adjacent to the previous point, stop the algorithm.

7. Check if the velocity vector at the new point (u2, v2, w2) satisfies the condition dx/u2 = dy/v2 = dz/w2. If it does, then this point is part of the streamline.

8. If the condition is not satisfied, stop the algorithm.

9. Repeat steps 2-8 for the new point (x2, y2, z2) until the algorithm stops.

10. Connect all the
 

FAQ: How can I graph stream lines in 3d?

How do I determine the direction and shape of the stream lines in a 3D graph?

The direction and shape of stream lines in a 3D graph is determined by the gradient of the function being graphed. The gradient is a vector that points in the direction of greatest increase of the function. The shape of the stream lines is perpendicular to the direction of the gradient.

What is the significance of stream lines in a 3D graph?

Stream lines in a 3D graph represent the flow or movement of a fluid or vector field. They are used to visualize the direction and magnitude of the flow at different points in the graph.

How can I plot stream lines on a 3D graph?

To plot stream lines on a 3D graph, you will need to first determine the direction and shape of the stream lines, as well as the starting points for the lines. Then, use a graphing software or program to plot the lines using the function's gradient and starting points.

Can I adjust the density of stream lines in a 3D graph?

Yes, you can adjust the density of stream lines in a 3D graph by changing the number of starting points or by changing the spacing between the lines. This can help you to better visualize the flow of the fluid or vector field in different areas of the graph.

Are there any limitations to graphing stream lines in 3D?

One limitation of graphing stream lines in 3D is that it can be difficult to accurately represent the flow or movement of a complex fluid or vector field. Additionally, the accuracy of the graph may be affected by the density and spacing of the stream lines, as well as the resolution of the graphing software being used.

Similar threads

Replies
17
Views
2K
Replies
1
Views
1K
Replies
3
Views
1K
Replies
1
Views
1K
Replies
5
Views
6K
Replies
11
Views
1K
Back
Top