Sampling surfaces
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. |
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 |
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( Code:
// Surface output format. Choice of |
Quote:
src/conversion/meshTables/cellTable.C for an idea of how you might do it. /mark |
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<...>) |
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 |
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. |
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(
|
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. Quote:
Get back to us If you have further questions! |
sampling near to a curved surface
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 Alejandro |
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. |
I think there are better ways to do what you want. There are two post processing tools you can use:
Sven |
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 |
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. |
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::open(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); } ); } |
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&) |
vortex shedding frequency
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 |
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 ? |
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. |
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. |
Hello,
me again... fyi: basically I just commented out the not needed points and faces... this worked quite good. Now, I would like actually write out the complete mesh information including a boundary, neighbour, owner files. Do you have a hint, how I can do this? Best REgards! FAbian |
Dear foamers
Sampling data from the cells close to a boundary or a wall might not be a trivial matter. That is why I am calling back this some two years old thread, which is closely related to my present question. My geometry is composed of some curved walls and I need to collect some data, like U and p, from the very first layer of cells near the wall. It seems pretty straightforward to do that with the "sample" utility, if I new the coordinates of each cell centre, by just listing them under the type "cloud" in the sampleDict file. But this is where things go awry. So, is there an easy way to get the coordinates of some specific cells, in particular those bordering a wall? I would guess that cellSet might be an answer, but I could not find something like a source "boundaryToCell" in the topoSetDict. Or, alternatively, can anyone devise another approach to pick these close-to-the-wall cells values of velocity and pressure? BTW, this is almost exactly the question posed by Alejandro, above, but his problem was solved in a different way, so the the question remains alive. I would appreciate any suggestion on that. I am using OpenFOAM 2.0.0. Regards. G.Oliveira |
arcUniform sampling utility
Hi all,
Has anyone tried using the arcUniform utility for postProcessing (https://cpp.openfoam.org/v6/classFoa...Uniform.html)? When I try to implement it, it just gives me an error saying "keyword endAngle is undefined in dictionary "controlDict.functions.sample.sample.sets"" I was wondering why it would do that? |
You need to define endAngel. Or is the problem that you defined it but OpenFOAM is still complaining?
|
Quote:
You mentioned this in another reply as a solution(?): Quote:
|
All times are GMT -4. The time now is 21:52. |