CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Postprocess lagrangian fields (https://www.cfd-online.com/Forums/openfoam-post-processing/61447-postprocess-lagrangian-fields.html)

dhebert December 21, 2006 10:50

Hello Everyone, I have run
 
Hello Everyone,

I have run a simulation with dieselFoam. I would now like to read the position and diameter of a parcel and make a pdf at a partucular time. I am attempting to read the lagrangian/positions field and am having trouble setting the file pointer to where the data starts. For example, if I use:

IFstream p(positionsFile);

Info<<endl;

string dummy;
for(label i=0; i<40; i++)
{
p >> dummy;
Info<<dummy<<endl;
}

I get an error when the IFstream reaches a non-string, which happens to be the text "FoamFile":

--> FOAM FATAL IO ERROR : wrong token type - expected string found on line 9 the word 'FoamFile'

Can someone give pointers on how to read this data? Right now I have the data in ascii format, but would like to eventually read binary data.

Thanks in advance for your help,

David

dhebert December 21, 2006 10:58

Hi again, Regarding the abo
 
Hi again,

Regarding the above question of reading lagrangian fields, perhaps it would be easier to read the vtk file? Is there an OpenFOAM class that would read a particular variable from a vtk file?

Thanks again,

David

mattijs December 21, 2006 17:46

2] there is no OpenFOAM classe
 
2] there is no OpenFOAM classes to read vtk files.
1] the lagrangian fields are IOFields(i.e. registered fields residing in the case directory). Easiest is to study one of the data converters (e.g. foamToVTK) in the postProcessing utilities source directory.


All times are GMT -4. The time now is 09:06.