Extract velocity on-the-fly
Hi all,
I'm a newbie and I really appreciate any help...I want to extract velocities on a specific plane (specific position) every n*Dt and save them in a file, e.g. in the case of cavity flow I want to keep track of the velocities on the plane (3D) or line (2D) halfway the cavity and parallel to the moving plate, and I want to have them on the fly (during time stepping) and not to extract in postprocessing stage Thanks. |
Any pointer is highly appreciated...which part of the solver has all the record of whole field variable and how can I extract a variable like Velocity at a specific location in the filed to written out to a file? :confused:
|
The keywords you need are functionObjects and cuttingPlane: http://www.openfoam.com/features/run...processing.php
|
Thanks for the pointer Anton, well I searched for cuttingPlane and I'm trying to test it in my top solver I'll use it through function objects afterwards. For cuttingPlane there is a thread on that in this forum but it's for 2008 and I think cuttinPlane has had minor changes in recent version like OpenFOAM 2.1.0 that I'm using. Apparently you could use something like :
Code:
cuttingPlane cutPl(mesh,pl1) Code:
icoFoam_cuttingPlane.C: In function ‘int main(int, char**)’: |
You don't need to modify any code. Have a look at the tutorial "incompressible/simpleFoam/motorBike/" in OF-2.1.0, it uses a cutting plane to sample data during run time.
If you grep -r "libsampling" . in the tutorials directory you will get a list of all tutorials that use run time sampling. - Anton |
The problem is that I want to have those data to input to another simulation runs separately as a boundary condition and I want to pause the OpenFOAM simulation during the run time of the the other code, so I need to incorporate all these into the code I think, what's your opinion?
|
If you're coupling is only one way, you still don't have to modify the code. Why would you pause the OpenFOAM simulation? Just let it run ahead, and let the program that's waiting for input do the work on synchronization.
|
It's a two way coupling, the OpenFOAM simulation also receives boundary condition or better say updates it's boundary condition values...well basically by defining a plane ( Naming Splane) I managed to use
Code:
cuttingPlane cutPlane(Splane,mesh,true); Code:
wordList scalarNames(1); Now I'm getting pressure output on that plane, however I don't know at which points on the plane the pressure are written out! are those at cell centers projection on the plane? Any idea on this way of implementation? |
All times are GMT -4. The time now is 05:48. |