
[Sponsors] 
December 17, 2008, 10:15 
Stream function from known velocity

#1 
Guest
Posts: n/a

Hi all,
I wonder if someone can give me some hints, or even links, to how to calculate stream function if the velocity field is known. (for 2D flows) Well, I know that numerical integration is feasible but it is really appropriate? Thanks in advance 

December 17, 2008, 11:36 
Re: Stream function from known velocity

#2 
Guest
Posts: n/a

If you use the finite element method, here is a suggestion. I suppose we are talking 2D. Use a scalar element for the stream function. Its DOFs are the stream function at the nodes. Construct a new velocity element from this by taking the curl of the shape function. The result is a divergencefree element, but the DOFs are still stream function. Do a leastsquares fit of this velocity element to your velocity data. The resulting nodal values will be what you want, and the SF element interpolates them.
I suppose you could use any appropriate Lagrange FE, but I use Hermite FEs. In fact, I use the curl of modified Hermite elements to calculate my velocities in the first place. Note that in 2D, the gradient is [d/dx, d/dy]^T while the curl is [d/dy, d/dx]^T. They differ by an interchange and a change in sign. So the modification I mentioned is to interchange the first derivative DOFs of the Hermite element and change the sign of the appropriate one. Then take the curl, and you have a vector element that is divergencefree with divergencefree DOFs plus the stream function. Use this to calculate the velocity and you get the stream function as a bonus. A useful Hermite element can be found on P179 of Zienkiewicz, 1971 book "The Finite Element Method in Engineering Science". There are a number of other Hermite elements, derived for platebending problems. 

December 17, 2008, 11:45 
Re: Stream function from known velocity

#3 
Guest
Posts: n/a

Basically I use FE but also FD. So your solution seems feasible to be integrated in my FE code. Thanks a lot. However, I develop also a FD code, so if someone had a solution in FD it'll be much appreciated.
Cheers 

December 17, 2008, 13:18 
Re: Stream function from known velocity

#4 
Guest
Posts: n/a

If your scheme conserves numerical fluxes (as would a finite volume scheme, for example), then you might consider what I described in a post yesterday:
"Re: plot streamline" Tue, 16 Dec : http://www.cfdonline.com/Forum/main.cgi?read=63716 It is cheap, and will give reasonable results. However, if your scheme is not conservative, then Jonas' suggestion of leastsquare fitting would ensure equality of mixed partials while best approximating both components of velocity. Although I am not sure what Jonas means by the curl of a scalar. 

December 18, 2008, 15:51 
Re: Stream function from known velocity

#5 
Guest
Posts: n/a

The stream function in 2D is the zcomponent of a vector potential. By the curl of a scalar, I mean the curl of a vector with a single (z) component. curl(psi)=[d(psi)/dy, d(psi)/dx]^T, i.e. curl(psi)=[u, v]^T, u=d(psi)/dy, v=d(psi)/dx.


December 18, 2008, 20:01 
Re: Stream function from known velocity

#6 
Guest
Posts: n/a

oh, okay, thanks, Jonas. Yeah, I recall now the vector aspect of the streamfunction in Karamcheti's IdealFluid Aerodynamics ...


August 16, 2009, 12:24 
velocity vector, streamline and stream function

#7 
New Member
Hussam
Join Date: Mar 2009
Posts: 16
Rep Power: 8 
Dear Sir
My name is Hussam Ali Khalaf, postgraduate student in Iraq and Am currently working on “A Solution Algorithm for Transient Fluid Flow with Multiple Free Boundaries” I have results for velocities values (u and v) in directions x and y for undular bore evolution (please, note the file attachment), rectangular uniform mesh (2Dimension, (i,j)=(22,10)) consists of 20 cells in the horizontal direction (length=12 , ∆x=0.6) and 8 cells in the vertical direction (height=1.6, ∆y=0.2). Am supposed to draw velocity vector, streamline and stream function . I have a program TecPLOT, I have tried several times but I don’t fully understand how TecPLOT reads the results, would you please help me if you have any idea on how to go about it. Thank in advance Yours sincerely Hussam Ali Khalaf Iraq 

September 2, 2009, 09:44 
Stream function from known 2d velcity field

#8 
New Member
Eric
Join Date: Sep 2009
Posts: 2
Rep Power: 0 
Hi all,
I have a 2D velocity field (u,v) along with their spatial coordinates. I appreciate if I get any code to compute the stream function from the known velicty. Thanks, Eric 

September 2, 2009, 10:02 

#9 
Member
David P. Schmidt
Join Date: Mar 2009
Posts: 71
Rep Power: 8 
All:
Is there some reason that you all are not using the standard OF utility, streamFunction ? foam@cobia:~/OpenFOAM/OpenFOAM1.5dev/applications/utilities/postProcessing/velocityField> streamFunction help /**\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 1.5dev   \\ / A nd  Revision: 1345   \\/ M anipulation  Web: http://www.OpenFOAM.org  \**/ Usage: streamFunction [noZero] [case dir] [parallel] [constant] [latestTime] [time time] [help] [doc] [srcDoc] David 

September 2, 2009, 10:11 

#10  
New Member
Eric
Join Date: Sep 2009
Posts: 2
Rep Power: 0 
first my operating system is Windows. OpenFoam is Unix based.
Quote:


Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
A girl fail to plot velocity profile when mesh changes + Wall function  asherah  STARCCM+  0  February 19, 2010 18:45 
latest OpenFOAM1.6.x from git failed to compile  phsieh2005  OpenFOAM Bugs  25  February 9, 2010 05:37 
Compilation errors in ThirdPartymallochoard  feng_w  OpenFOAM Installation  1  January 25, 2009 07:59 
Problem with compile the setParabolicInlet  ivanyao  OpenFOAM Running, Solving & CFD  6  September 5, 2008 20:50 
Stream function in StarCD  DenizeN  CDadapco  0  September 20, 2006 03:48 