As an example of application of finite element theory to fluid flows, as part of my graduate coursework I adapted a general purpose finite element code for the calculation of incompressible potential flow with circulation. As is typical with engineering, the more big words one uses when described the conditions a numerical solution can handle, usually the more limited it is. In this case, it can only handle 2-D flow flowing significantly slower than the speed of sound with no flow separation. It can, however, handle slow, well behaved flow around interesting bodies such as a spinning cylinder or ideal wing, which makes it just a little bit more interesting.
Before writing the code, it is usually a good idea to have a verified reference solution to compare it to. In finite element parlance, this is commonly refered to as a 'patch test', and similar to software engineering a great deal of what you can know about your code will depend on what sort of tests you can apply to it. Structural FEA vendors will typically have large volumes of reference models that are used to check the behavior of new iterations of their software against previous reference solutions, to ensure that customers can rely on new versions to produce the same results as previous ones.
In this case, the patch test was incompressible fluid flow around a cylinder which was rotating, a typical programming assignment in my undergraduate engineering work. Finite difference theory is used as the numerical technique, which iterates on the solution until convergence, and is run for several different rotational speeds of the cylinder. Two things to note:
- As the speed increases, the stagnation point (point of zero velocity) will move towards the point on the cylinder at 90 degrees to the fluid flow, and past a certain critical rotation speed will actually depart the cylinder
- The circulation will generate lower pressure on one side of the cylinder and higher pressure on the other. This circulation is the classic influence that things that generate lift have on surrounding flow fields, such as wings.
To the right you see the lines of potential, which are normal to the fluid flow, and to the right you see the pressure on the cylinder surface as you travel 2*pi radians around the cylinder.
In order to create this same solution in finite elements, you will need to write a solution sequence similar to the flowchart below.
A more complete discussion of the execution of this flow chart, and accompanying Matlab code, is available at the end of this post.
The domain over which the numeric solution was calculated is typically referred to as a mesh, and because it looks kind of neat, here's an example of one.
This is one of the finer levels of detail that I used. The red numbers are the 'grids' where the solution is calculated, and the black numbers are the 'elements' which describe the relationship of the grids to each other.
Skipping ahead to the pretty charts, the finite element theory solution matched the finite difference solution very well.
What was also interesting is that one can already see the typical observations made of more typical CFD approaches versus finite element approaches. Whereas the finite difference approach only needed as much memory as necessary to describe the solution variable at each point in space, it required significant runtime to iterate on the solution until convergence. The finite element approach, on the other hand, needs to store the complete relationship between each grid to each other in the 'stiffness matrix', which will require more memory but less run time than the finite difference theory. This dependence on memory for finite element theory solutions is one of the defining characteristics of professional structural analysis, where the servers used to find solutions to structural problems will typically incorporate as much memory as physically possible. 300GB of memory or more per server is not at all unheard of as of 2012.
Back to the fluid flow application, now that the general ability of the code to reach known solutions has been verified, one can experiment with other things. The solution can be drastically scaled back in detail, as below, to see how dependent a realistic solution is on mesh detail.
This very very small mesh still generated nearly the correct solution. What is also interesting is that the edges of elements are not 'sharp', and what looks not all like a cylinder still behaves as one, as the amount of detail only sees features as fine as an individual element.
Finally, the most interesting thing is that now we have a fully general ability to simulate flow around a body of any shape, we can try immersing more interesting things, such as a wing.
Picture above is a NACA 0412 wing section.
I would like to thank and credit U.C. Davis professors N. Sukumar and M. Hafez, whose courses developed the finite element program and CFD theory used in this exercise.
For a more complete presentation see the summary I created for a presentation given at The Aerospace Corporation in 2007.
Solution of potential flow with circulation using the finite element method
Associated Matlab script files
No comments:
Post a Comment