CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   How to import a mesh from a home brewed software (https://www.cfd-online.com/Forums/openfoam-installation/57445-how-import-mesh-home-brewed-software.html)

david_flo1 January 30, 2008 00:09

Hello all I have installed
 
Hello all

I have installed and after struggling a while, applied the updates and compiled OpenFOAM 1.4.1 on a Edubuntu 7.1 machine. All works fine including paraFoam.

I have an application specific c++ software (Windows and VC8) made by myself to manipulate and redefine a mesh (of pyramid, hexahedral or tetrahedral (but not mixed) cells) obtained from segmented MRI data from the heart. Is a complex and large mesh.

The question is, how can I import this mesh into OpenFOAM format? I have read the whole user's manual (but chapter 8) and was thinking of reading the programmers manual next but need to reach a deadline demonstrating that I can load the mesh (PhD student here).

Basically I can create output of the data anyway is required. Currently there is a list of vertexes with unique and compacted ID and a list of polygons which relates the labels (IDs) of the vertexes that form it. There is also data that identifies a particular domain (say for example, pericardium, endocardium, atria, ventricles).

Data is a plain windows text file (.txt)

Thanks in advance for your help

Bernardo

vinz January 30, 2008 00:51

Hello, Even if it was not f
 
Hello,

Even if it was not for my own software I created a while ago a converter from GridPro meshes to OpenFOAM. It might help you to look at this converter to begin your work.
You should find the files on the forum looking for GridPro in search part.
I have explained my work in the first parts of the following document:
http://www.rtech-engineering.com/VincentRIVOLA_FSI.pdf

Hope that helps!
Regards

deinstein January 30, 2008 10:55

Hello Bernardo, Small world
 
Hello Bernardo,

Small world. We too are working on a heart project and we too have our own grid generation code.

The easiest thing to do is to write the OF ascii format directly. If you send me an email directly I will send you some code I wrote to do that in FORTRAN (sorry). Some of the coding is our (lame) attempt to be object oriented in FORTRAN, but I believe it is readable enough to be useful. The most important thing is to reorder the faces the OF wants them.

daniel.einstein@pnl.gov

Hope this helps


All times are GMT -4. The time now is 00:58.