Data Output
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? |
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
|
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.
|
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 |
Okay that sounds great. So how do I use it ?
Is it something i have to download |
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 |
Are you referring to the sampleDict? Or there is actually a folder called sampleSurfaceDict?
|
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 |
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 |
Cedric, you are misinformed. sample with sampleDict can be used to extract surfaces as well, see U-165.
|
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 |
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). |
Okay, so my conclusion is that I should use sampleDict instead of sampleSurfaceDict and try to get that working instead.
|
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; } ); // ************************************************** ********************* // |
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?
|
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 |
Try retaining an empty list of sets ->
sets (); |
Great! It works
thank you |
set curve
Hi all, How can i use set curve for sampling date a long a curve?? (for example cylinder curve)
|
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 |
All times are GMT -4. The time now is 04:53. |