CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Stream function from known velocity (https://www.cfd-online.com/Forums/main/16141-stream-function-known-velocity.html)

Beginner December 17, 2008 09:15

Stream function from known velocity
 
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

Jonas Holdeman December 17, 2008 10:36

Re: Stream function from known velocity
 
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.

Beginner December 17, 2008 10:45

Re: Stream function from known velocity
 
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

Ananda Himansu December 17, 2008 12:18

Re: Stream function from known velocity
 
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.


Jonas Holdeman December 18, 2008 14:51

Re: Stream function from known velocity
 
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.

Ananda Himansu December 18, 2008 19:01

Re: Stream function from known velocity
 
oh, okay, thanks, Jonas. Yeah, I recall now the vector aspect of the streamfunction in Karamcheti's Ideal-Fluid Aerodynamics ...

Hussam August 16, 2009 12:24

velocity vector, streamline and stream function
 
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

eric2000 September 2, 2009 09:44

Stream function from known 2d velcity field
 
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 September 2, 2009 10:02

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 (Post 228283)
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 September 2, 2009 10:11

first my operating system is Windows. OpenFoam is Unix based.

Quote:

Originally Posted by schmidt_d (Post 228287)
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


alimea September 26, 2018 12:49

Quote:

Originally Posted by schmidt_d (Post 228287)
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


dear David

I'm working on flow around a cylinder in an open domain (the boundaries are not wall except cylinder).
I need stream function to plot streamlines. can I use this utility?
could you please give me the command to do that?

thanks


All times are GMT -4. The time now is 05:17.