CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

matching variable data with grid point data

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 6, 2011, 15:28
Default matching variable data with grid point data
  #1
Member
 
Join Date: Sep 2010
Posts: 31
Rep Power: 6
anfho is on a distinguished road
Hi,
I want to extract data point values and grid/mesh point information/location from OF, specifically fireFoam, but the solver should not matter here. Moreover, I do not only want to extract them, I also want to match that information, meaning I want to be sure which value belongs to which mesh point.

So far, I have been able to extract that data (see below), but I am not 100% sure, if the label for the value corresponds to the label of the mesh point.

So the QUESTION here is: can anyone verify that the label associated with a data point is the same label that is associated with a mesh point that corresponds to that very same data point?

Thanks!
Andreas

P.S.:
Extracting and outputting the data into a external file has been accomplished by:

Code:
#include "OFstream.H"
OFstream testout ("densitydata");
//start time loop

Code:
forAll(rho,rholbl)
{
  scalar rhoi = rho[rholbl];
  Vector<double> rhopos = mesh.points()[rholbl];
  testout << "rho:" << rhoi << ":" << rholbl << ":" << rhopos << endl;
  rho[rholbl] = rhoi;
}
//end time loop

which will result in the following output:

rhoi: data point value
rholbl: rho-label associated with that datapoint
rhopos: grid point location (coordinates) associated with that label

"rho":rhoi:rholbl:rhopos

Code:
rho:1.17195:0:(-0.5 0 -0.01)
rho:1.17195:1:(-0.493333 0 -0.01)
rho:1.17195:2:(-0.486667 0 -0.01)
rho:1.17195:3:(-0.48 0 -0.01)
rho:1.17195:4:(-0.473333 0 -0.01)
rho:1.17195:5:(-0.466667 0 -0.01)
rho:1.17195:6:(-0.46 0 -0.01)
rho:1.17195:7:(-0.453333 0 -0.01)
rho:1.17195:8:(-0.446667 0 -0.01)
rho:1.17195:9:(-0.44 0 -0.01)
rho:1.17195:10:(-0.433333 0 -0.01)
rho:1.17195:11:(-0.426667 0 -0.01)
etc.
etc.
...
myfireFoam.C attached.
Attached Files
File Type: c myfireFoam.C (3.5 KB, 13 views)

Last edited by anfho; May 6, 2011 at 16:21.
anfho 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
Plot data for a fixed point aut_iut OpenFOAM 0 December 23, 2010 06:16
grid data white heart Main CFD Forum 4 May 4, 2010 09:05
Time history of a variable at a point for calculating correlations? eoin OpenFOAM 1 August 25, 2009 16:07
Grid Independent Solution Chuck Leakeas Main CFD Forum 2 May 26, 2000 11:18
Grid refinement with wall functions Mark Render Main CFD Forum 8 May 2, 2000 07:09


All times are GMT -4. The time now is 04:46.