CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

problem with sampling Utility in openFOAM 1.6

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree7Likes
  • 7 Post By bigphil

Reply
 
LinkBack Thread Tools Display Modes
Old   September 1, 2009, 09:16
Default problem with sampling Utility in openFOAM 1.6
  #1
New Member
 
Cárdenas
Join Date: Sep 2009
Posts: 5
Rep Power: 7
carmir is on a distinguished road
Hello to All,

I'm trying to use the sampling utility within the openFOAM version 1.6 in order to extract data for later post-processing in Matlab. I want to extract the cell values of the solution variables (x-velocity) along the y-coordinate for different x-locations.

My problem is that after running the utility, none sample data is stored / created.

Below is a copy of the dictionary entries I am using:

-----------------------------sampleDict----------------------------------
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object sampleDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

interpolationScheme cellPoint;

setFormat raw;

sets
(
location1
{
type midPoint;
axis y;
start (0.02 0.00 0.0);
end (0.02 0.120 0.0);
}
);

surfaces ();

fields
(
U.component(0)
);
-----------------------------------------------------------------------

If I understood the instructions in the User-Guide well, the utility is supposed to create a folder for each solution-time and each set (location) with the ASCII files inside. Here is the output I get when executing the sample Utility:

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

Create mesh for time = 0

Time = 0

Time = 0.2

Time = 0.4

Time = 0.6

Time = 0.8

Time = 1

End

-------------------------------------------------------------------------

First I tough that my entries in the dictionary were wrong (for example that my coordinates were outside of the domain), but I checked them several times and started using other options like "uniform", "cell", "pointAndCell", ...) as well. But the result was always the same.

I would appreciate any kind of help or suggestions. Thank you very much
carmir is offline   Reply With Quote

Old   September 3, 2009, 06:07
Default entry in sampleDict was not recognized
  #2
New Member
 
Cárdenas
Join Date: Sep 2009
Posts: 5
Rep Power: 7
carmir is on a distinguished road
Hello again,

after several trials, I think I found the problem. In the user guide, on chapter 6.5 three options are listed for the sampling of tensor/vector fields: the whole tensor (e.g. U), only one component (e.g. U.component(0)) or the magnitude (e.g. mag(U)). These fields keywords should be used in the sampleDict file. However, only the sampling of the whole tensor seem to work.

In my case, after changing the entry in the sampleDict from:

fields
(
U.component(0)
);

to

fields
(
U
);

the utility worked properly, and the ASCII files were created in the sets directory.

So the problem concerns now only to the sampling of specific tensor terms. I will take a look at the source files of the utility, perhaps has someone any suggestion were to start, since I'm a newbie in openFOAM.

Thanks
carmir is offline   Reply With Quote

Old   August 31, 2010, 13:52
Default
  #3
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 568
Rep Power: 19
bigphil will become famous soon enoughbigphil will become famous soon enough
I realise this thread is old,
but for anyone else who has a similar problem,
you can use "foamCalc" to calculate the components of a tensor/vector and then you can you sample to sample these components.

For example:
If I have the stress tensor sigma, then I type:
foamCalc components sigma

This will create the volScalarFields sigmaxx,sigmayy,sigmazz,sigmaxy,sigmaxz and sigmayz.

Then you can sample these fields.


Philip
ziad, saba_saeb, sdharmar and 4 others like this.
bigphil is offline   Reply With Quote

Old   September 5, 2010, 22:32
Default
  #4
Member
 
edison
Join Date: May 2009
Location: Australia
Posts: 33
Rep Power: 8
Edison_Ge is on a distinguished road
Quote:
Originally Posted by bigphil View Post
I realise this thread is old,
but for anyone else who has a similar problem,
you can use "foamCalc" to calculate the components of a tensor/vector and then you can you sample to sample these components.

For example:
If I have the stress tensor sigma, then I type:
foamCalc components sigma

This will create the volScalarFields sigmaxx,sigmayy,sigmazz,sigmaxy,sigmaxz and sigmayz.

Then you can sample these fields.


Philip
Hi Philip,
Thanks for the tips. Do you also have some idea about calculate particle values? say I want the velocity components of my all my particles located under case/time/lagruangian, how can I get them?
Edison_Ge is offline   Reply With Quote

Old   September 6, 2010, 04:37
Default
  #5
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 568
Rep Power: 19
bigphil will become famous soon enoughbigphil will become famous soon enough
Edison_Ge,

Unfortunately I have no experience with particles so I cannot help.
You could try:
foamCalc components lagrangian/U
but that is a total guess, so I really don't know.

Sorry I couldn't be of more help,

Philip
bigphil is offline   Reply With Quote

Old   November 21, 2011, 11:03
Default
  #6
New Member
 
Paolo
Join Date: Nov 2011
Posts: 7
Rep Power: 5
Jimbomet is on a distinguished road
Hi,
I have a problem with sample, it doesn't work at all...
I want only to sample the pressure field in the x direction, and my sampleDict file so reads:

interpolationScheme cell;
setFormat xmgr;
sets
(
line
{
type uniform;
axis x;
start ( 0 1.5 0.05 );
end ( 3 1.5 0.05 );
nPoints 100;
}
);
fields ( p );


