|
[Sponsors] |
March 13, 2012, 16:32 |
Extract velocity on-the-fly
|
#1 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
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. |
|
March 22, 2012, 00:47 |
|
#2 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
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?
|
|
March 22, 2012, 03:31 |
|
#3 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
The keywords you need are functionObjects and cuttingPlane: http://www.openfoam.com/features/run...processing.php
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
March 22, 2012, 16:31 |
|
#4 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
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**)’: icoFoam_cuttingPlane.C:109: error: no matching function for call to ‘Foam::cuttingPlane::cuttingPlane(Foam::fvMesh&, Foam::plane&)’ /home/kasra/packages/OpenFOAM/OpenFOAM-2.1.0/src/sampling/lnInclude/cuttingPlane.H:138: note: candidates are: Foam::cuttingPlane::cuttingPlane(const Foam::plane&, const Foam::primitiveMesh&, bool, const Foam::labelUList&) /home/kasra/packages/OpenFOAM/OpenFOAM-2.1.0/src/sampling/lnInclude/cuttingPlane.H:117: note: Foam::cuttingPlane::cuttingPlane(const Foam::plane&) /home/kasra/packages/OpenFOAM/OpenFOAM-2.1.0/src/sampling/lnInclude/cuttingPlane.H:65: note: Foam::cuttingPlane::cuttingPlane(const Foam::cuttingPlane&) |
|
March 22, 2012, 18:18 |
|
#5 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
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
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
March 22, 2012, 20:29 |
|
#6 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
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?
|
|
March 23, 2012, 04:28 |
|
#7 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
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.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
March 23, 2012, 11:41 |
|
#8 |
Member
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16 |
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); scalarNames[0] = "p"; PtrList<volScalarField> scalarFlds1(scalarNames.size()); scalarFlds1.set(0, subset1.interpolate(p)); 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? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF error - parabolic velocity profile - 3D turbine | Zaqie | Fluent UDF and Scheme Programming | 9 | June 25, 2016 20:08 |
help with UDF for contact angle based on contact line velocity | gandesk | Fluent UDF and Scheme Programming | 14 | October 29, 2012 14:58 |
how to compute relative velocity from absolute? | spk | Main CFD Forum | 3 | July 9, 2010 09:42 |
Neumann pressure BC and velocity field | Antech | Main CFD Forum | 0 | April 25, 2006 03:15 |
Terrible Mistake In Fluid Dynamics History | Abhi | Main CFD Forum | 12 | July 8, 2002 10:11 |