|
[Sponsors] |
July 29, 2010, 02:48 |
Data Output
|
#1 |
Senior Member
Rickard
Join Date: May 2010
Location: Lund, Skåne, Sweden
Posts: 143
Rep Power: 15 |
I was just wondering how OpenFoam sorts the output data?
When I e.g. look in say timestep 0.0015 (whatever) there is a long list of, lets say, temperatures in the T-textfile. How can I interpret these values? I want to make correlations in MatLab and only use a plane. Does anyone have an idea? |
|
July 29, 2010, 04:04 |
|
#2 |
New Member
Palma González García
Join Date: May 2009
Location: Valencia, Spain
Posts: 8
Rep Power: 16 |
As you say as an example, for temperature, it says the value of this parameter in each cell, i.e., if your mesh have 30000 cells, the first value is the temperature in cell#1 and so on. For velocity, there is a vector with the components, Ux, Uy and Uz -> (Ux, Uy, Uz) and it works the same as scalar variables. I hope it can help
|
|
July 29, 2010, 05:15 |
|
#3 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
Based on what Palminchi says you are getting a 1D list of cells with their associated variable values. It's going to be tough extracting a plane from that. You might want to use the 'sample' tool to extract data on a plane.
|
|
July 29, 2010, 05:17 |
|
#4 |
Senior Member
Cedric DUPRAT
Join Date: Mar 2009
Location: Nantes, France
Posts: 195
Rep Power: 17 |
Hi Richard
If you are interesting in only one plane of your geometry, you should look for the samplePlane tools (at least in OF 1.4.1) and post-process only this plane. You can get a column text file with x,y,z and T for example which can be interpreted by matlab easily. I hope this will help you Cedric |
|
July 29, 2010, 06:49 |
|
#5 |
Senior Member
Rickard
Join Date: May 2010
Location: Lund, Skåne, Sweden
Posts: 143
Rep Power: 15 |
Okay that sounds great. So how do I use it ?
Is it something i have to download |
|
July 29, 2010, 08:06 |
|
#6 |
Senior Member
Cedric DUPRAT
Join Date: Mar 2009
Location: Nantes, France
Posts: 195
Rep Power: 17 |
Nothing to download.
You'll have to add a file called sampleSurfaceDict where you'll define your plane coordinate (point + normal vector) and that's all. An example of this file can be found in a tutorial (I don't remember which one) If you want to check the code it's in application/utilities/postProcessing/ I hope this will help Cedric |
|
July 29, 2010, 08:14 |
|
#7 |
Senior Member
Rickard
Join Date: May 2010
Location: Lund, Skåne, Sweden
Posts: 143
Rep Power: 15 |
Are you referring to the sampleDict? Or there is actually a folder called sampleSurfaceDict?
|
|
July 29, 2010, 08:27 |
|
#8 |
Senior Member
Cedric DUPRAT
Join Date: Mar 2009
Location: Nantes, France
Posts: 195
Rep Power: 17 |
SampleDict is the file used by the application "sample" to print in a file values along a line . So in this file you define the line.
SampleSurfaceDict is the file used by the application "sampleSurface" to print in a file values in a plane. So in this file you define the plane coordinates |
|
July 29, 2010, 08:33 |
|
#9 |
Senior Member
Cedric DUPRAT
Join Date: Mar 2009
Location: Nantes, France
Posts: 195
Rep Power: 17 |
In OF 1.4.1, it was there:
applications/utilities/postProcessing/miscellaneous/sampleSurface and an example of the sampleSurfaceDict can be found there too. I don't know for more recent version of the code but, you should however find a similar tool. Cedric |
|
July 29, 2010, 08:41 |
|
#10 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
Cedric, you are misinformed. sample with sampleDict can be used to extract surfaces as well, see U-165.
|
|
July 29, 2010, 08:44 |
|
#11 |
Senior Member
Rickard
Join Date: May 2010
Location: Lund, Skåne, Sweden
Posts: 143
Rep Power: 15 |
Ah okay. So I suppose that I type. e.g
55 constantPlane 56 { 57 name constantPlane; 58 59 basePoint (0.0 0 0); 60 normalVector (0 1 -1); 61 62 // Optional: whether to leave as faces or triangulate (=default) 63 triangulate false; 64 } What about the other ones, interpolation .... and following. Can I just skip these? Does OpenFoam know which one i want to use? In the terminal later; do I type sampleSurface or just sample? Thx |
|
July 29, 2010, 08:54 |
|
#12 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
There is a reference sampleDict file in ~/OpenFOAM/OpenFOAM-1.x/applications/utilities/postProcessing/sampling/sample/.
What you are missing in your example is specification of "type plane;". All the other entries are optional. How would OpenFOAM know what you want to use? You'll have to see if the default works for you or if you have to specify more to meet your expectations. The tool to use is 'sample', sampleSurface doesn't seem to be included any more in version 1.5 (and presumingly later versions). |
|
July 29, 2010, 09:07 |
|
#13 |
Senior Member
Rickard
Join Date: May 2010
Location: Lund, Skåne, Sweden
Posts: 143
Rep Power: 15 |
Okay, so my conclusion is that I should use sampleDict instead of sampleSurfaceDict and try to get that working instead.
|
|
July 29, 2010, 09:23 |
|
#14 |
Senior Member
Rickard
Join Date: May 2010
Location: Lund, Skåne, Sweden
Posts: 143
Rep Power: 15 |
Any reason why this shouldnt work ?
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.6 | | \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location system; object sampleDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // setFormat raw; surfaceFormat vtk; interpolationScheme cellPoint; fields ( p U N-DODECANE ); surfaces ( constantPlane { type plane; // always triangulated basePoint (0.0 0.0 0.0); normalVector (0 0 -1); //- Optional: restrict to a particular zone // zoneName zone1; } ); // ************************************************** ********************* // |
|
July 29, 2010, 09:34 |
|
#15 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
Looks good to me, except you might want to set surfaceFormat to raw if you are writing your own import function for MATLAB. Are you having problems?
|
|
July 29, 2010, 09:41 |
|
#16 |
Senior Member
Rickard
Join Date: May 2010
Location: Lund, Skåne, Sweden
Posts: 143
Rep Power: 15 |
I changed what you said but i still have some problems
surfaceFormat raw; setFormat raw; interpolationScheme cellPoint; fields ( p U ); surfaces ( constantPlane { type plane; basePoint (0.0 0.0 0.0); normalVector (0 0 -1); } ); Its when I remove the sets that it doesnt work anymore. The sets being lines and stuff. But I dont want lines, just a plane. Any idea? thx |
|
July 29, 2010, 09:55 |
|
#17 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
Try retaining an empty list of sets ->
sets (); |
|
July 29, 2010, 09:58 |
|
#18 |
Senior Member
Rickard
Join Date: May 2010
Location: Lund, Skåne, Sweden
Posts: 143
Rep Power: 15 |
Great! It works
thank you |
|
March 27, 2011, 14:10 |
set curve
|
#19 |
Member
|
Hi all, How can i use set curve for sampling date a long a curve?? (for example cylinder curve)
|
|
June 6, 2014, 08:50 |
|
#20 |
New Member
|
Hi s. ,
I have the same question as you had three years ago. If you already have an solution for that, can you please help me out? Thanks. Aaron |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to output data from stationary part only? | Aerolex | FLUENT | 0 | November 16, 2009 22:46 |
[OpenFOAM] Output data file on the line of the example | zhoubinwx | ParaView | 0 | February 13, 2008 04:59 |
how to output particle trajectory coordinate data | steven | CFX | 0 | July 13, 2006 17:49 |
How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 17:27 |
Structured Data Output | Tristan Collins | FLUENT | 0 | March 22, 2005 07:12 |