CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   volPointInterpolation error (https://www.cfd-online.com/Forums/openfoam-programming-development/226851-volpointinterpolation-error.html)

kk415 May 10, 2020 00:51

volPointInterpolation error
 
Hello All,

I am trying to interpolate the interface vector in my two phase flow solver (CLSVOF by chalmers group) by volPointInterpolation.

My code:
Code:

{
// calculate normal vector
gradPsi == fvc::grad(psi);
volPointInterpolation vpi(mesh); //error is coming in this line
pointVectorField pointn1 = vpi.interpolate(gradPsi);
forAll(mesh.cells() , idCell){
gradPsi[idCell] = interpolatePointToCell(pointn1, idCell);}
}

The issue I am facing is strange. The code works well for a square domain mesh (8D*8D*8D) but not for a rectangular mesh (15D*8D*8D). My blockMesh file is this

Code:

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

convertToMeters 3.1e-3;

vertices
(
    (0 0 0)
    (15 0 0)
    (15 8 0)
    (0 8 0)
    (0 0 8)
    (15 0 8)
    (15 8 8)
    (0 8 8)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (200 125 125)
    simpleGrading
    (
        (
        (0.4 0.125 0.125)
        (0.2 0.75 1)
        (0.4 0.125 8)
        )

        (
        (0.375 0.1 0.125)
        (0.25 0.8 1)
        (0.375 0.1 8)
        )

        (
        (0.375 0.1 0.125)
        (0.25 0.8 1)
        (0.375 0.1 8)
        )
    )
);

edges
(
);

boundary
(
  bottom
    {
        type patch;
        faces
        (
            (1 5 4 0)
        );
    }
    top
    {
        type patch;
        faces
        (
            (3 7 6 2)
        );
    }
    left
    {
        type patch;
        faces
        (
            (0 4 7 3)
        );
    }
    right
    {
        type patch;
        faces
        (
            (2 6 5 1)
        );
    }
    front
    {
        type patch;
        faces
        (
            (3 2 1 0)
        );
    }

    back
    {
        type patch;
        faces
        (
            (6 7 4 5)
        );
    }

);
mergePatchPairs
(
);

// ************************************************************************* //

The error message looks like this
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigSegv::sigHandler(int) at ??:?
#2 ? at sigaction.c:?
#3 Foam::volPointInterpolation::makeInternalWeights(F oam::Field<double>&) at ??:?
#4 Foam::volPointInterpolation::makeWeights() at ??:?
#5 Foam::volPointInterpolation::volPointInterpolation (Foam::fvMesh const&) at ??:?
#6 ? at ??:?
#7 __libc_start_main at ??:?
#8 ? at ??:?
Segmentation fault (core dumped)

Any help is deeply appreciated.

kk415 May 16, 2020 08:53

The mesh is a dynamic Mesh and it seems that is the root cause for the error. How should I modify my code for this?


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