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/)
-   -   [swak4Foam] error when use swak4foam to calculate the mass flow rate of a cutting plane (https://www.cfd-online.com/Forums/openfoam-community-contributions/192488-error-when-use-swak4foam-calculate-mass-flow-rate-cutting-plane.html)

ozs September 4, 2017 22:52

error when use swak4foam to calculate the mass flow rate of a cutting plane
 
I am new to openfoam and I use swak4foam to calculate the mass flow rate of a internal face, and I use the code in the controlDict as follows:
Code:

massFlowRate
    {
        type        swakExpression;
        valueType    surface;
        surfaceName    interface;
    outputControlMode    outputTime;
    writeStartTime    off;
    surface
    {
        type                      cuttingPlane;
        functionObjectLibs        ("libsampling.so");
        planeType              pointAndNormal;
            pointAndNormalDict
            {
                basePoint      (0 0.01 0);  // Notet that the plane does not match up with the mesh
                normalVector    (0 1 0);
            }
            interpolate        true;

       
    }   
        expression "rho*U & Sf()";
        accumulations (
            sum
        );
        verbose true;
    }

but error happens as follows afer running one timestep:
Code:

--> FOAM FATAL ERROR:
object of type N4Foam10isoSurfaceE is not allocated

    From function const T& Foam::autoPtr<T>::operator()() const
    in file /home/ouzs/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude/autoPtrI.H at line 154.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-2.4.0/src/OSspecific/POSIX/printStack.C:219
#1  Foam::error::abort() at ~/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude/error.C:249
#2  Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at ~/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude/errorManip.H:85 (discriminator 4)
#3  Foam::autoPtr<Foam::isoSurface>::operator()() const at ~/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude/autoPtrI.H:154
#4  Foam::sampledCuttingPlane::surface() const at ~/OpenFOAM/OpenFOAM-2.4.0/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H:180
#5  Foam::sampledCuttingPlane::points() const at ~/OpenFOAM/OpenFOAM-2.4.0/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H:155
#6  Foam::sampledCuttingPlane::print(Foam::Ostream&) const at ~/OpenFOAM/OpenFOAM-2.4.0/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C:467
#7  Foam::operator<<(Foam::Ostream&, Foam::sampledSurface const&) at ~/OpenFOAM/OpenFOAM-2.4.0/src/sampling/sampledSurface/sampledSurface/sampledSurface.C:355
#8  Foam::Ostream& Foam::operator<< <Foam::sampledSurface, Foam::word, Foam::string::hash>(Foam::Ostream&, Foam::HashPtrTable<Foam::sampledSurface, Foam::word, Foam::string::hash> const&) at ~/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude/HashPtrTableIO.C:232
#9  Foam::SurfacesRepository::writeData(Foam::Ostream&) const at ~/OpenFOAM/ouzs-2.4.0/swak4Foam/Libraries/swak4FoamParsers/repositories/SurfacesRepository.C:222
#10  Foam::regIOobject::writeObject(Foam::IOstream::streamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const at ~/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/db/regIOobject/regIOobjectWrite.C:100
#11  Foam::objectRegistry::writeObject(Foam::IOstream::streamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const at ~/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/db/objectRegistry/objectRegistry.C:364
#12  Foam::Time::writeObject(Foam::IOstream::streamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const at ~/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/db/Time/TimeIO.C:518
#13  Foam::regIOobject::write() const at ~/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/db/regIOobject/regIOobjectWrite.C:134
#14  ? at ~/OpenFOAM/OpenFOAM-2.4.0/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C:101
#15  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#16  ? at ??:?
Aborted (core dumped)

so, why the error happens? I am looking forward for your help.

thanks.
Geson


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