Vector Field Visualizer Back
Vector Field Visualizer

Vector Field & Streamline Visualizer

Visualize uniform flow, point source, vortex, dipole, and custom F(x,y) fields in real time. Streamlines, divergence, and curl color maps. Click to trace streamlines from any point.

Field Settings
Field type
Strength
Source position x
Source position y
Superposition (2nd field)
2nd field type
2nd strength
Display
Results
Cursor X
Cursor Y
Divergence ∇·F
Curl ∇×F
|F| magnitude
Classification
Vector Field — click to trace a streamline

What is a Vector Field?

🙋
What exactly is a vector field? I see the simulator shows arrows everywhere, but what does that actually represent?
🎓
Basically, it's a map that assigns a vector (an arrow with direction and magnitude) to every point in space. In practice, it describes things like fluid velocity or force. For instance, in this simulator, the "Uniform Flow" field shows arrows all pointing the same way, which models a steady wind or a constant current. Try moving the "Strength" slider to see how the arrow lengths change.
🙋
Wait, really? So those "Source" and "Vortex" options are different kinds of flows? What's the difference?
🎓
Exactly! A "Source" field, like air coming from a vent, has vectors pointing radially outward. Its strength determines how much "stuff" is flowing out. A "Vortex" field, like water draining, has vectors swirling around a center. The key difference is in their divergence and curl, which we measure. Try switching between them and watch how the streamline patterns change from radial to circular.
🙋
Okay, so what are divergence and curl? They sound like math terms, but what's the physical meaning when I'm looking at the arrows?
🎓
Great question! Think of divergence as measuring the "source-ness" or "sink-ness" at a point. Positive divergence means stuff is flowing out (like a source). Curl measures the "swirliness" or rotation at a point. A common case is a vortex, which has high curl. In the simulator, you can combine fields—try adding a "Source" and a "Vortex" with the second field controls. You'll create a spiral flow, which has both divergence and curl!

Physical Model & Key Equations

The divergence of a 2D vector field $\mathbf{F}= (F_x, F_y)$ quantifies the net flux (outflow minus inflow) per unit area at a point. It tells you if the point is a source, a sink, or neither.

$$\nabla \cdot \mathbf{F}= \frac{\partial F_x}{\partial x}+ \frac{\partial F_y}{\partial y}$$

Where $F_x(x,y)$ and $F_y(x,y)$ are the vector components you can type into the simulator's input boxes. A positive result means net outflow; negative means net inflow; zero means what flows in also flows out.

The curl (specifically its z-component in 2D) measures the tendency of the field to rotate or circulate around a point. It's a measure of local angular velocity of the field.

$$(\nabla \times \mathbf{F})_z = \frac{\partial F_y}{\partial x}- \frac{\partial F_x}{\partial y}$$

A positive curl indicates counter-clockwise rotation, negative indicates clockwise rotation, and zero indicates an irrotational (curl-free) field, like the uniform flow or a pure source.

Real-World Applications

Aerodynamic Design: Engineers use potential flow visualization (like the fields in this simulator) to model airflow over wings or car bodies in early design stages. Streamlines show how air will flow, helping to predict lift and drag before running costly CFD simulations.

Electromagnetic Field Sketching: Before setting up complex Finite Element Method (FEM) simulations, analysts sketch field lines. The "Dipole" field in the simulator, for instance, is a fundamental model for the magnetic field around a bar magnet or an electric dipole.

Heat Transfer Analysis: The vector field can represent heat flux. A "Source" could be a heat-generating component on a circuit board. Divergence in this context relates to points where heat is being generated or absorbed.

Structural Stress Analysis: In solid mechanics, the principal stress directions within a material form a vector field. Plotting these stress trajectories helps identify potential failure paths, like around a hole in a loaded plate, which is crucial for safe structural design.

Common Misconceptions and Points to Note

When you start using this tool, there are a few points that are easy to misunderstand, so be careful. First, while "arrow length = vector magnitude," the arrows are automatically scaled for visibility. Near the center of a gravity well, the values theoretically approach infinity, but in the tool they are clipped to a maximum length. Therefore, comparing magnitudes reliably is best done using the color map. For example, the areas near the charges of an electric dipole that turn bright red are the regions where the field is actually strongest.

Next, the point that "divergence and curl values depend on the calculation range (the Δx for differentiation)". The tool calculates these via numerical differentiation using a few pixels around the cursor position. Therefore, for fields with very sharp variations, the value can fluctuate significantly just by moving the cursor one pixel. Always keep in mind that when using CAE software in practice, the mesh coarseness also determines the accuracy of these differential values.

Finally, understand the limitations of 2D visualization. This tool is only visualizing a 2D slice. Almost all real physical phenomena are three-dimensional. For example, a uniform flow (uniform field) filling the screen might actually be a "helical flow" with vortices in the depth direction. It's common for a field to appear divergence-free in 2D, but have a non-zero $ \frac{\partial F_z}{\partial z} $ term in 3D, making the overall divergence non-zero.