CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Sample utility not working properly (http://www.cfd-online.com/Forums/openfoam/76959-sample-utility-not-working-properly.html)

titio June 9, 2010 08:40

Sample utility not working properly
 
Dear Foamers

I am having problems using the sample utility in either OpenFOAM 1.6 and OpenFOAM 1.5 Dev. To better understand what is going on, I went to the description in the internet of solidDisplacementFoam, to check out in particular the variable definition, to see if there was anything in the variable definition that was hindering the operation of the sample utility. After some tests, I found out the following.

- Only for variables defined for the mesh it was possible to sample. For example, for D is possible as it is defined as

volVectorField D
00003 (
00004 IOobject
00005 (
00006 "D",
00007 runTime.timeName(),
00008 mesh,
00009 IOobject::MUST_READ,
00010 IOobject::AUTO_WRITE
00011 ),
00012 mesh
00013 );

but sigmaD no, being D defined as

00041 (
00042 IOobject
00043 (
00044 "sigmaD",
00045 runTime.timeName(),
00046 mesh,
00047 IOobject::NO_READ,
00048 IOobject::NO_WRITE
00049 ),
00050 mu*twoSymm(fvc::grad(D)) + lambda*(I*tr(fvc::grad(D)))
00051 );

Please note the differences, sigmaD involves a calculated field,
D not.

Also, I cannot extract single components, but, as I got all the
components separately, there is not much of a problem, only more
numbers.... But, to know how to extract single components will be
nice indeed...

How I can sample sigmaD? Is the sample utility not suitable for
this? Should I use probes instead? Why there is an example of the
usage of samples that does not work at all? I do not believe this is
problem of the system I am using, Ubuntu 8.10.

If anyone have some ideas, please answer me and help me out.

Regards,

António Martins

akidess June 9, 2010 09:00

I think the important difference here is that D is AUTO_WRITE, while sigmaD is NO_WRITE. If you write out sigmaD to disk, you should be able to sample it.

titio June 9, 2010 10:45

Tried but did not work
 
Akidess,

Changed the definition of sigmaD to AUTO_WRITE, and I got segmentation fault after applying the sample utility. But, if I do the same for the variable divSigmaExp, a vectorField calculated, I got results. SigmaD is a symmetric tensor field, so it seems there is a problem in the software. It may be:

- I am using the wrong comand to write the components.
- Sample does not work for tensors.

Can you help me on this.

Regards,

António Martins


All times are GMT -4. The time now is 02:19.