CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   sample utility problem (http://www.cfd-online.com/Forums/openfoam-post-processing/79764-sample-utility-problem.html)

And September 3, 2010 03:13

sample utility problem
 
Hello to the OpenFOAM community.

I'm experiencing a problem when using the sample utility distributed in OpenFOAM 1.6.x.

I would like to draw the streamwise component Ux along the y direction for the pitzDaily3D tutorial in non reacting conditions. The sampleDict has the following entries:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

interpolationScheme cell;

setFormat raw;

sets
(
internalField
{
type uniform;
axis y;
start ( 0.01 -0.025 0 );
end ( 0.01 0.025 0 );
nPoints 100;
}
);

surfaces ();

fields ( U );


// ************************************************** *********************** //


The sample utility seems to work properly when it is invoked:


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Time = 0

Time = 0.05

Time = 0.1

Time = 0.15

Time = 0.2

Time = 0.25

Time = 0.3

Time = 0.35

Time = 0.4

Time = 0.45

anyway the files internalField.xy created in the "/sets/[0-0.45]" folders are empty

I tried also to compute the single velocity component by selecting in the keyword fields:

fields ( U.component(0) )

but the result is the same. Does anyone can help me to fix this problem ?

Regards

Andrea

santiagomarquezd September 3, 2010 08:31

Andrea, I couldn't find it, but there is a post saying that sample utility is not working properly for U and U.component() at least for 1.5. Maybe this thread can be useful for you:

http://www.cfd-online.com/Forums/ope...oam-1-6-a.html

Regards.

And September 3, 2010 08:41

Quote:

Originally Posted by santiagomarquezd (Post 273897)
Andrea, I couldn't find it, but there is a post saying that sample utility is not working properly for U and U.component() at least for 1.5. Maybe this thread can be useful for you:

http://www.cfd-online.com/Forums/ope...oam-1-6-a.html

Regards.

Thank you very much Santiago.I was aware of this post. I have just tried to follow the suggestions contained in it before posting. However I coundn't fix the problem.

Regards

bigphil September 3, 2010 11:12

Hi,


you could try:
foamCalc components U

This will print out the components of U in each time directory - Ux, Uy and Uz.

Then try sample after that, with Ux in the fields section of sampleDict.


Philip

And September 6, 2010 10:12

Quote:

Originally Posted by bigphil (Post 273924)
Hi,


you could try:
foamCalc components U

This will print out the components of U in each time directory - Ux, Uy and Uz.

Then try sample after that, with Ux in the fields section of sampleDict.


Philip

Hi Philip,

thanks for your reply. But unfortunately after having executed

foamCalc components U

and then sample with Ux in the fields section of sampleDict, it creates the file in the directory time 0.04 but remains still empty.

bigphil September 6, 2010 10:22

Hmmnn I am not sure then what's the problem,

Hopefully someone else might be able to help.

Philip

francois October 7, 2010 09:58

I've got strange results with the sample utility (OF 1.7-1):

For example when I try to plot the wall shear stress on a line on the inner wall of a pipe the sample utility and paraFoam give me a different distribution. It's the exact same line.

The line is z oriented and in my sampleDict file I have:

interpolationScheme cellPoint;

fields
(
U
wallShearStress
);

sets
(
x=-0.025
{
type face;
axis z;
start (-0.025 0 0);
end (-0.025 0 1.495);
}

I also encountered empty sample output file.

Any one has also seen these kind of problems ?

vkrastev October 7, 2010 11:49

Hi all,

to my experience the sample utility gives empty files when it cannot found node values near enough to interpolate from them. I don't know if this is the case, but I can suggest you to put the sample line "inside" the domain, and not on the border (I mean, if your 2D domain in OpenFOAM has a thickness of 0.1 m in the z direction and is comprised between z=0 and z=0.1, set the z coordinate in the sampleDict as 0.05).

Regards

V.

And October 8, 2010 04:05

sample utility
 
Hi Vesselin

I followed your suggestions and I put the sample line inside the domain without including the boundaries and it worked. The files created inside the sets directories were not empty.

Thanks for your help,

Regards

Andrea Aprovitola

francois October 8, 2010 04:40

Thanks guys for the suggestions.

So if I understand you correctly you said that the sample utility is unable to give values at wall boundaries of your computational domain nor inlet or outlet.

So how do you obtain you wall shear stress or y+ values at the wall ?

Regards
François

vkrastev October 8, 2010 05:24

Quote:

Originally Posted by francois (Post 278402)
Thanks guys for the suggestions.

So if I understand you correctly you said that the sample utility is unable to give values at wall boundaries of your computational domain nor inlet or outlet.

So how do you obtain you wall shear stress or y+ values at the wall ?

Regards
François

Hi Francois,

actually what I have experienced in using the sample utility is that it has some difficulties to interpolate correctly the required data field if the sampling pattern is set exactly on the boundary of the domain: this doesn't mean that it doesn't work in any case, but simply that with such kind of setting you cannot be shure that It will work properly. Anyway, you have also to keep in mind that the sample utility gives the opportunity to choose between different sampling options and interpolating algorithms, and I haven't tried to use all of them yet, so maybe there can be a more effective global setting which can avoid such kind of problems. But, however, if you want to sample some quantities at the boundary of your domain (e. g. at a solid wall or at a generic boundary patch) my personal suggestion is to set the sampling pattern very close to the boundary (e. g. at 10^-05 m or lower) but not exactly on it. Finally, if we talk about y+ and the wall shear stress I think that OpenFOAM has some "ad hoc" utilities to calculate them, so maybe you can have a look on the user's Guide about this matter.

Regards

V.

francois October 8, 2010 05:50

Hi Vesselin,

Thank you very much for your kind and helpful answers.
I will try what you suggest.

Regarding the y+ and the wall shear stress, indeed OF has already some utilities to compute those values: yPlusLES, yPlusRAS and wallShearStress but the values computed are on the wall patches of the computational domain so it doesn't solve the problem.

I've tried to use the cellPointFace interpolation scheme but it doesn't work at all.

Anyway will try to build my line "near" the wall to see what happen.
If someone has other suggestions ...

Regards
François

vkrastev October 8, 2010 06:21

Quote:

Originally Posted by francois (Post 278410)
Hi Vesselin,

Thank you very much for your kind and helpful answers.
I will try what you suggest.

Regarding the y+ and the wall shear stress, indeed OF has already some utilities to compute those values: yPlusLES, yPlusRAS and wallShearStress but the values computed are on the wall patches of the computational domain so it doesn't solve the problem.

I've tried to use the cellPointFace interpolation scheme but it doesn't work at all.

Anyway will try to build my line "near" the wall to see what happen.
If someone has other suggestions ...

Regards
François

I've done in the same way to evaluate the y+ value over a solid wall (I mean, run the yPlusRAS utility, put the sampling line very close to the wall and then run the sample utility) and if remember correctly it should work...

desert_1250 March 27, 2011 14:03

set curve
 
Hi all,
how can i extract data (for example pressure) with sampling utility for cylinder wall? if it may be done with curve set point or other advice, i am very glad that tell me a bout it, thanks.

xqy March 31, 2011 22:43

Quote:

Originally Posted by desert_1250 (Post 301155)
Hi all,
how can i extract data (for example pressure) with sampling utility for cylinder wall? if it may be done with curve set point or other advice, i am very glad that tell me a bout it, thanks.

I'm also finding it . If you know, plz tell me how. Thanks.

desert_1250 April 1, 2011 04:07

yep, i find it, just enough that be used sampleDict utility and set the pach name cylinder in the "surfaces" and and then set "p" in the fields, after that execute "sample"
if it is not clear for u, tell me to explain more

_____
Rasoul

xqy April 1, 2011 10:24

Quote:

Originally Posted by desert_1250 (Post 301794)
yep, i find it, just enough that be used sampleDict utility and set the pach name cylinder in the "surfaces" and and then set "p" in the fields, after that execute "sample"
if it is not clear for u, tell me to explain more

_____
Rasoul

Desert_1250, I test your method like this:

surfaces
(
inlet
{
type patch;
patchName INLET;
}
);


but there's nothing exact in the dictionary .../case/surfaces/1000/.

My case is a 2d calculation, and the inlet is a surface just for test. In fact I want to output data on a cylinder line .

desert_1250 April 1, 2011 10:49

you should modify your sampleDict as this follow:


surfaces
(
inlet //-> the name of your cylinder patch
{
type patch;
patchName inlet;// ->the name of your cylinder patch
}
);

fields
(
p
);

_____
Rasoul

CaroVandame April 16, 2012 14:20

So I've been trying to use the info from this post to sample the wallShearStress at a cylinder wall.
My pipe_flow was defined using the wedge method.

Using previous answers from this thread, here is what my sampleDict file looks like:

fields (wallShearStress);
sets();
surfaces
(
fixedWall //-> the name of my pipe wall
{
type patch;
patchName fixedWall;
}
);

But I get an error:
"keyword patches is undefined in dictionary "/home/caro/OpenFOAM/caro-2.1.0/run/pipe_flow/system/sampleDict::surfaces" "

So it seems I'm not defining the keyword patches, but I've looked at other sampleDict files from the tutorials, and couldn't find any with this keyword, could someone help me please?
Also, 2nd question, I'm not sure which interpolation scheme I should use?

Thanks!

santiagomarquezd April 16, 2012 14:32

Caro, FOAM is asking you for the keyword "patches" which is a part of the sets section where you set the points sampling. Maybe you can add a simple sampling point in order not to leave the sets section empty.

Regards.


All times are GMT -4. The time now is 03:07.