CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [waves2Foam] surfaceElevation: "cell does not contain point" (https://www.cfd-online.com/Forums/openfoam-community-contributions/205802-surfaceelevation-cell-does-not-contain-point.html)

arieljeds January 13, 2017 07:55

surfaceElevation: "cell does not contain point"
 
1 Attachment(s)
Hi all -

I have a frustrating problem using the surfaceElevation utility. I use this often without problems with exactly the same locations, same domain size, but I can't seem to figure out what's happening here. Is there a way to view the wave gauge locations using surfaceElevation? I know you can do it using waveGaugesNProbes but I couldn't figure out how to set up my surfaceElevation wave gauges using that.

I'm getting the following error:

Code:

Reading g

Reading waveProperties


--> FOAM FATAL ERROR:
Found cell 1719049 using face 9977105. But cell does not contain point (3.04 3.04 -14.481)

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

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::sampledSet::getCell(int, Foam::Vector<double> const&) const at ??:?
#3  Foam::midPointSet::genSamples() at ??:?
#4  Foam::midPointSet::midPointSet(Foam::word const&, Foam::polyMesh const&, Foam::meshSearch const&, Foam::dictionary const&) at ??:?
#5  Foam::sampledSet::addwordConstructorToTable<Foam::midPointSet>::New(Foam::word const&, Foam::polyMesh const&, Foam::meshSearch const&, Foam::dictionary const&) at ??:?
#6  Foam::sampledSet::New(Foam::word const&, Foam::polyMesh const&, Foam::meshSearch const&, Foam::dictionary const&) at ??:?
#7  void Foam::PtrList<Foam::sampledSet>::read<Foam::sampledSet::iNew>(Foam::Istream&, Foam::sampledSet::iNew const&) at ??:?
#8  Foam::sampledSurfaceElevation::read(Foam::dictionary const&) at ??:?
#9  Foam::sampledSurfaceElevation::sampledSurfaceElevation(Foam::word const&, Foam::objectRegistry const&, Foam::dictionary const&, bool) at ??:?
#10  main at ??:?
#11  __libc_start_main in "/lib64/libc.so.6"
#12  ? at /usr/src/packages/BUILD/glibc-2.11.3/csu/../sysdeps/x86_64/elf/start.S:116
Aborted (core dumped)


I know this has to do with there not being a cell where it's attempting to sample but there should definitely be a cell there?? I want to view where it's trying to sample because I can't figure out why it thinks there's nothing there. I am using 160 wave gauges around a cylinder so this is just a snippet of my surfaceElevationDict:

Code:

setFormat raw;

interpolationScheme cellPoint;

// Fields to sample.
fields
(
    alpha.water
);

sets
(
  loc2_gauge_0
    {
        type        midPoint;
        axis        z;
        start        (4.30 0 -15);
        end          (4.30 0 15);
        nPoints      100;
    }

    loc2_gauge_1
    {
        type        midPoint;
        axis        z;
        start        (3.97 1.65 -15);
        end          (3.97 1.65 15);
        nPoints      100;
    }

    loc2_gauge_2
    {
        type        midPoint;
        axis        z;
        start        (3.04 3.04 -15);
        end          (3.04 3.04 15);
        nPoints      100;
    }

    loc2_gauge_3
    {
        type        midPoint;
        axis        z;
        start        (1.65 3.97 -15);
        end          (1.65 3.97 15);
        nPoints      100;
    }

);

I'm using GMSH here so I'm attaching my log.checkmesh file.

Thanks in advance for any help on this.

Ariel

ngj January 15, 2017 12:58

Good evening.

@Ariel: I am not familiar with this error. I can only recommend you to track down the problem by removing one wave gauge at the time.

Kind regards,

Niels

arieljeds January 19, 2017 06:14

Hi Niels,

Thanks for the reply. Is there some way to set up the waveGaugesNProbes using sets? I have my probes in pretty specific locations and I can't figure out how to do that in probeDefinitions (as in, can I define the sets within this file somehow instead of using some automated distribution?) Or is there a way to view the surfaceElevation probes using surfaceElevationDict (which I know I can do if I run waveGaugesNProbes)?

I tried using userDefinedDistribution but then I got the error:

Code:

"ill defined primitiveEntry starting at keyword 'sets' on line 25...
Thanks again for your help

Ariel


**EDIT** Ok so I have fixed my problem but I still have two queries:

1) I don't understand why it was fixed, the changes I made were something like 5.06966 to 5.07, and this fixed it. I really don't understand how the tiny change would have had such an effect? Also note, I have used the same surfaceElevationDict with a range of simulations with the same computational domain size, although a slightly different mesh resolution (this case is slightly coarser than others)

2) I would still like to find a way to view my wave gauges (create a vtk file with surfaceElevationDict)

arieljeds January 19, 2017 06:16

Quote:

Originally Posted by j91 (Post 633683)
Hi,

I have a question about the size of relaxation zones used in waves2foam. Typically I see recommendations of "about a wavelength" as a recommended length for the inlet zone and outlet zone (each), but why is this the case? What kind of error do you run into if you shrink the relaxation zones to be much smaller, say 50% or 10% or even 1% of a wavelength? How drastic are the effects if you approach the equivalent of a boundary inlet/outlet and try to make a relaxation "zone" just a few cells long? (I think OLAFOAM has a generation system a little like this, although using the boundary itself?)

Thanks in advance for your time. I have looked around in literature but it's difficult to find practicalities like this, especially as people tend to publish what works rather than what breaks.


I found that if you shrink it too much, the wave doesn't get fully absorbed and you will see some reflection. I played around with the mu value (alphaCoefficient in relaxation zone definition) and lowered it to 1 and was able to reduce the relaxation zone to just under 1 wavelength without getting reflection. Hope that helps!

ngj January 19, 2017 15:53

Hi Ariels,

I have no idea of the cause of the error. It is most likely related to the sampling function in your version of OpenFoam. An error similar to the reason that pointInMesh for snappyHexMesh is not allowed on grid lines.

You can automatically create vtk-files, if you use the utility waveGaugesNProbes based on input in constant/probeDefinitions.

Kind regards

Niels

arieljeds January 23, 2017 10:44

Hi Niels,

Thanks for your response. Yes I usually would use the waveGaugesNProbes to view the wave gauges but I could not figure out how to set up the locations of the probes in the same way I'm doing that in my surfaceElevationDict (I don't want them automatically set up). Is there a way to create the vtk file on its own or using surfaceElevation? Or else a better way to set up the probeDefinitions file to specify locations?

Best,
Ariel

ngj January 25, 2017 13:35

Hi Ariel,

There is a method already in waveGaugesNProbes, where you can provide user-defined location. I think it is called userDefinedDistribution instead of lineDistribution. I do not have access to the source code right now, so cannot check, but it should be easy for you.

A VTK-file will be generated, if you use this approach.

Kind regards,

Niels


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