CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   OpenFoam data files (http://www.cfd-online.com/Forums/openfoam-post-processing/72630-openfoam-data-files.html)

chamoun February 12, 2010 08:47

OpenFoam data files
 
I would like to post-process OpenFoam velocity field data with Matlab. For this, I am going to use the 'points' file located in constant>polyMesh>points. I am also going to use a 'U' file. The points file containts more rows than the U file. I'm assuming this is the case because the points file contains the boundary points, while the U file does not. This presents a problem

Does anyone know what the correspondence is between these two data files? I need to know which points have which velocities, and which points are on the boundary, and which are in the interior of the boundary?

thanks!

ngj February 12, 2010 10:15

The points in OpenFoam are the the corners of any computational cell, e.g. a hex-cell is made out of 8 points. The velocity is computed in the cell centres of these computational cells, hence there should not be a direct correspondence.

Use the tool "writeCellCentres" to achieve the cell centres, which corresponds to those in the velocity file.

Best regards,

Niels

chamoun February 15, 2010 06:47

Thanks for the help. I looked up writeCellCentres.C in the documentation, but they don't have an example of how to enter it into the solver. Is this straightforward or more involved? Any help would be appreciated!

thank you

ngj February 15, 2010 07:56

You cannot make it a part of the solver, as it is a stand-alone postprocessing tool. Just type writeCellCentres in the command line when you have completed the computation, and the cell centres will be written to each time directory.

Type "writeCellCentres -help" if you are unsure how to use it.

Best regards,

Niels

chamoun February 15, 2010 08:53

Tak, Niels! :)

jeicek April 17, 2014 10:39

Hello Guys,

I typed writeCellCenters and it creates files in each time step with names of 'ccx ,ccy and ccz' but the strange thing is that the dimension of these ccx ccy ccz are only m or in other words their dimension is length and not the velocity also their values are not corresponding with U file!!!??? am I wrong?? do you have any idea? :confused:

alexeym April 17, 2014 10:51

Hi,

Units for coordinates of the centers of cells should be in meters. Why would they be in meters per second?

jeicek April 18, 2014 14:46

Hi Alexeym, then what are these 'ccx ,ccy and ccz' ?? Aren't they the velocity components in x,y and z directions in the cell center?!?!? if not then what are they?

jeicek April 18, 2014 14:47

Quote:

Originally Posted by alexeym (Post 486753)
Hi,

Units for coordinates of the centers of cells should be in meters. Why would they be in meters per second?

Hi Alexeym,then what are these 'ccx ,ccy and ccz' ?? Aren't they the velocity components in x,y and z directions in the cell center?!?!? if not then what are they?

alexeym April 18, 2014 15:33

Hi,

no, they are not. Reread the name of the utility - write cell centers. Look at the code of utility:

Code:

        for (direction i=0; i<vector::nComponents; i++)
        {
            volScalarField cci
            (
                IOobject
                (
                    "cc" + word(vector::componentNames[i]),
                    runTime.timeName(),
                    mesh,
                    IOobject::NO_READ,
                    IOobject::AUTO_WRITE
                ),
                mesh.C().component(i)
            );

            cci.write();
        }

mesh.C() is an array of cell centers (i.e. coordinates of cell centers).

If you'd like to get velocity components use foamCalc.

jeicek April 20, 2014 09:30

Thank you very much Alexym for clarifying, now it was cleared for me. :)


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