Flow Velocities

We recommend reading through the Boundary Shapes page before diving into this page.

We can define arbitrary flow fields. The common thread between sensible flow fields is to let flow near the boundary be tangent to the boundary.


The code below demonstrates the relationship between the flow velocities we input and the output of the program

rhs = [real(sin(3.*boundary.t).*boundary.tang); imag(sin(3.*boundary.t).*boundary.tang)];

On the right, a simulation resulting from the flow velocity above.


Try changing this one line in InterpVideoWriter.m! There is a lot of rich behavior to observe by adjusting the frequency of sin(boundary.t)



There's a lot happening here!


First thing to note: "boundary" is a struct we created with the function file quadr.m. One of its fields is an array of boundary points, and this link speaks more on how to create that boundary struct.


Second thing to note: we see two fields of that struct here, 't' and 'tang'. They each occur twice: once for the x-component of velocity and one for the y-component. 't' stands for theta, and 'tang' stands for tangent. The multiplication of boundary.tang to the rest of the expression within real() and imag() is how we make the velocity run tangent along the boundary. We embed this behavior into the simulation because it is embedded in the math behind Stokes flow.



Third thing to note: The expression within the real component of rhs should be identical to the expression of the imaginary component of rhs. This, like the rule with boundary.tang, is a hard and fast rule.


Finally, most sensible flow velocities are dependent on boundary.t. A richer class of velocities are dependent on both 't' (theta) and time. Note that this can only be achieved using the files labeld "Stokes", and not the files labeled "Interp".



Take time to experiment with timestepping choices! At the core, this is a discrete-time system. The size and number of time steps, as well as the number of frames to be written to the video, are all modifiable in these files.