but running it, it says:

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

Create mesh for time = 0

Reading set description:
line

Time = 0
Time = ....
End

and no outputs are created in my directory. What's wrong in what I'm doing?
Thanks for help
Jimbomet is offline   Reply With Quote

Old   December 6, 2011, 17:31
Default sampleDict - keyword patch rejected for some reason
  #7
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
Dear all:

I have the following sampleDict file:

setFormat raw;
surfaceFormat raw;

interpolationScheme cellPoint;

fields
(
alpha1
p
);


sets
(
left
{
type uniform;
axis xyz;
start ( 0 -15.0 5.0);
end ( 0 -15.0 -5.0);
nPoints 10;
}
middle
{
type uniform;
axis xyz;
start ( 0 0 5.0);
end ( 0 0 -5.0);
nPoints 10;
}
right
{
type uniform;
axis xyz;
start ( 0 15 5.0);
end ( 0 15 -5.0);
nPoints 10;
}
);

surfaces
(
test01
{
type patch;
patchName leftWall;
interpolate false;
triangulate true;
}
);

however, when I run it I get the following error:

musa@musa-Satellite-M35X:~/OpenFOAM/musa-2.0.1/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D$ sample
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.0.1-51f1de99a4bc
Exec : sample
Date : Dec 06 2011
Time : 16:08:04
Host : musa-Satellite-M35X
PID : 7903
Case : /home/musa/OpenFOAM/musa-2.0.1/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

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

Create mesh for time = 0

Reading set description:
left
middle
right



--> FOAM FATAL IO ERROR:
keyword patches is undefined in dictionary "/home/musa/OpenFOAM/musa-2.0.1/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/sampleDict::surfaces"

file: /home/musa/OpenFOAM/musa-2.0.1/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/sampleDict::surfaces from line 69 to line 72.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 400.

FOAM exiting

if I dont use the "patch" keyword, then how am I supposed to define where the pressure is to be evaluated? Any suggestions / advice?

Thanks in advance
musahossein is offline   Reply With Quote

Old   December 6, 2011, 19:47
Default
  #8
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
Quote:
Originally Posted by Jimbomet View Post
Hi,
I have a problem with sample, it doesn't work at all...
I want only to sample the pressure field in the x direction, and my sampleDict file so reads:

interpolationScheme cell;
setFormat xmgr;
sets
(
line
{
type uniform;
axis x;
start ( 0 1.5 0.05 );
end ( 3 1.5 0.05 );
nPoints 100;
}
);
fields ( p );


but running it, it says:

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

Create mesh for time = 0

Reading set description:
line

Time = 0
Time = ....
End

and no outputs are created in my directory. What's wrong in what I'm doing?
Thanks for help
In OpenFOAM, the x axis is in and out of the paper. Y is horizontal and Z is up and down. You may want to check your axes and the orientation of your model relative to it.
musahossein is offline   Reply With Quote

Old   February 25, 2014, 07:43
Default
  #9
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 4
Sherlock_1812 is on a distinguished road
Hi all,

This is a very old thread, but I would like to ask if there is a way to sample velocity magnitude in the r-direction? I'm using a circular geometry where I'd like to see variation along r. Can there be an alternate definition for axis instead of x,y,z or xyz?
__________________
Regards,

Srivaths
Sherlock_1812 is offline   Reply With Quote

Old   February 25, 2014, 12:06
Default
  #10
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
Quote:
Originally Posted by Sherlock_1812 View Post
Hi all,

This is a very old thread, but I would like to ask if there is a way to sample velocity magnitude in the r-direction? I'm using a circular geometry where I'd like to see variation along r. Can there be an alternate definition for axis instead of x,y,z or xyz?
Interesting! I dont know. But if you look at the OpenFoam manual I think they give you conversion between cartesian and cylidrical coordinates. Also I know a paper that used open foam to study sloshing in circular tanks. They may have some pointers as to how they solved the problem in cylindrical coordinates. The paper is titled "Compariosion of CFD with Simplified Models for sloshing in space-craft tanks" Authors: O. Gloth, Y. Xia and R. Schwane. You could find it with google search. I think the paper is a free download.
musahossein is offline   Reply With Quote

Old   February 26, 2014, 03:00
Default
  #11
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 4
Sherlock_1812 is on a distinguished road
Thank you. I will have a look at the paper to see if i can get hints. Also, how should the 'distance' option in axis be specified?
__________________
Regards,

Srivaths
Sherlock_1812 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with cyclic boundaries in Openfoam 1.5 fs82 OpenFOAM 37 January 7, 2015 01:31
CAD -> gMsh -> enGrid -> OpenFOAM Problem AlGates OpenFOAM 7 August 6, 2010 12:46
Problem running paraFoam on OpenFOAM 1.5 sonny OpenFOAM 3 June 6, 2009 20:24
OpenFOAM Install problem masb OpenFOAM 3 May 25, 2009 11:32
Problem importing mesh in openfoam from fluent alessandr0 OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 3 September 4, 2008 13:41


All times are GMT -4. The time now is 05:11.