CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Sample bugg with midPoint cell interpolationScheme (http://www.cfd-online.com/Forums/openfoam-bugs/81997-sample-bugg-midpoint-cell-interpolationscheme.html)

ubald November 12, 2010 17:11

Sample bugg with midPoint cell interpolationScheme
 
I don't know if its a known bugg I just thought I should report it !!

using
interpolationScheme cell with midPoint for set will bugg with OpenFOAM 1.7.1 in a certain case !

Watt append hear is that the line I chose to sample on append to fit exactly with the faces of my structured mesh.

My 2D test case mesh is 1000m long and 100m high with 300 x 50 cells so at 100m I'm exactly on the face sheared by 30 and 31 column of cell !

the SampleDict is:
Code:

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

surfaceFormat raw;

interpolationScheme cell;

fields         
(
 U
 p
 epsilon
 k
  );
sets
(
 x0
 {
  type    midPoint;
  axis    z;
  start  ( 0 0 100);
  end    ( 0 0 0 );
 }
 x100
 {
  type    midPoint;
  axis    z;
  start  ( 100 0 100);
  end    ( 100 0 0 );
  }
);

The error is :

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 1.7.1-03e7e056c215
Exec  : sample -time 20000
Date  : Nov 12 2010
Time  : 15:40:56
Host  : ubi
PID    : 26371
Case  : /home/niko/OpenFOAM/niko-1.7.1/run/AEMN/case/ABL/ABLzMesh
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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

Create mesh for time = 20000



--> FOAM FATAL ERROR:
Found cell 14730 using face 60080. But cell does not contain point (100 1.27012e-14 98.1575)

    From function sampledSet::getCell(const label, const point&)
    in file sampledSet/sampledSet/sampledSet.C at line 75.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/home/niko/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccSPOpt/libOpenFOAM.so"
#1  Foam::error::abort() in "/home/niko/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccSPOpt/libOpenFOAM.so"
#2  Foam::sampledSet::getCell(int, Foam::Vector<float> const&) const in "/home/niko/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccSPOpt/libsampling.so"
#3  Foam::midPointSet::genSamples() in "/home/niko/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccSPOpt/libsampling.so"
#4  Foam::midPointSet::midPointSet(Foam::word const&, Foam::polyMesh const&, Foam::meshSearch&, Foam::dictionary const&) in "/home/niko/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccSPOpt/libsampling.so"
#5  Foam::sampledSet::addwordConstructorToTable<Foam::midPointSet>::New(Foam::word const&, Foam::polyMesh const&, Foam::meshSearch&, Foam::dictionary const&) in "/home/niko/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccSPOpt/libsampling.so"
#6  Foam::sampledSet::New(Foam::word const&, Foam::polyMesh const&, Foam::meshSearch&, Foam::dictionary const&) in "/home/niko/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccSPOpt/libsampling.so"
#7  void Foam::PtrList<Foam::sampledSet>::read<Foam::sampledSet::iNew>(Foam::Istream&, Foam::sampledSet::iNew const&) in "/home/niko/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccSPOpt/libsampling.so"
#8  Foam::sampledSets::read(Foam::dictionary const&) in "/home/niko/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccSPOpt/libsampling.so"
#9  Foam::sampledSets::sampledSets(Foam::word const&, Foam::objectRegistry const&, Foam::dictionary const&, bool) in "/home/niko/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccSPOpt/libsampling.so"
#10 
 at sample.C:0
#11 
 in "/home/niko/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccSPOpt/sample"
#12  __libc_start_main in "/lib/libc.so.6"
#13 
 in "/home/niko/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccSPOpt/sample"
Abandon

If I run the same sampleDict with:

Code:

x100
 {
  type    midPoint;
  axis    z;
  start  ( 101 0 100);
  end    ( 101 0 0 );
  }

no error and every thing is great !

Hope it help to get this wonderfully well programmed C++ library, OpenFOAM, even better.

As now I have no clue on how this bugg could be fixed. :)

Happy openfoaming to every one !

Nicolas Lussier

Nicole November 29, 2015 07:49

Hi Nicolas,

I see your post is quite old, but I just came across the same thing, did you ever manage to figure this out?

I cannot see how you fixed it - it looks like you just used a different sample line location?

ubald November 30, 2015 12:29

No modification of code !
 
I did not look in to the code to try to fix this i just use an other location as you just said. It is possible o just use a tiny distence differnce ant this will work. In my experience this problem is only with midpoints. So unless you want to fix this isue in the C++ code I would advice you tdo like me and add 0.001 or an other small number to all location so the line you want data from crosses som faces cells.


All times are GMT -4. The time now is 16:20.