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

Temporary deallocated error

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 8 Post By TDidi
  • 1 Post By Friederike

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 10, 2009, 10:35
Default hi everyone: i modify the tur
  #1
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
hi everyone:
i modify the turboFoam to add coriolis force and centrifugal force according to MRFsimpleFoam. and when i run the code it gives errors like:

temporary deallocated

From function T& tmp<t>::operator()()
in file /home/waynezw0618/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/tmpI.H at line 164.

FOAM aborting

what is the problem? how can i resolve it?
--------------------code-------------------------
\*---------------------------------------------------------------------------*/

#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "incompressible/RASModel/RASModel.H"
#include "MRFZones.H"
#include "IFstream.H"
#include "OFstream.H"

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

int main(int argc, char *argv[])
{

# include "setRootCase.H"

# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
//# include "createAverages.H"
# include "initContinuityErrs.H"

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

Info<< "\nStarting time loop\n" << endl;

for (runTime++; !runTime.end(); runTime++)
{
Info<< "Time = " << runTime.timeName() << nl << endl;

# include "readPISOControls.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"

// Pressure-velocity PISO corrector
{
// Momentum predictor

tmp<fvvectormatrix> UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U)
);
mrfZones.addCoriolis(UEqn());
UEqn().relax();

solve(UEqn == -fvc::grad(p));

// --- PISO loop

for (int corr=0; corr<nCorr; corr++)
{
volScalarField rAU = 1.0/UEqn().A();
U = rAU*UEqn().H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi);
mrfZones.relativeFlux(phi);
adjustPhi(phi, U, p);

// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
// Pressure corrector

fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
);

pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();

if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}

# include "continuityErrs.H"

U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();
}
}

turbulence->correct();

//# include "calculateAverages.H"

runTime.write();

//# include "writeNaveragingSteps.H"

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}

Info<< "End\n" << endl;

return(0);
}


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

wayne
waynezw0618 is offline   Reply With Quote

Old   July 31, 2010, 04:05
Default
  #2
New Member
 
Robert
Join Date: Mar 2010
Posts: 16
Rep Power: 16
rob3rt is on a distinguished road
Dear Wayne,

I am having a similar "temporary deallocated" problem like you had but only I'm using different solver.

How did you resolve that problem?

Kind Regards,
Robert.
rob3rt is offline   Reply With Quote

Old   June 6, 2011, 04:58
Default
  #3
New Member
 
Dima Risch
Join Date: Jun 2011
Location: Cologne
Posts: 22
Rep Power: 14
dima is on a distinguished road
hallo foamers, i am new to openfoam
got advanced knowlage in C, basic knowlage in C++ and basic knowlage in fluiddynamics

current i am modifying the rhoPisoaFoam (transient) solver, by implementing a porousZone like in rhoPorousSimpleFoam (steadystate)

source code is modified, mesh is modified(porouseZone in pitzDaily), porousZones file is included

partially it works, but with the following setting an error occurs
nUCorrectors 2; => sets pressureImplicitPorosity = true;

i located the error to the "+ fvc::ddtPhiCorr(trAU, rho, U, phi)" part of

phi =
fvc::interpolate(rho)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(trAU, rho, U, phi)
);

what is wrong, how could i resolve this error?

i thought about to do something like

if (pressureImplicitPorosity)
{
phi =
fvc::interpolate(rho)
*(
(fvc::interpolate(U) & mesh.Sf())
);
}
else
{
phi =
fvc::interpolate(rho)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(trAU, rho, U, phi)
);
}

but is it correct in refer to the phi equation? its just a (transient) Corrector term, isn't it?


error message:

Create time

Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo <hConstThermo<perfectGas>>>>>
Reading field rho


Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
C3 -0.33;
sigmak 1;
sigmaEps 1.3;
Prt 1;
}

Creating field DpDt

Creating porous zone: porosity
Courant Number mean: 0 max: 0.126355

Starting time loop

Courant Number mean: 0 max: 0.126355
Time = 1e-05

diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for h, Initial residual = 0.55759, Final residual = 7.51342e-05, No Iterations 1


--> FOAM FATAL ERROR:
temporary deallocated

From function const T& tmp<T>:perator()() const
in file /home/dima/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/tmpI.H at line 187.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) in "/home/dima/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/dima/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >:perator()() const in "/home/dima/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/rhoPorousPisoFoam"
#3
in "/home/dima/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/rhoPorousPisoFoam"
#4 __libc_start_main in "/lib64/libc.so.6"
#5
at /usr/src/packages/BUILD/glibc-2.11.2/csu/../sysdeps/x86_64/elf/start.S:116
*/################################################## ###############################################/*

