
[Sponsors] 
HELP  stream function from the velocity field 

LinkBack  Thread Tools  Search this Thread  Display Modes 
January 22, 1999, 04:38 
HELP  stream function from the velocity field

#1 
Guest
Posts: n/a

Could anyone please help me with the following problem
I have some solutions to the 2D driven cavity problem, where the solutions have been obtained using primitive variables. I would like to be able to plot contours of stream function, but as I only have the u and v velocity fields, I would need to derive the stream function from this. Does anyone out there know how to do this? If so, your help would be much appreciated. Many thanks. 

January 22, 1999, 05:00 
Re: HELP  stream function from the velocity field

#2 
Guest
Posts: n/a

Hi in my diploma work i had the same problem. You can get the streamfunktion by a integrating over the velocityfield.
I think you can find the formular in a fluid dynamics book. Then you must transform the integration into a summation. 

January 22, 1999, 05:15 
Re: HELP  stream function from the velocity field

#3 
Guest
Posts: n/a

you can calculate that by preapearing a subroutine , where for every cell position you caculate the derivate of the stream function U=d (ksi)/dy and V= d ( ksi)/dx , by using a finite difference method you can get the value of the variation of the stream function at the bondaries of your cell.
Generate this for your whole volume good luck 

January 22, 1999, 19:46 
Re: HELP  stream function from the velocity field

#4 
Guest
Posts: n/a

A quick correction:
caculate the derivate of the stream function U=d (ksi)/dy and V= d ( ksi)/dx should read: caculate the derivative of the stream function U=d (ksi)/dy and V=  d ( ksi)/dx but this is going the wrong way. The question is how to go from velocity to stream function NOT the other way. The guy from Stuttgart has the right idea this means that one has to integrate!! 

January 23, 1999, 11:03 
Re: HELP  stream function from the velocity field

#5 
Guest
Posts: n/a

I believe Essemiani is also right. A PDE can be either integrated or finitedifferenced for a solution. I guess the latter is preferable for a general problem. Hope you agree with me.
Michael 

January 25, 1999, 03:07 
Re: HELP  stream function from the velocity field

#6 
Guest
Posts: n/a

Simple.
Set u=d(Psi)/d(y) and v=d(Psi)/d(x), where Psi is supposed to be the stream function. Take the definition of the vorticity, omega=d(u)/d(y)d(v)/d(x) and express u and v in this equation using the stream function. This will give you a poisson equation for the stream function, div grad (Psi) = d^2(Psi)/dx^2+d^2(Psi)/dy^2 = omega, which can easily be solved by any method you like. Applying this equation to your driven cavity problem you should use Psi=0 on all boundaries, even on the upper (or whatever) moving plate. For some reference data you could check Sohn, J.L., Int.J.for Num. Meth. in Fluids, 8, (1988), 144691490. Chris. 

January 25, 1999, 10:50 
Re: HELP  stream function from the velocity field

#7 
Guest
Posts: n/a

Ah! A long trip from the primitivevariableapproach back to the streamfunctionvorticityapproach. It is an acceptable approach. For the directlineintegrationapproach, the derived streamfunction value may not be unique, depending on the direction of integration ( you can integrate the definition in either x or ydirection). Most of the time, the particle trajectory method is used for the primitivevariableapproach to obtain the streamline information. This is because neither streamfunction nor vorticity is used directly in the formulation. And the vorticity calculation has to be defined through out the flow field and boundary consistently.


January 26, 1999, 02:47 
Re: HELP  stream function from the velocity field

#8 
Guest
Posts: n/a

Hi John,
in what way do you think will your response to my response to fred's original question be of any help to fred ? With the incompressibility constraint satisfied only in the mean I can for a given velocity field  at least for the driven cavity problem in question  not think of any other method as simple as the one described. If you have a (concrete) better suggestion I am of course interested to hear about it. 

January 26, 1999, 07:02 
Re: HELP  stream function from the velocity field

#9 
Guest
Posts: n/a

For a particle trajectory method, how do you decide where to 'start' each streamline? I am looking at a similar problem with a triangular mesh and primitive variables.
Ronan 

January 26, 1999, 12:35 
Re: HELP  stream function from the velocity field

#10 
Guest
Posts: n/a

When I answer a question, normally, I don't have any particular person in mind. But rather the issues related to the original question. The practical answer to the original question first: the field approach of solving the streamfunction equation with the vorticity source term derived from the U,V velocity field is the nature selection. Because this will eliminate the uniqueness issue associated with the directional integration of the velocity component to obtain the streamfunction. This does not mean that the direct integration is not practical. When you have fine mesh solution, the error will be small. Therefore, if you have fine mesh solution, you can do it either way. Otherwise, I would say, the field approach is a more formal solution. Now that I have answered the original question, I'd like to expand it a little more in this primitivevariablestreamfunctionvorticity loop. Suppose that we derive the vorticity from the velocity components field and obtain the streamfunction from streamfunction field equation with vorticity source term, then ask a question: " Will the derived vorticity function still follow the vorticity governing equation ?" If it does not satisfy the vorticity equation, then " Is the derived streamfunction still valid ?"


January 26, 1999, 12:58 
Re: HELP  stream function from the velocity field

#11 
Guest
Posts: n/a

Based on my experience with the commercial CFD codes and postprocessors, I normally pick a point a couple of points aways from the wall and several points away from the inlet to start the trajectory tracing to begin with. Once I have some general picture of the flow field, I then move to other neighboring points ( skipping a point is a good idea).Once the general flow pattern ( or separation regions) is defined, I can move into the specific region and start a trajectory tracing process there. You will get better pictures when you are dealing with fine mesh solutions. In 3D simulation, trajectory tracing is extremely important, because there is no replacement for it yet. It is a great tool for viscous flows. So, if you have not used this tool before, you are encouraged to check it out. It will help you a great deal in your CFD career.


Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
problems after decomposing for running  alessio.nz  OpenFOAM  7  March 5, 2021 04:49 
stream function boundary condition for cylinder with slots on it  sara2115  Main CFD Forum  1  May 18, 2011 09:50 
mean, variance and covariance statistics of any field function on any part.  Subhadeep  STARCCM+  8  February 18, 2010 17:19 
Version 15 on Mac OS X  gschaider  OpenFOAM Installation  113  December 2, 2009 10:23 
fixed velocity field  Glen  CFX  3  August 28, 2006 12:17 