CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (http://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   "ICEM grid data" import into OpenFOAM (http://www.cfd-online.com/Forums/openfoam-meshing/128096-icem-grid-data-import-into-openfoam.html)

JackW January 3, 2014 07:29

"ICEM grid data" import into OpenFOAM
 
Dear all,

I am trying to import a grid file into OF and currently am unable to do so! Any help would be appreciated - I am sure it is quite a simple act, I just do not know the method as I haven't got a clue about any commercial software having previously used manual methods.

The head of the file looks like this:

Code:

TITLE    = "ICEM grid data"
VARIABLES = "X"
"Y"
"Z"
ZONE T="G. Block 1"
 STRANDID=0, SOLUTIONTIME=0
 I=161, J=161, K=61, ZONETYPE=Ordered
 DATAPACKING=POINT
 DT=(SINGLE SINGLE SINGLE )
 0.000000000E+00 1.000000000E+00 0.000000000E+00
 2.999960259E-02 1.000170469E+00 0.000000000E+00
 6.015710533E-02 1.000319600E+00 0.000000000E+00
 9.046905488E-02 1.000235558E+00 0.000000000E+00

I have currently tried to hack it to:
Code:

1
 161 161 61
 0.000000000E+00 1.000000000E+00 0.000000000E+00
 2.999960259E-02 1.000170469E+00 0.000000000E+00
 6.015710533E-02 1.000319600E+00 0.000000000E+00
 9.046905488E-02 1.000235558E+00 0.000000000E+00

and used plot3dToFoam but the resulting mesh is very messy and fails 4 checks (opening in paraview reveals a mesh that looks like a splodge). (Also I have got rid of the 1 and tried -singleBlock and -noBlank both on and off) I am guessing this is the case because the order of the points in a plot3dToFoam file is not the same the above!

If someone could tell me/point me to the ordering of the points for both filetypes I should be able to reorder the file.

What are the steps to either import it into OpenFOAM or change the file so that it can be easily imported?

Thank you for any help!

Jack

JackW January 3, 2014 08:13

Dear all,

It appears that the desired format for plot3DToFoam is:
all the x coords
all the y coords
all the z coords

so something like (untested):

Code:

echo " 1\n161\n161\n61" "$(awk '{print " "$1}' rawPoints.dat)" "$(awk '{print " "$2}' rawPoints.dat)" "$(awk '{print " "$3}' rawPoints.dat)" > file.p3dfmt
where rawPoints.dat is a file containing xi yi zi on each line.

Then,
Code:

plot3dToFoam -noBlank file.p3dfmt
has given a successful convert. Now just need to create the patches (GAHH)!

Hope this helps someone! I have been stuck for ages!

Jack


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