CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

FOAM FATAL ERROR: bad size

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 11, 2013, 12:59
Default FOAM FATAL ERROR: bad size
  #1
Member
 
Join Date: May 2012
Posts: 55
Rep Power: 15
styleworker is on a distinguished road
Hello foamers,

I'm playing around with MRconjugateHeatFoam, which is a conjugate heat transfer solver. I was able to modify this solver in a way, such that it can handle two phase flow. Unfortunately after some time steps (depends on the memory), I'll get errors like this:

Code:
--> FOAM FATAL ERROR: 
bad size -1317939304

    From function List<T>::List(const label size)
    in file /opt/openfoam220/src/OpenFOAM/lnInclude/List.C at line 49.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at /opt/openfoam220/src/OSspecific/POSIX/printStack.C:221
#1  Foam::error::abort() at /opt/openfoam220/src/OpenFOAM/lnInclude/error.C:249
#2  Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at /opt/openfoam220/src/OpenFOAM/lnInclude/errorManip.H:85
#3  Foam::List<double>::List(int) at /opt/openfoam220/src/OpenFOAM/lnInclude/List.C:54
#4  Foam::Field<double>::Field(int) at /opt/openfoam220/src/OpenFOAM/lnInclude/Field.C:50
#5  Foam::tmp<Foam::Field<double> > Foam::mag<double>(Foam::UList<double> const&) at /opt/openfoam220/src/OpenFOAM/lnInclude/FieldFunctions.C:180
#6  
 at ~/OpenFOAM/of-2.2.0/applications/solvers/CHTinterDyMFOAM/coupledFvPatchFields/regionCoupleHeatFlux/regionCoupleHeatFluxFvPatchScalarField.C:222
#7  
 at ~/OpenFOAM/of-2.2.0/applications/solvers/CHTinterDyMFOAM/convergenceCheck.H:112
#8  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#9  
 in "/home/willy/OpenFOAM/of-2.2.0/platforms/linux64GccDPDebug/bin/CHTinterDyMFoam"
After checking the error message, I had taken a look at regionCoupleHeatFlux/regionCoupleHeatFluxFvPatchScalarField.C at line 222:
Code:
const Foam::scalar&
Foam::regionCoupleHeatFluxFvPatchScalarField::maxResidual() const
{
    // Calculate interpolated patch flux
    const polyPatch& ownPatch = patch().patch();
    const polyPatch& nbrPatch = coupleManager_.neighbourPatch().patch();
    const fvPatchField<scalar>& Tnbr = coupleManager_.neighbourPatchField<scalar>();

    patchToPatchInterpolation interpolator(nbrPatch, ownPatch);

    scalarField qNbr2own =
        interpolator.faceInterpolate
        (
            refCast<const regionCoupleTemperatureFvPatchScalarField>
            (Tnbr).flux()
        );

    // Lookup transport properties
    const dictionary& transportProperties =
        db().lookupObject<IOdictionary>("transportProperties");

    dictionary phaseSolid(transportProperties.subDict("phaseSolid"));

    dimensionedScalar kS(phaseSolid.lookup("k"));

    // Calculate the maximum normalized residual
    const fvPatchScalarField& Town = *this; //Temperature of own face (Tsolid, if regionCoupleTemperature is set in solid bc)
    const scalarField& qOwn = kS.value()*Town.snGrad();
    const scalar& residual =
        gMax
        (
            mag(mag(qOwn) - mag(qNbr2own))/
            max(min(gMax(mag(qOwn)),gMax(mag(qNbr2own))), SMALL) //line 222
        );

    return residual;
}
The function flux() is defined as:

Code:
//- Return the patch flux
Foam::tmp<Foam::scalarField>
Foam::regionCoupleTemperatureFvPatchScalarField::flux() const
{
    //  Set up access to the thermaly conductivity field and mesh
    const volScalarField& k12 = db().lookupObject<volScalarField>("k12"); //Wird hier auch von runTime gelesen und nicht von dem gespeicherten Zeitordner???
    //const fvMesh& mesh = patch().boundaryMesh().mesh();
        
    //Get ID of local patch in T boundary file (fluid side)
    label patchID = patch().boundaryMesh().findPatchID(patch().name());

    //Get the k-boundaryField with same patch ID (fluid side)
    const fvPatchScalarField& kF = k12.boundaryField()[patchID];

    const fvPatchScalarField& T = *this; //Temperature of own face (Tfluid, if regionCoupleTemperature is set in fluid bc)

    return kF*T.snGrad(); //Fourier's law.
}
It looks like there is some problem with working memory. Maybe it could be due to bad use of pointers? I have to admit, I'm not really familiar with C++ programming and still learning this language.

The relevant source files are attached.
Attached Files
File Type: gz MRconjugateHeatFoam_edit.tar.gz (6.6 KB, 12 views)
styleworker is offline   Reply With Quote

Old   October 14, 2013, 10:05
Default
  #2
Member
 
Join Date: May 2012
Posts: 55
Rep Power: 15
styleworker is on a distinguished road
I could't solve the problem directly, but I was able to run the case without errors, when I'm using a static mesh instead of dynamicFvMesh.
styleworker is offline   Reply With Quote

Old   April 6, 2016, 12:39
Default About the code
  #3
New Member
 
Emanuele
Join Date: Feb 2014
Posts: 4
Rep Power: 12
emateo84 is on a distinguished road
Hi! could you give me please more information concerning the file createFields.H i,m also dealing with a similar problem MR solver + interFoam trying to couple them.
emateo84 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
decomposePar pointfield flying OpenFOAM Running, Solving & CFD 28 December 30, 2013 16:05
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 15:11
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found piprus OpenFOAM Installation 22 February 25, 2010 14:43
gmsh2ToFoam sarajags_89 OpenFOAM 0 November 24, 2009 23:50
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


All times are GMT -4. The time now is 06:04.