i'm sorry for my not very good english , hope you could understand what i mean
i would be thankful for any kind of reply

with kind regards
Dima
dima is offline   Reply With Quote

Old   June 16, 2011, 12:46
Default
  #4
Member
 
Robert Ong
Join Date: Aug 2010
Posts: 86
Rep Power: 15
rob3rt 0ng is on a distinguished road
Hi Dima,

I think you should decrease both nOuterCorrectors and nCorrectors in system/fvSolution to 1.

Regards,
Robert
rob3rt 0ng is offline   Reply With Quote

Old   June 17, 2011, 05:09
Default
  #5
New Member
 
Dima Risch
Join Date: Jun 2011
Location: Cologne
Posts: 22
Rep Power: 14
dima is on a distinguished road
Hi Robert,
thank you for reply

i try the settings you suggested, but same error occurs

meanwhile i was advised of the rhoPorousMRFPimpleFoam (transient)
and there the above processes term is
set off in OF-1.7.1

Code:
    phi =
        fvc::interpolate(rho)*
        (
            (fvc::interpolate(U) & mesh.Sf())
        //+ fvc::ddtPhiCorr(rUA, rho, U, phi)
        );
and set on in OF-2.0.0

Code:
    phi =
        fvc::interpolate(rho)*
        (
            (fvc::interpolate(U) & mesh.Sf())
          + fvc::ddtPhiCorr(rAU, rho, U, phi)
        );
so i will take a look to the new version

regards, Dima
dima is offline   Reply With Quote

Old   January 12, 2012, 11:06
Default
  #6
New Member
 
Taieb
Join Date: Nov 2011
Location: Germany
Posts: 1
Rep Power: 0
TDidi is on a distinguished road
I had the same problem with the error message: "temporary deallocated" after creating a new turbulent solver.

The problem was missing parenthesis after UEqn for the fvVectorMatrix. So I changed "UEqn" to "UEqn()". Hope it challenges your problem, too.
linch, alquimista, Tobi and 5 others like this.

Last edited by TDidi; January 12, 2012 at 16:39.
TDidi is offline   Reply With Quote

Old   April 29, 2014, 09:24
Default
  #7
New Member
 
Join Date: Nov 2010
Posts: 10
Rep Power: 15
Friederike is on a distinguished road
Thank you so much, Taieb! You saved me a lot of searching and trouble
adkar likes this.
Friederike is offline   Reply With Quote

Old   May 13, 2016, 03:40
Default
  #8
New Member
 
Adkar
Join Date: Apr 2015
Posts: 18
Rep Power: 11
adkar is on a distinguished road
Quote:
Originally Posted by TDidi View Post
I had the same problem with the error message: "temporary deallocated" after creating a new turbulent solver.

The problem was missing parenthesis after UEqn for the fvVectorMatrix. So I changed "UEqn" to "UEqn()". Hope it challenges your problem, too.
Thank you so much for your comment!!!
You saved my day!! I really appreciate your comment
Thank you once again.
adkar is offline   Reply With Quote

Old   January 21, 2020, 11:38
Default
  #9
New Member
 
Kumar Pushpak
Join Date: Apr 2019
Posts: 9
Rep Power: 7
khool_chelsea is on a distinguished road
Where do we have to edit?
khool_chelsea is offline   Reply With Quote

Old   January 11, 2022, 09:20
Default
  #10
New Member
 
Join Date: Dec 2021
Posts: 27
Rep Power: 4
finn_amann is on a distinguished road
Hello Foamers!

I'd like to revive this thread with another question about a similar error, because I don't really understand the answers that were given.

IMPORTANT: I am using OpenFOAM v9

In order to narrow down the problem, I added some code to the icoFoam solver that I debugged to find the exact line of code which threw the following error:

