Velocity Vector Field Satisfying Continuity Equation

**SPIRAL_DATA**
is a Python library which
samples a velocity vector field that satisfies the
continuity equation, and writes the nodes and velocities to a file,
suitable for display using GNUPLOT.

The continuous velocity field **(U,V)(X,Y)** that is discretely
sampled here satisfies the homogeneous continuity equation, that is,
it has zero divergence. In other words:

This is by construction, since we havedU/dX + dV/dY = 0.

which guarantees zero divergence.U(X,Y) = 10 * d/dY ( PHI(X) * PHI(Y) ) V(X,Y) = -10 * d/dX ( PHI(X) * PHI(Y) )

The underlying function PHI is defined by

where C is a parameter.PHI(Z) = ( 1 - cos ( C * pi * Z ) ) * ( 1 - Z )^2

The velocity data satisifes the (continuous) continuity equation;
this in **no way** implies that it satisfies the momentum equations
associated with Stokes or Navier-Stokes flow! Moreover, a flow solution
for those equations would normally also require specifying a value
for the scalar pressure field **P(X,Y)**.

The computer code and data files made available on this web page are distributed under the GNU LGPL license.

**SPIRAL_DATA** is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version.

NAVIER_STOKES_2D_EXACT, a Python library which evaluates an exact solution to the incompressible time-dependent Navier-Stokes equations over an arbitrary domain in 2D.

STOKES_2D_EXACT, a Python library which evaluates exact solutions to the incompressible steady Stokes equations over the unit square in 2D.

- grid_2d.py, returns a regular 2D grid.
- r8vec_amax.py, returns the entry of maximum absolute value in an R8VEC.
- r8vec_amin.py, returns the entry of minimum absolute value in an R8VEC.
- r8vec_max.py, returns the entry of maximum value in an R8VEC.
- r8vec_min.py, returns the entry of minimum value in an R8VEC.
- r8vec_print.py, prints an R8VEC.
- r8vec_uniform_ab.py, returns a scaled pseudorandom R8VEC.
- resid_spiral.py, computes the residual for a spiral velocity vector field.
- spiral_gnuplot.py, writes the velocity vector field to files for GNUPLOT.
- spiral_matplotllib.py, displays the velocity vector field using MATPLOTLIB.
- timestamp.py, prints the YMDHMS date as a timestamp.
- uv_spiral.py, computes a spiral velocity vector field.

- spiral_test.py, calls all the tests.
- spiral_test.sh, calls all the tests.
- spiral_test.txt, the output file.

- spiral_data.txt, data for GNUPLOT.
- spiral_commands.txt, commands for GNUPLOT.
- spiral.png, the resulting plot.
- spiral_matplotlib.png, the MATPLOTLIB plot.

You can go up one level to the Python source codes.