sci.math.num-analysis SUNA30, Ideal Flow with BASIC ============================= This article (more or less) closes off my postings about the Labrujere Problem, which is the Least Squares Finite Element approximation of Ideal Flow around a circular cylinder in velocity (u,v) formulation (: the Cauchy equations). The series is accompanied with a couple of computer programs in GWBASIC. Here I put in a firm disclaimer: no other language is used because I'm doing this work at home in Barendrecht, with help of a floppy based PC. Anyway, what's the beef in a computer language? The abovementioned GWBASIC programs have been made publically available via an anonymous ftp to "dutrde1.tudelft.nl". Information about how to transfer files from that site has been published on the net, and will be sent to any of you upon request. Now about the programs themselves. The first step is to create an ASCII file, which must be called CURRENT.DAT. This file must contain a coding for the (Ideal Flow) problem to be calculated, a two digit number X . At the moment of this writing the following 3 problems have been implemented, all describing ideal flow around a circular cylinder: X = 01 : Staggered Quadrilaterals (SUNA24) X = 02 : Patched Quadrilaterals (SUNA28) X = 03 : Linear Quadrilaterals (SUNA29) Before running the main program, data must be created. This is done by invoking a mesh generator: "GWBASIC MESGEN". Direct access files are created then, such as: GENER03.BIN , COORD03.BIN , TOPOL03.BIN , UNKNO03.BIN , BOUND03.BIN . (It is seen from the coding "03" that Linear Quads are applied in this case.) The three Least Squares Finite Elements ("Staggered", "Patched" and "Linear") are implemented in a program called MAINFLOW.BAS. Invoking "GWBASIC MAINFLOW" carries out the main flow calculation. As it ends, a direct access file like VELOC03.BIN, containing the outcomes, is created. The Gauss solver is the slowest part of the program. I wasn't able to replace it by something better (yet), despite of some well-meant advice from the net. If somebody can, please let me know! I mean: E-mail me back the adapted BASIC. Recall that the mesh consists of repeatable (equal) elements, with exeption of the boundary conditions. This velocity file is augmented with velocities at the intersection points of the diagonals of the Staggered quads, or at the midpoints of the Patched quads, by backsubstitution, in the program BACKUP.BAS. The mesh, together with the calculated velocities, can be plotted on a graphics (true or simulated CGA) screen by typing "GWBASIC MESPLOT". A Stream Function calculation can be carried out with the program PSICALC.BAS. Herewith a direct access file STREAM03.BIN is created. A piece of theory from SUNA14 is used by PSICALC. However, assembly of the one-dimensional elements is carried out again by means of a Least Squares Finite Element Method. Nothing is wrong with squaring the F.D. system of all possible equations. Many of them are dependent (number of equations >> number of unknowns). But who cares? Streamlines can be visualized on the graphics screen by invoking PSIPLOT.BAS. The quality of the flow velocity calculation can be judged by comparing it with the analytical solution. This solution can be derived by applying the theory of transformations in the complex plane (Joukowski). The outcome for flow around a circular cylinder is: u = U.{ 1 - R^2/r^2.cos(2.phi) } v = - U.R^2/r^2.sin(2.phi) Especially the velocity profile at the cylinder itself is significant (because the circular cylinder is in fact kinda prototype for the wing of an airplane). A program called PROFILE can be invoked to carry out the comparison between the above analytical and our numerical approximations. The results are represented graphically, as in the original NLR report by Labrujere. Judge for yourself. To be continued ... - * Han de Bruijn; Applications&Graphics | "A little bit of Physics * No * TUD Computing Centre; P.O. Box 354 | would be NO idleness in * Oil * 2600 AJ Delft; The Netherlands. | Mathematics" (HdB). * for * E-mail: Han.deBruijn@RC.TUDelft.NL --| Fax: +31 15 78 37 87 ----* Blood