Home
Manual
Packages
Global Index
Keywords
Quick Reference
|
Yorick Examples
Flow past an airfoil
The Jakowski transform z --> z+a2/z maps a circle of radius
a in the complex z-plane into a slot of length 4a. Slightly larger
circles map to an airfoil shape you see in the picture to the right.
Creating this picture required about 60 lines of yorick code, which
you can study in the source file demo4.i. There, the
get_mesh function creates a 120x30 mesh of complex numbers,
uniformly distributed in radius and angle around the outside of a
circle. The solve function distorts this uniform mesh into
the shape you see by means of two Jakowski transformations, performed
by the one-line jakowski function. At the same time,
solve keeps track of the velocity potential, and finally
computes the pressure field from Bernoulli's law and the velocity
field. Finally, the display function uses yorick's plotting functions to draw the
background shading (using plf) -- light where the pressure is
high, and dark where the pressure is low -- contours of the imaginary
part of the velocity potential (using plc) -- the flow lines
-- and the outline of the airfoil itself (using plg).
|
|
Drumhead motion
The picture to the right is one frame of a movie of a circular
drumhead. The drumhead started with a bump in about the same location
you see; it has fallen, split in half, run around to the opposite side
of the drum, reflected, and returned to near its initial position at
the time of this frame. The computational mesh is visible; it divides
the circle into a 30x30 grid. This is one of three different kinds of
movies of the same calculation, which you can study in the yorick
source file demo2.i. Although
yorick-1.5 has only 2D graphics, there are several packages that use
interpreted code to do the geometry and lighting calculations to
produce pictures like this one. However, this one was made using the
pl3d function in demo2.i,
rather than a general purpose routine like plwf. Yorick is fast enough
that this movie, including both the wave solver (mostly the
laplacian function in demo2.i) and the lighting and
projection calculations, runs at about 20 frames per second on a 266
MHz Pentium II.
|
|
LLNL Disclaimers
|