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?
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?
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:
src/conversion/meshTables/cellTable.C for an idea of how you might do it.
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<...>)
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.
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:
An example of a complete sampleDict can be found in
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.
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:
Of course you are getting the values at the surface, since you've specified that:
37 type patch;
38 patchName CYLINDER;
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:
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!
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 ?
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",
//- Runtime type information
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 :
From function functionObject::New(const word& name, const Time&, const dictionary&)
in file db/functionObjects/functionObject/functionObject.C at line 89.
It seems that my modified name haven't been registed in functionObject.
Could anyone can give me some help ?
I am using like this in my controlDict file:
basePoint (-0.4 0 0.5);
normalVector (1.0 0 0);
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.
vortex shedding frequency
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)
viscosity------>0.01333 m2/sec(based on cylinder diameter)
diameter of cylinder--------> 2 meters
OpenFOAM version-------->1.4.1, 1.5
can you please give me a suggestion how to get these values using the probes function and FFT.
waiting for your response
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 ?
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.
|All times are GMT -4. The time now is 20:33.|