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

Error using fixedGradient patch

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 7, 2011, 09:32
Post Error using fixedGradient patch
  #1
New Member
 
Join Date: Nov 2010
Posts: 4
Rep Power: 15
sangoi87 is on a distinguished road
Hi everyone,

I'm having troubles with a new solver. I built it without problems, and I ran it on a 2D mesh. For my program to work properly I have to use a fixedGradient patch. It gave me back this error:

*** glibc detected *** double free or corruption (out)

(followed by the usual memory map and backtrace...)

I tried to debug and I found that the error was generated by this instruction in fixedGradientfvPatchField.C:

Field<Type>:perator=
(
this->patchInternalField() + gradient_/this->patch().deltaCoeffs()
);

This command recall the following operator from Field.C (line 653), and generate a memory error.

// This is dodgy stuff, don't try it at home.
Field* fieldPtr = rhs.ptr();
List<Type>::transfer(*fieldPtr);
delete fieldPtr;

I'd like to implement the same command in an alternative way.
Does anyone know if there's a way to change this "dodgy stuff"?

Thanks to all,
Sandro.

Last edited by sangoi87; September 7, 2011 at 12:22. Reason: I changed the post to correct some inaccuracies.
sangoi87 is offline   Reply With Quote

Old   September 8, 2011, 10:14
Default fixedGradient error - update
  #2
New Member
 
Join Date: Nov 2010
Posts: 4
Rep Power: 15
sangoi87 is on a distinguished road
Hi guys,

I've tried to solve my problem and I've discovered that the memory error is ought to this command in the List.C file (line 392):

delete[] this->v_;

The memory address at the end of the "**** glibc detected ****" message is the same pointed by this->v_.
I don't know why but deallocating this memory causes the solver to crash...

Any idea?

Thx
sangoi87 is offline   Reply With Quote

Reply

Tags
fixedgradient, glibc detected, memory corruption

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 04:04
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 04:38
CheckMeshbs errors ivanyao OpenFOAM Running, Solving & CFD 2 March 11, 2009 02:34
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 08:19
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12


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