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/)
-   -   Problems with surface sampling (http://www.cfd-online.com/Forums/openfoam-post-processing/107000-problems-surface-sampling.html)

mcarpe September 14, 2012 12:05

Problems with surface sampling
 
Hi all,

I'm trying to sample the pressure values on a wall surface. I can easily see the values in paraView, but when I execute the sample utility I don't get any output files. The folder "surface/10000/" is created but it's empty.

I'm using OpenFOAM 2.1.x and this is my sampleDict file:

Code:

surfaceFormat raw;

interpolationScheme cellPoint;

fields
(
    p
);

surfaces
(
    wallPressure
    {
        type            patch;
        patches        (buildingWall);
        interpolate        true;
        triangulate        false;
    }
);

I've tried with different options and different patches. The results are the same. No output files are created.

Using the sample utility with sets, instead of surface, on a set of sample points, works well.

Can anyone help me?
I'm sure I'm doing a very silly mistake, but I can't see it...

Thank you

SirWombat September 17, 2012 02:52

Quote:

Originally Posted by mcarpe (Post 381832)
...
Using the sample utility with sets, instead of surface, on a set of sample points, works well.
...


Then surface is probably called something different. You can check by using "patchSummary". This will list all boundary conditions including the full names of all patches/walls. Could be something like "buildingWall_patch0" perhaps ...

mcarpe September 17, 2012 06:53

Quote:

Originally Posted by SirWombat (Post 382070)
Then surface is probably called something different. You can check by using "patchSummary". This will list all boundary conditions including the full names of all patches/walls. Could be something like "buildingWall_patch0" perhaps ...

Thank you SirWombat for your help.

However this is not the case. I've tried several different patches and always got the same result. This is the output from patchSummary, for example:
Code:

[...]
wall: buildingWall
    scalar                nut                generic
    scalar                k                generic
    scalar                p                zeroGradient
    scalar                epsilon                generic
    vector                U                fixedValue
    symmTensor                R                generic
[...]


SirWombat September 17, 2012 16:46

hmm ... maybe try this:

Code:

setFormat raw;
surfaceFormat vtk;
interpolationScheme cellPoint;

fields
(
    p
);

surfaces
(
    wallPressure
    {
        type            patch;
        patches        (buildingWall);
        interpolate        true;
        triangulate        false;
    }
);

so use 'vtk' as output surface and 'raw' as output format.

mcarpe September 18, 2012 05:56

Thanks again SirWombat.

Tried that, and several other combinations, but unfortunately no results at all...

SirWombat September 18, 2012 07:08

Hi Matteo, just too bad!

You may wanna try a different approach: use a basePoint and normalVector instead, i.e. like this:

Code:

setFormat raw;
surfaceFormat vtk;
interpolationScheme cellPoint;
fields
(
    p
);

surfaces (
        wallplane{
                type                                plane;
                basePoint                (0 0.5 0);
                normalVector        (0 1 0);
                interpolate        true;
        }
);


Hope this gets you somewhere!

Greetings,
Jan

mcarpe September 19, 2012 04:18

Quote:

Originally Posted by SirWombat (Post 382303)
Hi Matteo, just too bad!

You may wanna try a different approach: use a basePoint and normalVector instead, i.e. like this:

Code:

setFormat raw;
surfaceFormat vtk;
interpolationScheme cellPoint;
fields
(
    p
);

surfaces (
        wallplane{
                type                                plane;
                basePoint                (0 0.5 0);
                normalVector        (0 1 0);
                interpolate        true;
        }
);


Hope this gets you somewhere!

Greetings,
Jan

Hi Jan,

no luck. It seems that surface sampling is not working at all, regardless the surface chosen... I'm going to try with runtime function objects, but, of course, I have to re-run the simulation. Could it this be a bug? Is anyone else having problems with surface sampling?

Thanks again
Matteo

SirWombat September 19, 2012 04:27

Hi Matteo, could you post the output of the sample-utility? Have you tried other fields (i.e. U)? What solver did you use?

As you said you can see the data in paraview, i guess your setup and output should be ok. the sample utility really should work then. I never had problems using 'sample', but i have only used it with simpleFoam (1 phase, steady), LTSInterFoam (2 phase, steady), interFoam (2phase, transient).

Hope someone else has an idea here.

G Jan

mcarpe September 19, 2012 05:00

Here is the output of the sample command:

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.x                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.1.x-c1ffc2074f88
Exec  : sample -latestTime
Date  : Sep 19 2012
Time  : 09:56:17
Host  : "EnFlo-MC01"
PID    : 11479
Case  : /home/mcarpentieri/OpenFOAM/mcarpentieri-2.1.x/run/HRModUrb/simpleC_0
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 = 1811

Reading surface description:
    wallPressure

Time = 1811

End

I've also tried other fields, U for example, same result. I'm using simpleFoam with kEpsilon RAS turbulence model. And I can confirm that I see the results in paraView just fine.

Thanks
Matteo

SirWombat September 19, 2012 05:05

hmmm ... if its not the surface description i am really lost on this one ... no idea whats going wrong. sorry! G jan

mcarpe September 19, 2012 08:13

Quote:

Originally Posted by SirWombat (Post 382502)
hmmm ... if its not the surface description i am really lost on this one ... no idea whats going wrong. sorry! G jan

Thanks a lot for your help anyway, Jan.

By the way, the function object sampledPatch is working perfectly. I just have to re-run all the simulations, now.

tfuwa November 9, 2012 12:00

Hi Matteo,What's sampledPatch look like? Can you please give an example? I searched on-line and the tutorials of 0F2.1.1 but cannot find. Thanks.


Quote:

Originally Posted by mcarpe (Post 382541)
Thanks a lot for your help anyway, Jan.

By the way, the function object sampledPatch is working perfectly. I just have to re-run all the simulations, now.



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