CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   sample utility problem (https://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.

CaroVandame April 16, 2012 14:40

But doesn't the error message means that the keyword patches should be defined in the surfaces section?

"keyword patches is undefined in dictionary "/home/caro/OpenFOAM/caro-2.1.0/run/pipe_flow/system/sampleDict::surfaces" "

santiagomarquezd April 16, 2012 14:45

It couldn't find the keyword "patches" and checking the dict given with the source code, this keyword is present only in the sets section. The idea is to try adding something in this section to see what happens.

Regards

CaroVandame April 16, 2012 14:56

so using the tutorial LadenburgJet60psi as a guide (because they also want to sample for a wall property), here is what I wrote

sets
(
face
{
name cyl_Wall;
axis x;
start (0 0.05 0);
end (10 0.05 0);
nPoints 100;
}
);

But now I get this error:
keyword type is undefined in dictionary "/home/caro/OpenFOAM/caro-2.1.0/run/pipe_flow/system/sampleDict::sets"

I must be missing something obvious, I just don't see it...

santiagomarquezd April 16, 2012 14:59

Yes,

type uniform;

at the beginning of the definition.

CaroVandame April 16, 2012 15:02

And now I get my "keyword patches undefined ..." error again...

santiagomarquezd April 16, 2012 15:05

What FOAM version are you using?

CaroVandame April 16, 2012 15:06

OpenFOAM 2.1.0

santiagomarquezd April 16, 2012 16:13

Please check:

/opt/openfoam<your_version>/applications/utilities/postProcessing/sampling/sample/sampleDict

in order to see the correct wording of the dictionary, the keywords have changed in the last versions. Now the keyword patches is required in surfaces too.

Regards.

CaroVandame April 16, 2012 17:24

Thanks so much for your help Santiago!!!

It seems you do not need to specify anything in sets, as long as everything is defined correctly in surfaces.

santiagomarquezd April 16, 2012 17:27

You welcome. Yes, sets is not more needed. It was used only for testing purposes.

Bye.

cutty4sark June 6, 2012 20:42

sampleDict surfaces with moving mesh
 
Hello,

I was wondering if anyone has used the sampleDict to determine variable values along a moving mesh. Particularly, I'm interested in the displacement of a solid in an FSI case (Turek and Hron benchmark). It would be very similar to determining the displacement of the tip of the console in the flappingConsole FSI case that is packaged with the extend versions of 1.5 and 1.6. I've tried using the surfaces functionality of the sampleDict and like many other folks end up with empty file folders. This leads me to believe there are issues with trying to use the boundaries/interfaces between solid and fluid as my surface patch like others have experienced. This also brings me to the issue of trying to define a line or surface based on xyz coordinates as I'm interested in the variation of x,y,z over time as the solid is deflected. Any help would be appreciated and I'm curious if anybody else has experienced this as I couldn't find anything in the forums.

Regards,

Andrew

mmkr825 September 13, 2012 03:00

About installation of swak4Foam
 
Hi everyone,
I am fresher to openFoam. I came to know the uses of swak4Foam utility for writing boundary conditions. In my application also i need to apply zero flux boundary condition. So i wish to install swak4Foam. Now i am working on OF 2.1.1 version.
I followed every step as mentioned in the tutorials but i am not able to get it. The error message as follows

Error message:-

malli_reddy@ubuntu:~/OpenFOAM/malli_reddy-2.1.1$ svn checkout https://openfoam-extend.svn.sourcefo...ies/swak4Foam/

svn: OPTIONS of 'https://openfoam-extend.svn.sourcefo...ries/swak4Foam': Could not resolve hostname `openfoam-extend.svn.sourceforge.net': No address associated with hostname (https://openfoam-extend.svn.sourceforge.net)



Could you please suggest me how to overcome this problem. And suggest me some good tutorial for the swak4Foam.

Thanks
Regardshttps://mail.google.com/mail/images/cleardot.gif

legenoy June 19, 2013 22:24

Quote:

Originally Posted by cutty4sark (Post 365145)
Hello,

I was wondering if anyone has used the sampleDict to determine variable values along a moving mesh. Particularly, I'm interested in the displacement of a solid in an FSI case (Turek and Hron benchmark). It would be very similar to determining the displacement of the tip of the console in the flappingConsole FSI case that is packaged with the extend versions of 1.5 and 1.6. I've tried using the surfaces functionality of the sampleDict and like many other folks end up with empty file folders. This leads me to believe there are issues with trying to use the boundaries/interfaces between solid and fluid as my surface patch like others have experienced. This also brings me to the issue of trying to define a line or surface based on xyz coordinates as I'm interested in the variation of x,y,z over time as the solid is deflected. Any help would be appreciated and I'm curious if anybody else has experienced this as I couldn't find anything in the forums.

Regards,

Andrew

Hello,
I am using FSI for my work. I find Sample with OF-1.6 have some problems and I always have failed to get displacement with sample. Could you please suggest me how to overcome this problem?

Thanks
Regards

Legenoy

Josefina May 19, 2014 09:21

set file missing when using sample
 
Hello Everybody!

I am quite new with Open Foam and I try to use the sample utility. I read the very interesting questions and answers and I saw that sometimes the files in the set file are empty.

My problem is that the set file is not even created in my case directory. When I apply the sample utility I get this:

Create time

Create mesh for time = 0

Time = 0

Time = 0.1

Time = 0.2

Time = 0.3

Time = 0.4

Time = 0.5

Time = 0.6

Time = 0.7

Time = 0.8

Time = 0.9

Time = 1

End

So I think the utility works but I did not find how to create the set file. Somebody can help me please?

bigphil May 20, 2014 05:08

If the sample utility does not find the specified field in the time step then it skips the time step.

Can you post you sampleDict here?

Philip

alexeym May 20, 2014 05:15

Hi,

Quote:

Originally Posted by Josefina (Post 492859)
So I think the utility works but I did not find how to create the set file. Somebody can help me please?

Did you look in postProcessing/sets folder?

Josefina May 20, 2014 08:50

Hi!
Before all, thank you for your answers!

Here you can find my sampleDict file:

setFormat raw;
surfaceFormat raw;

formatOptions
{
ensight
{
format ascii;
}
}

interpolationScheme cell;

fields
(
p_rgh
U
alpha1
);


sets
(
lineX1
{
type uniform;
axis xyz;
start (0. 0.0 0.1);
end (0.2 0. 0.18);
nPoints 10;
}

lineX2
{
type face;
axis xyz;
start (0. 0.1 0.1);
end (0. 0.2 0.1);
}

somePoints
{
type cloud;
axis xyz;
points ((0.0 0.0 0.15)(0.2 0.2 0.15));
}


);


I think I had a problem of OpenFoam version. I have written "sampleSets" instead of "sets" but now it works! and the "sets" file is indeed created in the "postProcessing" file.
:)


All times are GMT -4. The time now is 04:01.