CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

fatal error during initialization after udf compilation

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 26, 2012, 05:30
Default fatal error during initialization after udf compilation
  #1
rik
New Member
 
Join Date: Jan 2012
Posts: 5
Rep Power: 5
rik is on a distinguished road
Hi all,

I have write an UDF to copy wall temperature of semi-cylinder to another.
When I want to initialize, Fluent send me fatal error, see belows :
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()


My Udf :

#include "udf.h"
#include "config.h"
DEFINE_PROFILE(temp_profil,thread,index)
{
real x[3]; /*vecteur position*/
real x1[3]; /*vecteur translaté*/
Domain *domain15=Get_Domain(15);
Domain *domain14=Get_Domain(14);
face_t f;
Thread *t0;
int Zone_ID14=14;
int Zone_ID15=15;
face_t f1;
face_t f2;

begin_f_loop(f,thread) /*boucle sur les faces des mailles*/
{
F_CENTROID(x,f,thread); /*accès aux coordonnées du centre de la face*/

if (x[1]>=244.12)
{
t0=Lookup_Thread(domain15,Zone_ID15);
begin_f_loop(f1,t0) /*boucle sur les faces des mailles*/
{
F_CENTROID(x1,f1,t0);
if (x1[0]==x[0])
{
if (x1[2]==x[2])
{
F_PROFILE(f,thread,index)=F_T(f1,t0);
}
}
}
end_f_loop(f1,t0)
}
if (x[1]<244.12)
{
t0=Lookup_Thread(domain14,Zone_ID14);
begin_f_loop(f2,t0) /*boucle sur les faces des mailles*/
{
F_CENTROID(x1,f2,t0);
if (x1[1]==x[1])
{
if (x1[2]==x[2])
{
F_PROFILE(f,thread,index)=F_T(f2,t0);
}
}
}
end_f_loop(f2,t0)
}
/*accès aux coordonnées du centre de la face translatée de -47mm /!\ Problème peut venir de l'unité*/
/*accès à la température de la face translatée*/
/*F_PROFILE(f1,tread,index) /*accès au profile de température de la face translatée*/
}
end_f_loop(f,thread) /*fin de la boucle*/
}


Does anybody know which mistake can lead to this error?

Thanks a lot in advance.




rik is offline   Reply With Quote

Old   January 26, 2012, 15:36
Default
  #2
Member
 
David Stanbridge
Join Date: Apr 2010
Location: Norwich, UK
Posts: 58
Rep Power: 7
swiftaircraft is on a distinguished road
Are you inititializing with Fluent running in Parallel mode or serial?
swiftaircraft is offline   Reply With Quote

Old   January 26, 2012, 18:01
Default
  #3
Member
 
Join Date: Nov 2011
Location: Czech Republic
Posts: 95
Rep Power: 5
Sixkillers is on a distinguished road
My compiler (gcc) noticed only nested comments at the end of the file. However I have suspicion that you are using macro Get_Domain wrong way. There is always only one domain for single phase flows. You should definitely check out UDF manual to understand its concept. Generally speaking don't be shame to try if your UDF is working in the middle of development of it. It is much easier to find a bug in the early stage than your code become more complex.
Sixkillers is offline   Reply With Quote

Old   January 27, 2012, 03:56
Default
  #4
rik
New Member
 
Join Date: Jan 2012
Posts: 5
Rep Power: 5
rik is on a distinguished road
@ swiftaircraft:
I've compiled my udf , and there's two way,
1_If I first put the udf boundary condition, the error appears when i want to initialize
2_If I initialize before the compilation of the udf, the error comes when I put the boundary condition...
I hope this will answer to your question.

@ Sixkillers:
Sorry but I'm not fluent with C++ code. What should I have to do?

Thanks for your support.
rik is offline   Reply With Quote

Old   January 29, 2012, 06:58
Default
  #5
Member
 
Join Date: Nov 2011
Location: Czech Republic
Posts: 95
Rep Power: 5
Sixkillers is on a distinguished road
As I mentioned before if you are doing single-phase simulation there is only 1 domain. So you will have to change your code:

PHP Code:
Domain *domain15=Get_Domain(15);
Domain *domain14=Get_Domain(14); 
to:

PHP Code:
Domain *domain=Get_Domain(1); 
Moreover I would commented out most of your code and load it into Fluent to ensure that it is working and then add several new lines and repeat it again. The following approach should help you to isolate piece of code which is failing. In addition don't hesitate to consult Fluent's UDF guide.
Sixkillers is offline   Reply With Quote

Old   January 30, 2012, 11:57
Default
  #6
rik
New Member
 
Join Date: Jan 2012
Posts: 5
Rep Power: 5
rik is on a distinguished road
I understand what you are talking about, I've seen that in the Fluent's UDF guide, but Get_Domain(1) will return the fluid domain pointer, and I've to point on a specfic wall. Can I do that ?

Because my goal is to copy temperature from a wall to another, so how could I do that?

Thanks a lot for the help.
rik is offline   Reply With Quote

Old   October 16, 2013, 18:09
Default Fluent initialization peoblem
  #7
New Member
 
Join Date: Apr 2012
Posts: 19
Rep Power: 5
MultiphaseFlowsLab is on a distinguished road
I have written a UDF, and I have complied it and did couple of runs. but now, when I compile it for the same case, it is not initialized and Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: #f

appears. but if I read my old data file, with the exactly the same UDF and case file, it works without any issue.
could someone help me ?
MultiphaseFlowsLab is offline   Reply With Quote

Old   October 17, 2013, 03:01
Default
  #8
New Member
 
kornetka's Avatar
 
Join Date: Jun 2013
Posts: 15
Rep Power: 4
kornetka is on a distinguished road
Hi
I am not sure it will help, but please try doing this: Change the code so that first you declare all variables and only after that you assign values to them.
kornetka is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF compilation error Szabolcs Varga Fluent UDF and Scheme Programming 3 April 11, 2015 13:49
UDF compilation problem -- "undeclared variable" Henrik Ström FLUENT 1 September 21, 2005 05:25
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16
UDF initialization Sam FLUENT 1 May 21, 2002 08:23
Compiled UDF / Compilation problem mikhail FLUENT 1 October 13, 2000 06:12


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