CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Post-Processing (
-   -   Code to read in results on a BlockMeshcreated mesh as structured arrays (

brooksmoses December 5, 2005 20:57

I'm working on combining some
I'm working on combining some OpenFOAM flow solutions with some other computational processing that I've already written, and right now am looking at how to get the data from one program to the next.

Essentially, I've created a structured mesh (either polar or cartesian) using BlockMesh, and then performed a flow solution on that mesh using a slight variant of icoFoam.

What I'd now like to do is load this into another program as 3-dimensional arrays of mesh x, y, and z positions of the cell corners, and more 3-dimensional arrays of the variable values (velocity, pressure, etc.) at the cell centers.

I'd really prefer to have these routines in Fortran, since that's what the rest of my code is in, but I'd be willing to work with C++ routines (and write a conversion program that writes out the data to another file that I can read easily in Fortran) if something already exists.

Thus, my question: Does anyone have any bits of code that they could share with me that will do part of this, or something like it? Or any suggestions for things that I should look out for, or good places to start?

I certainly don't have any problem doing this myself if I need to, but I'd much rather not reinvent any wheels I don't need to!

Thanks much!

All times are GMT -4. The time now is 19:59.