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

sampleDict - Problems with distanceSurface

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By aw241

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 20, 2011, 12:16
Default sampleDict - Problems with distanceSurface
  #1
New Member
 
Taylorreihe
Join Date: Dec 2010
Posts: 4
Rep Power: 16
Taylorreihe is on a distinguished road
Hi,

I try to sample my velocity data with distanceSurface (using OF 201) and getting this error:

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  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 -latestTime
Date   : Sep 20 2011
Time   : 16:41:39
Host   : ThinkPad-X40
PID    : 3895
Case   : /home/kiro/OpenFOAM/kiro-2.0.1/run/askervein_hill/ask_mesh1_2sphere_SST
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 = 10203

Reading surface description:
    topology_askervein.stl

Time = 10203


--> FOAM FATAL ERROR: 
getVolumeType failure, neither INSIDE or OUTSIDE

    From function void Foam::distanceSurface::createGeometry()
    in file sampledSurface/distanceSurface/distanceSurface.C at line 168.

FOAM exiting
Have anyone an idea what's wrong?

Because when I try to sample the same case with OF17 it runs fine (without any errors), but the results are verry weird!

Here are my sampleDict:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.6                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/                              
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      sampleDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

setFormat raw;
surfaceFormat   raw;

interpolationScheme cellPointFace;

fields
(
    U
);

sets
(
);

surfaces
(
    topology_askervein.stl
    {
        type              distanceSurface;
        surfaceType    triSurfaceMesh;
        distance        10;
        signed           true;
    }
); 


// ************************************************************************* //
Thanks in advance,
Kris
Taylorreihe is offline   Reply With Quote

Old   December 13, 2011, 06:56
Default did you ever get a reply?
  #2
New Member
 
Hanan Einav-Levy
Join Date: May 2011
Posts: 10
Rep Power: 15
hananfoam is on a distinguished road
Hi Kris,

I'm trying to use distanceSurface to sample at specific heights above my surface, for flow simulation in the atmospheric boundary layer - exactly what you are doing (according to the name of you stl file).

Did you ever solve your problem?

I have some additional questions , but first thing first, hope you answer.

Hanan.
hananfoam is offline   Reply With Quote

Old   September 27, 2017, 04:20
Default
  #3
New Member
 
slan
Join Date: Nov 2010
Location: Eindhoven
Posts: 19
Rep Power: 16
aaron_lan is on a distinguished road
Send a message via MSN to aaron_lan
Hi Hanan,

After so many years, do you have a solution for this problem?

Regards,

Aaron
aaron_lan is offline   Reply With Quote

Old   March 3, 2022, 05:54
Default Extract the surface from the bottom patch
  #4
New Member
 
Clara
Join Date: Sep 2010
Location: Bruxelles
Posts: 16
Rep Power: 16
risku9 is on a distinguished road
A good solution that worked like charm for me was to first convert the bottom (terrain) patch into an stl, then move it to the height of interest:

surfaceMeshTriangulate -patches "(Terrain)" Terrain_frompatch.stl
surfaceTransformPoints -translate '(0 0 h)' Terrain_frompatch.stl Sampling_surface.stl

Where h is your desired height.
The resulting surface will have the same mesh resolution as your patch, so if you mesh is okish, your surface sampling should be too.

Then you just do a typical triSurfaceMesh sampling:

Terrain_ph
{
// Sampling on triSurface
type triSurfaceMesh;
surface Sampling_surface.stl;
source cells;
interpolate false;
}

Cheers
risku9 is offline   Reply With Quote

Old   May 26, 2022, 20:38
Default
  #5
New Member
 
Angel Monsalve
Join Date: Oct 2009
Posts: 7
Rep Power: 17
angelmonsalve is on a distinguished road
12 years later...

I just had that problem. I have used this method for a long time and today was the first time that I run into this problem.

The reason is actually in the error message. OpenFOAM can't determine what region is Inside or Outside your stl file. In my case, when it worked, I always used shell-type surfaces. Therefore, the definition of insider and outside is within the postprocess function.

Most likely you are using an "actual" surface, at least that was my case. So, the solution is pretty simple, set Signed as False. That should do it.

This is what my Dict looks like

type surfaces;
libs ("libsampling.so");
surfaceFormat raw;

interpolationScheme pointMVC;

fields
(
UPrime2Mean
R
k
UMean
);

surfaces
(
h_10Percent
{
// Isosurface from signed/unsigned distance to surface
type distanceSurface;
signed false;

// Definition of surface
surfaceType triSurfaceMesh;
surfaceName Q3_h1.stl;
// Distance to surface
distance 0.001;

//cell false;// optional: use isoSurface instead
// of isoSurfaceCell
interpolate true;
regularise false; // Optional: do not simplify
// mergeTol 1e-10; // Optional: fraction of mesh bounding box
// to merge points (default=1e-6)
}
);

Hope this helps someone in the future.
angelmonsalve is offline   Reply With Quote

Old   May 30, 2022, 12:58
Default
  #6
New Member
 
Join Date: Jul 2012
Posts: 2
Rep Power: 0
aw241 is on a distinguished road
angelmonsalve:


By pure chance I had the same issue in the last couple of days, and was able to solve it using "signed false;".


Thank you my man/woman!
angelmonsalve likes this.
aw241 is offline   Reply With Quote

Old   June 14, 2022, 05:33
Default
  #7
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by aw241 View Post
By pure chance I had the same issue in the last couple of days, and was able to solve it using "signed false;".

Using "signed false" will then create an envelope at the given distance away from the surface which may not be what you want for many cases. If you have a distance identical to "0", this is really ill-advised since you most definitely need the sign to get the proper cell cuts. As a side-note: if you have a distance of "0", you will normally get a variety of special handling for at the edges of the surface, which you need to avoid having the distance surface become infinitely large, but also to avoid "ragged" edges.


https://develop.openfoam.com/Develop...feebb874d7fae2
olesen is offline   Reply With Quote

Reply

Tags
sampledict, sampling


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ICEM] Problems with coedge curves and surfaces tommymoose ANSYS Meshing & Geometry 6 December 1, 2020 12:12
problems with midPoint set sampling grandgo OpenFOAM Bugs 6 December 13, 2011 10:34
Needed Benchmark Problems for FSI Mechstud Main CFD Forum 4 July 26, 2011 13:13
Some problems with Star CD Micha Siemens 0 August 6, 2003 14:55
unstructured grid sreekanth Main CFD Forum 1 August 6, 2001 16:09


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