CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

Stream function from known velocity

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   December 17, 2008, 10:15
Default Stream function from known velocity
  #1
Beginner
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
  Reply With Quote

Old   December 17, 2008, 11:36
Default Re: Stream function from known velocity
  #2
Jonas Holdeman
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 divergence-free element, but the DOFs are still stream function. Do a least-squares 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 divergence-free with divergence-free 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 plate-bending problems.
  Reply With Quote

Old   December 17, 2008, 11:45
Default Re: Stream function from known velocity
  #3
Beginner
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
  Reply With Quote

Old   December 17, 2008, 13:18
Default Re: Stream function from known velocity
  #4
Ananda Himansu
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.cfd-online.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 least-square 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.

  Reply With Quote

Old   December 18, 2008, 15:51
Default Re: Stream function from known velocity
  #5
Jonas Holdeman
Guest
 
Posts: n/a
The stream function in 2D is the z-component 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.
  Reply With Quote

Old   December 18, 2008, 20:01
Default Re: Stream function from known velocity
  #6
Ananda Himansu
Guest
 
Posts: n/a
oh, okay, thanks, Jonas. Yeah, I recall now the vector aspect of the streamfunction in Karamcheti's Ideal-Fluid Aerodynamics ...
  Reply With Quote

Old   August 16, 2009, 12:24
Default velocity vector, streamline and stream function
  #7
New Member
 
Hussam
Join Date: Mar 2009
Posts: 16
Rep Power: 8
Hussam is on a distinguished road
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
Hussam is offline   Reply With Quote

Old   September 2, 2009, 09:44
Default Stream function from known 2d velcity field
  #8
New Member
 
Eric
Join Date: Sep 2009
Posts: 2
Rep Power: 0
eric2000 is on a distinguished road
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
eric2000 is offline   Reply With Quote

Old   September 2, 2009, 10:02
Default
  #9
Member
 
David P. Schmidt
Join Date: Mar 2009
Posts: 70
Rep Power: 8
schmidt_d is on a distinguished road
All:
Is there some reason that you all are not using the standard OF utility, streamFunction ?

foam@cobia:~/OpenFOAM/OpenFOAM-1.5-dev/applications/utilities/postProcessing/velocityField> streamFunction -help
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5-dev |
| \\ / 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

Quote:
Originally Posted by eric2000 View Post
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
schmidt_d is offline   Reply With Quote

Old   September 2, 2009, 10:11
Default
  #10
New Member
 
Eric
Join Date: Sep 2009
Posts: 2
Rep Power: 0
eric2000 is on a distinguished road
first my operating system is Windows. OpenFoam is Unix based.

Quote:
Originally Posted by schmidt_d View Post
All:
Is there some reason that you all are not using the standard OF utility, streamFunction ?

foam@cobia:~/OpenFOAM/OpenFOAM-1.5-dev/applications/utilities/postProcessing/velocityField> streamFunction -help
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5-dev |
| \\ / 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
eric2000 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A girl fail to plot velocity profile when mesh changes + Wall function asherah STAR-CCM+ 0 February 19, 2010 18:45
latest OpenFOAM-1.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 Star-CD DenizeN CD-adapco 0 September 20, 2006 03:48


All times are GMT -4. The time now is 13:51.