|
[Sponsors] |
July 10, 2009, 07:28 |
Sampling surfaces
|
#1 |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Hello World.
I have found it very useful to create foamFile's out of sample when sampling surfaces. Is it possible to write these foamFiles with the appropriate headers? Is there even a way of omitting the distinctive folders for scalar or vector fields? S.
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
|
July 21, 2009, 18:39 |
|
#2 |
Member
Eelco Gehring
Join Date: Mar 2009
Posts: 70
Rep Power: 17 |
Sega,
I have some problems with sampling surfaces. I was wondering if you can point me in the right direction? I want to sample the heat transfer coefficient that I output on the bottom wall of my domain. The heat transfer coefficient is defined as a surfaceScalarField. How do I set up my sampleDict to sample this surface? Thanks |
|
July 22, 2009, 02:49 |
|
#3 |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
As far as I can tell you this is rather simple.
Is assume the "bottom" is identical to a boundary patch? If that's true you can sample this patch by putting its name to patchName: Code:
surfaces( nameOfYourSampleSurface { type patch; patchName nameOfYourPatch; } ); Code:
// Surface output format. Choice of // null : suppress output // foamFile : separate points, faces and values file // dx : DX scalar or vector format // vtk : VTK ascii format // raw : x y z value format for use with e.g. gnuplot 'splot'. // stl : ascii stl. Does not contain values! surfaceFormat vtk;
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
|
July 22, 2009, 03:42 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
Quote:
src/conversion/meshTables/cellTable.C for an idea of how you might do it. /mark |
||
July 22, 2009, 06:00 |
|
#5 |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Yes, looks like something I intend to do, but I'm not getting to it.
I don't see where I can input the class and object entries. Is there some mapping involved?! (IOMap<...>)
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
|
July 23, 2009, 15:24 |
|
#6 |
Senior Member
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19 |
Hi,
does anyone know, if there is an option for the foamFile output, which omits the output of the points and faces except for the last write out? This would help saving disk space. Fabian |
|
July 27, 2009, 13:41 |
|
#7 | |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Quote:
Maybe you can have a look into the code of the sample tool and find the place where the points and faces files are written. Maybe you can wrap these lines in an if-Statement which checks if the last time step is reached.
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
||
November 8, 2009, 03:09 |
|
#8 |
Member
Sven Winkler
Join Date: May 2009
Posts: 70
Rep Power: 17 |
Unfortunately i dont completely understand how you sample surfaces. As far as I saw, this is what I have to put in my control dict-file:
Code:
surfaces( nameOfYourSampleSurface { type patch; patchName nameOfYourPatch; } );
|
|
November 8, 2009, 06:26 |
|
#9 | ||
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Quote:
An example of a complete sampleDict can be found in OpenFOAM/OpenFOAM-1.6/applications/utilities/postProcessing/sampling/sample/sampleDict Quote:
With patchName (nameOfYourPatch) you will define which patch you want to sample according to its name in blockMesh and with nameOfYourSampleSurface you will give the sample output a name. So, the output file will be named after the latter. As mentioned above you will have to put the lines into its own dictionary. Get back to us If you have further questions!
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
|||
December 8, 2009, 09:45 |
sampling near to a curved surface
|
#10 |
New Member
Cárdenas
Join Date: Sep 2009
Posts: 5
Rep Power: 17 |
Hello to All,
I have a question concerning the sample utility, and since I already got some help from this thread, I posted it here instead of creating a new one. I'm simulating the flow past a circular cylinder and I'm interested in the skin friction (dU/dr) along its no slip surface. My idea is to get the velocity components at the cell centers of the first cell-row, and with the coordinates of the corresponding points compute afterwards in Matlab the gradients. With the help of this thread I was able to sample the velocity fields on the cylinder surface using the patch option of the sample utility, but instead of getting the cell-center values, I got the surface values, which are of course zero (No slip boundary condition). Is there a posibility to sample the values at the center of the cells attached to the boundary patch? Here is my sampleDict file: Code:
8 FoamFile 9 { 10 version 2.0; 11 format ascii; 12 class dictionary; 13 location "system"; 14 object sampleDict; 15 } 16 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 18 setFormat raw; 19 20 surfaceFormat raw; 21 22 interpolationScheme cell; 23 24 fields 25 ( 26 U 27 ); 28 29 sets 30 ( 31 ); 32 33 surfaces 34 ( 35 Zylinder 36 { 37 type patch; 38 patchName CYLINDER; 39 } 40 ); 41 Alejandro |
|
December 8, 2009, 11:22 |
|
#11 |
Member
Eelco Gehring
Join Date: Mar 2009
Posts: 70
Rep Power: 17 |
Alejandro,
Of course you are getting the values at the surface, since you've specified that: 33 surfaces 34 ( 35 Zylinder 36 { 37 type patch; 38 patchName CYLINDER; 39 } Look into sampling a field instead of a surface. There is a example 'sampleDict' in applications/utilities/postProcessing/sampling/sample which can help you out. |
|
December 8, 2009, 14:37 |
|
#12 |
Member
Sven Winkler
Join Date: May 2009
Posts: 70
Rep Power: 17 |
I think there are better ways to do what you want. There are two post processing tools you can use:
Sven |
|
December 9, 2009, 08:59 |
|
#13 |
New Member
Cárdenas
Join Date: Sep 2009
Posts: 5
Rep Power: 17 |
Eelco, thanks for the confirmation, so the surface sample makes only sense for values other than the imposed ones.
Sven, both utilities wallShearStress and wallGradU helped me a lot, thank you very much for the hint. They even give the derivatives already in normal and tangential direcctions, exactly in the way I need them. So, thanks again! Alejandro |
|
April 2, 2010, 12:51 |
|
#14 |
Senior Member
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17 |
Dear Sebastian,
Have you solve your problem ? Maybe the things we want to do is the same. I use functionObject to sampling internal surface data, and will generate many folders, like scalarField, vectorField. The data format whick TimeVaryingMappedFixedValue needed is a little difference from sampling data. Because I have 100000 time steps, and total 150 G space. If modify every time step data one by one will need a lot of time. Maybe we can make our own code to do this convertion, but 150G data is also a large work. So the best way is to sample the data and save to correct data format and folder. Do you have some commont ? Thank you. |
|
April 27, 2010, 09:08 |
|
#15 |
Senior Member
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17 |
Dear all,
How can I create my own functionObject ? my purpose is to extract a plane data of internal domain in every time step, and save to disk. I noticed "surfaces functionObject" can do the similar thing, so I want to modify surfaces functionObject.I found it belongs to sampling, So I copy src/sampling directory to another position. I changed the name to LIB = $(FOAM_USER_LIBBIN)/libmysampling. in sampling\sampledSurface\sampledSurfaces, I found 2 places had name "surfaces", *.H file: public: //- Runtime type information TypeName("surfaces"); *.C文file: PtrList<sampledSurface> newList ( dict.lookup("surfaces"), sampledSurface::iNew(mesh_) ); I changed these "surfaces" to "mysurfaces", and compiled, no problem. but when I used, had the following mistake, Starting time loop --> FOAM Warning : From function dlLibraryTable:pen(const dictionary& dict, const word& libsEntry, const TablePtr tablePtr) in file lnInclude/dlLibraryTableTemplates.C at line 68 library "libmysampling.so" did not introduce any new entries Unknown function type mysurfaces Valid functions are : 5 ( surfaces fieldAverage fieldMinMax sets probes ) From function functionObject::New(const word& name, const Time&, const dictionary&) in file db/functionObjects/functionObject/functionObject.C at line 89. FOAM exiting It seems that my modified name haven't been registed in functionObject. Could anyone can give me some help ? Thanks. I am using like this in my controlDict file: extraction { type mysurfaces; functionObjectLibs ("libmysampling.so"); enabled true; outputControl timeStep; outputInterval 1; surfaceFormat foamFile; interpolationScheme cellPointFace; fields ( U T ); mysurfaces ( aplane { type plane; basePoint (-0.4 0 0.5); normalVector (1.0 0 0); } ); } |
|
May 27, 2010, 04:27 |
|
#16 |
New Member
|
Hello Panda,
It might be late to reply your post. you are getting those error because you might have forgotten to override following virtual functions, and to add FuctionObjects header file and C file in your mysampling directory, and of course include functionObject.C in Make/files file. updateMesh(const mapPolyMesh&) movePoints(const pointField&) |
|
May 28, 2010, 03:03 |
vortex shedding frequency
|
#17 |
Senior Member
NAVEEN.K.M
Join Date: Mar 2009
Location: Bangalore, Karnataka, india
Posts: 114
Rep Power: 17 |
hi,
myself Naveen working on flow around a circular cylinder of diameter 2m using OpenFOAM 1.4.1 and 1.5 versions past 1 month. I am getting pressure and velocity contours correctly in both the versions.I am facing difficult to get the vortex shedding frequency in OpenFOAM. Can you please suggest me how to get the strouhal number and vortex shedding frequency in OpenFOAM 1.5. Flow conditions (laminar flow): Reynolds number---------> 150 (based on cylinder diameter) velocity------------------------>1 m/s viscosity------>0.01333 m2/sec(based on cylinder diameter) diameter of cylinder--------> 2 meters OpenFOAM version-------->1.4.1, 1.5 solver----------------------------->icoFoam can you please give me a suggestion how to get these values using the probes function and FFT. waiting for your response Regards, Naveen |
|
May 28, 2010, 06:47 |
|
#18 |
Senior Member
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17 |
Dear Subodh Kumar,
I modified the original sample tool in OpenFOAM-1.6/SRC directory and recompile again. If it will bring some risk to my simulation ? Because I don't know how functionObject works. For example, If I generate another functionObject "libmysampling.so" , and then I delete this libmysampling.so , if this new name still exists in functionObject list ? |
|
May 28, 2010, 11:45 |
|
#19 |
New Member
|
Hello Panda,
No, modifying sample utility not bring any risk to your simulation. sample is not at all related to simulation. It is a post processing tool, which you could used after simulation. According to me modifying sample is not a good idea, because you will not be able to get standard behavior of it if you need in future, thats why it is always recommended to customize and created new library according to your requirements. Library and Functionobject are two different thing. Library could be used for many purposes for example to convert Cartesian coordinate to cylindrical, or to calculate and print parameters values at every iteration and stuff like that. FunctionObject is a way through which a exe is asked to repeat a action at every iteration. Now if we want to calculate something and print it at every iteration then we create a functionObject in controlDict file and in body of functionObject we load library by command " functionObjectLibs ("libmysampling.so"); ". To answer your another question, if you have deleted the library that you are loading through functionObject, then OpenFOAM will throw error, saying your library does not exist. If you have deleted the library and not loading it through functionObject then there should not be any problem at all. Above is my understanding about Function Object and library, Please correct me if I am wrong. |
|
May 29, 2010, 09:39 |
|
#20 |
Senior Member
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17 |
Dear Subodh Kumar,
Thank you very much. Now I am little understand. I think you are right. Modifying the original one is not a good idea. |
|
Tags |
sample |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Importing or Creating 2D Flat Surfaces into CFX | Sam | CFX | 5 | March 30, 2013 12:11 |
creating new surfaces | fluentguy | FLUENT | 1 | May 7, 2009 04:34 |
Faceted surfaces in ICEM | Chriss | Main CFD Forum | 1 | May 6, 2008 16:18 |
Surfaces lost from ICEM to CFX-Pre 5.7 | Mark | CFX | 6 | October 1, 2004 00:07 |
Surfaces | Mark | FLUENT | 2 | February 9, 2004 11:41 |