Extracting Stream Function from nodal u,v data
Hi all,
I have a 2D generalised structured mesh finite volume code based on SIMPLE Scheme. I have another finite element code that can do the mesh adaptation based on Least squares finite element. Currently I am trying out usual drivencavity flow problem. I dump the nodal data i.e. x,y,u,v,p,T from finite volume code and read it into finite element code. Initially I used vorticity (w) as my mesh adaptation criteria. But the adapted mesh does'nt capture the primary and secondary vortices well. Extracting vorticity from nodal u,v was very easy. many papers I saw recommend using streamfunction as adaptation criteria. I am at loss how to extract streamfunction values from nodal values of u and v in my finite element code. Here is what I thought would work (but does'nt) {u} = [B]{psi} (B is the shapefunc derivative matrix) so {psi} = Inv[B].{u} Anybody know how to get this done..... Thanks Abhijit Tilak. 
Re: Extracting Stream Function from nodal u,v data
Solve for streamfunction
Δψ =  ω in Ω ∇ψ . n = 0 on ∂Ω 
Re: Extracting Stream Function from nodal u,v data
Thanks for your reply. Yep!! that's excatly what I did yestarday as last resort. Use FEM code to first evaluate vorticity "w", then solve for streamfunction and adapt the mesh.
I wonder how commercial softwares like TECPLOT evaluate streamfunction from velocity. I could'nt find any info on the web. An intresting observation about the BC you specified. I imagined that a solid surface can be thought of as a streamline and so the streamfunction is constant. You can assign an arbritrary value. so I used psi=0 on entire cavity boundary. Also psi=constant satisfies your BC. Numerically speaking...using your B.C i would not be able to invert the global stiffness matrix...ofcourse i can solve the problem iteratively... Psi=0 still means no flow through the boundary... It is also possible that psi = psi(x,y) and still satisfies nopenetration. In the drivencavity problem I can specify psi=U*y for the moving lid....still it means psi is constant!!! any thoughts?? Thanks Abhijit 
Re: Extracting Stream Function from nodal u,v data
You are right about the bc: the correct one is ψ=constant.
I think the visualization softwares are not calculating streamfunction but evaluate the streamline directly by integration (you can think of passive advection of massless particles which are moving at the local fluid velocity), ie., you start at some point (x0,y0) with velocity (u0,v0) and integrate dx/dt=u and dy/dt=v A high order RungeKutta time integration may be used. The full implementation may be more involved since only discrete values of (u,v) are known. 
Re: Extracting Stream Function from nodal u,v data
There is another way to extract stream function data. There exist fournode Hermite finite elements with the stream function and the solenoidal field components as degrees of freedom. If you take the curl of these functions, you have divergencefree elements with the same degrees of freedom. You can take the vector form and fit it to your computed data using least squares or whatever. Then, simply contour the stream function. The functional form of these elements can be found in a paper titled "II, Some Hermite Interpolation Functions for Solenoidal and Irrotational Vector Fields" at the web site "http://j.t.holdeman.home.att.net/research.htm". Of course you could solve your problem using these elements without the extra step.

Re: Extracting Stream Function from nodal u,v data
This is the way I recall TecPlot generating stream lines. Of course, this is actually a particle streak line.
It has the advantage of being useful in 3 dimensions. The usual stream function becomes a vector in 3 dimensions. Also, for a 2d compressible flow, the stream function is useful only for steady state. But for your gardenvariety 2d flows, incompressible or steadystate compressible, it's a great way to visualize a flow pattern. 
All times are GMT 4. The time now is 18:54. 