CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

OpenFoam data files

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 12, 2010, 08:47
Question OpenFoam data files
  #1
New Member
 
Join Date: Dec 2009
Posts: 5
Rep Power: 7
chamoun is on a distinguished road
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!
chamoun is offline   Reply With Quote

Old   February 12, 2010, 10:15
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,607
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   February 15, 2010, 06:47
Default
  #3
New Member
 
Join Date: Dec 2009
Posts: 5
Rep Power: 7
chamoun is on a distinguished road
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
chamoun is offline   Reply With Quote

Old   February 15, 2010, 07:56
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,607
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   February 15, 2010, 08:53
Default
  #5
New Member
 
Join Date: Dec 2009
Posts: 5
Rep Power: 7
chamoun is on a distinguished road
Tak, Niels!
chamoun is offline   Reply With Quote

Old   April 17, 2014, 10:39
Default
  #6
New Member
 
jeicek
Join Date: Nov 2013
Location: Germany
Posts: 18
Rep Power: 3
jeicek is on a distinguished road
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?
jeicek is offline   Reply With Quote

Old   April 17, 2014, 10:51
Default
  #7
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,109
Rep Power: 19
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

Units for coordinates of the centers of cells should be in meters. Why would they be in meters per second?
alexeym is offline   Reply With Quote

Old   April 18, 2014, 14:46
Default
  #8
New Member
 
jeicek
Join Date: Nov 2013
Location: Germany
Posts: 18
Rep Power: 3
jeicek is on a distinguished road
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 is offline   Reply With Quote

Old   April 18, 2014, 14:47
Default
  #9
New Member
 
jeicek
Join Date: Nov 2013
Location: Germany
Posts: 18
Rep Power: 3
jeicek is on a distinguished road
Quote:
Originally Posted by alexeym View Post
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?
jeicek is offline   Reply With Quote

Old   April 18, 2014, 15:33
Default
  #10
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,109
Rep Power: 19
alexeym will become famous soon enoughalexeym will become famous soon enough
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.
alexeym is offline   Reply With Quote

Old   April 20, 2014, 09:30
Default
  #11
New Member
 
jeicek
Join Date: Nov 2013
Location: Germany
Posts: 18
Rep Power: 3
jeicek is on a distinguished road
Thank you very much Alexym for clarifying, now it was cleared for me.
jeicek is offline   Reply With Quote

Reply

Tags
correspondence points, data file, points data file, post processing, u data file

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found piprus OpenFOAM Installation 22 February 25, 2010 14:43
getting data from case and data files mkrao FLUENT 2 February 10, 2009 01:11
Converting formatted data files to unformatted mrangitschdowcom OpenFOAM Post-Processing 2 August 1, 2008 10:20
200 data files to post process (how?) Mark R FLUENT 1 August 9, 2001 13:35
[making animations] fclose fails to close files? Mika FLUENT 0 March 30, 2001 08:19


All times are GMT -4. The time now is 23:52.