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/)
-   -   vtk or .dat (https://www.cfd-online.com/Forums/openfoam-post-processing/221623-vtk-dat.html)

Magistrane October 23, 2019 10:27

vtk or .dat
 
Hello Foamers,

I am trying to couple OF with another program. As first step, i am trying to convert the vtk files i got from post processing (vorticity) to another .dat format.

For that, I call a awk function.

The input is :

Code:

Something
double
data1 data2 data3
data1 data2 data3
...
polygons
Something
vorticity
vort1 vort2 vort3
vort1 vort2 vort3
end of the file

Expected output :

Code:

data1 data2 data3 vort1 vort2 vort3
data1 data2 data3 vort1 vort2 vort3

I have 2 questions : 1) can i ask openfoam to give me post processed files in another format ?
2) If not, is someone able to help me with the awk program ?
For now, i can only get some values using :

Code:

{if ($3 ~ /double/)
{start_pos=NR;
print start_pos;}
if ($0 ~ /POLYGON/)
{end_pos=NR;
print end_pos;}
if ($0 ~ /vorticity/)
{start_vorticity=NR;
print start_vorticity;}

Thank you for your help,

Have a good day !


All times are GMT -4. The time now is 03:51.