View Issue Details

IDProjectCategoryView StatusLast Update
0003343OpenFOAMBugpublic2019-09-05 09:35
Reporterhandrake0724 Assigned Towill  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSArchOS Version(please specify)
Summary0003343: oldCellCentre calling error when using sets functionObject
DescriptionIn order to monitoring surface elevation in DTBHullMoving case, I have set functionObject in controlDict as follows:

functions
{
    surfaceElevation
    {
        type sets;
        libs ("libsampling.so");
        writeControl timeStep;
        writeInterval 1;

        interpolationScheme cellPointFace;
        setFormat gnuplot;
        fields (alpha.water);
        sets
        (
            gauge0
            {
                type lineUniform; // uniform;
                axis z;
                start (0 -10 -1);
                end (0 -10 1);
                nPoints 100;
            }

        );
    }
}

when the DTCHull case run with interFoam, I met the following error

--> FOAM FATAL ERROR:
Old cell centres have not been stored

    From function virtual const pointField& Foam::polyMesh::oldCellCentres() const
    in file meshes/polyMesh/polyMesh.C at line 1210.


I found that oldCellCentres() member function and oldCellCentresPtr_ memeber variable was introduced since OpenFOAM 7
Also, I found that it looks working if the dynamicFvMesh type is staticFvMesh but it make the above error if dynamicMotionSolverFvMesh.

I could not go further to study the issue but it looks like
   oldCellCentresPtr_ is assigned in movePoints when storeOldCellCentres_ is true.
   but storeOldCellCentres_ is set to true but make error since oldCellCentresPtr_ is empty in oldCellCentres() member function as follows:

const Foam::pointField& Foam::polyMesh::oldCellCentres() const
{
    storeOldCellCentres_ = true;

    if (!moving_)
    {
        return cellCentres();
    }

    if (oldCellCentresPtr_.empty())
    {
        FatalErrorInFunction
            << "Old cell centres have not been stored"
            << exit(FatalError);
    }

    return oldCellCentresPtr_();
}

Please check this issue.
TagsNo tags attached.

Issue History

Date Modified Username Field Change
2019-09-04 12:14 handrake0724 New Issue
2019-09-05 09:35 will Assigned To => will
2019-09-05 09:35 will Status new => resolved
2019-09-05 09:35 will Resolution open => fixed
2019-09-05 09:35 will Fixed in Version => 7
2019-09-05 09:35 will Note Added: 0010707