/* DEMO4.I Airfoil demo $Id$ */ /* Copyright (c) 1995. The Regents of the University of California. All rights reserved. */ func demo4(mono=) /* DOCUMENT demo4 or demo4, mono=1 solves for the flow past a 2D airfoil using Kutta-Jakowski theory. The colors represent static pressure (darker is lower pressure), red lines are streamlines. Solutions for various angles of attack are shown by animation. With the mono=1 keyword, only the streamlines are shown. (On a monochrome terminal, the pressure makes the streamlines invisible.) */ { require, "movie.i"; local nx, ny; imax= 50; movie, display; display, imax; } func display(i) { attack= 28.*double(imax-i)/(imax-1); solve, attack, 2.0, 0.2; if (i==1) { extern cn, cx; cn= 0.8*min(pressure); cx= max(pressure); } limits, -2.8, 2.4, -2.4, 2.8; plmesh, z.im,z.re; if (!mono) plf, zncen(pressure), cmin=cn,cmax=cx; plc, potential.im, marks=0,color="red", levs=span(-2.5,3.5,33); plg,z.im(,1),z.re(,1), marks=0; return i