Code:
--> FOAM FATAL ERROR: 
tmp<N4Foam14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEEE> deallocated

    From function const T& Foam::tmp<T>::operator()() const [with T = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
    in file /home/finnamann/OpenFOAM/OpenFOAM-9/src/OpenFOAM/lnInclude/tmpI.H at line 285.

FOAM aborting
This error is produced by the following lines of code that I added inside the PISO-loop:

Code:
while (piso.correct())
  {
            
    tmp<volScalarField> iAmTemp;
    iAmTemp = UEqn.A(); // UEqn is velocity eq. in icoFoam
    volScalarField numberOne  = iAmTemp; 
    volScalarField numberTwo  = iAmTemp;

    // ... rest of the piso-loop
The error is thrown when iAmTemp is assigned to numberTwo.

A workaround is to use the overloaded operator() on the initialisation of numberOne:

Code:
while (piso.correct())
  {
            
    tmp<volScalarField> iAmTemp;
    iAmTemp = UEqn.A(); 
    volScalarField numberOne  = iAmTemp(); 
    volScalarField numberTwo  = iAmTemp; 

    // ... rest of the piso-loop
It seems that the error is pointer related. iAmTemp doesn't seem to point to the correct data after it has been used once.
Is someone able to explain this to me properly and correct any wrong assumptions I made?

I also know that UEqn.A() returns a tmp object as well. When I assign a standard volScalarField like the temperature T to iAmTemp like this:

Code:
while (piso.correct())
  {
            
    tmp<volScalarField> iAmTemp;
    iAmTemp = T; 
    volScalarField numberOne  = iAmTemp; 
    volScalarField numberTwo  = iAmTemp; 

    // ... rest of the piso-loop
... then the error does not occur.



Any clarification would be appreciated.
finn_amann is offline   Reply With Quote

Old   May 24, 2022, 04:37
Default
  #11
Member
 
hari charan
Join Date: Sep 2021
Location: India,hyderabad
Posts: 96
Rep Power: 4
saicharan662000@gmail.com is on a distinguished road
Hi finn,
Did you solve your problem?I am facing the same error
Thanks in advance
saicharan662000@gmail.com is offline   Reply With Quote

Old   May 24, 2022, 04:58
Default
  #12
New Member
 
Join Date: Dec 2021
Posts: 27
Rep Power: 4
finn_amann is on a distinguished road
Unforturnately I don't really remember what I was trying to do there. I think it just has something to do with the way temporaries work in OpenFOAM.

This should probably help understand temporaries:
https://openfoamwiki.net/index.php/OpenFOAM_guide/tmp
finn_amann is offline   Reply With Quote

Old   May 24, 2022, 05:44
Default
  #13
Member
 
hari charan
Join Date: Sep 2021
Location: India,hyderabad
Posts: 96
Rep Power: 4
saicharan662000@gmail.com is on a distinguished road
Hi finn,
I have seen that link already, Can you or anyone look into this error and suggest me whats wrong?
I am attaching solver files that are edited to this post





Code:
--> FOAM FATAL ERROR: 
tmp<N4Foam14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEEE> deallocated

    From function const T& Foam::tmp<T>::operator()() const [with T = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
    in file /opt/openfoam8/src/OpenFOAM/lnInclude/tmpI.H at line 278.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  ? in "/home/hari/OpenFOAM/hari-8/platforms/linux64GccDPInt32Opt/bin/interPhaseChangeFoam_6"
#3  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >::operator()() const in "/home/hari/OpenFOAM/hari-8/platforms/linux64GccDPInt32Opt/bin/interPhaseChangeFoam_6"
#4  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator*<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) in "/home/hari/OpenFOAM/hari-8/platforms/linux64GccDPInt32Opt/bin/interPhaseChangeFoam_6"
#5  Foam::phaseChangeTwoPhaseMixture::vDotP() const at ??:?
#6  ? in "/home/hari/OpenFOAM/hari-8/platforms/linux64GccDPInt32Opt/bin/interPhaseChangeFoam_6"
#7  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#8  ? in "/home/hari/OpenFOAM/hari-8/platforms/linux64GccDPInt32Opt/bin/interPhaseChangeFoam_6"
Aborted (core dumped)
Attached Files
File Type: zip mixture models.zip (8.7 KB, 3 views)
File Type: h pEqn.H (2.0 KB, 3 views)
File Type: h alphaEqn.H (2.9 KB, 2 views)
saicharan662000@gmail.com 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
[Gmsh] GmshToFoam FOAM FATAL ERROR faces deallocated Tobias Prousa (Prousa) OpenFOAM Meshing & Mesh Conversion 14 January 31, 2012 10:45
ran out of temporary space Al Mazdeh CFX 1 May 27, 2011 09:09
Opening Vs outlet BCs and temporary wall issue Sam CFX 0 January 16, 2008 18:59
[Commercial meshers] FOAM FATAL ERROR points deallocated hoerl OpenFOAM Meshing & Mesh Conversion 0 October 30, 2006 07:47
temporary files won't go to $TMPDIR Jiaying Xu Siemens 4 November 27, 2001 05:11


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