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

How to remove the error:FLUENT received a fatal signal (SEGMENTATION VIOLATION).

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Bruno Machado

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 20, 2009, 06:31
Default How to remove the error:FLUENT received a fatal signal (SEGMENTATION VIOLATION).
  #1
New Member
 
gnxie
Join Date: Mar 2009
Location: Sweden
Posts: 16
Rep Power: 17
Conan is on a distinguished road
Send a message via MSN to Conan
Everytime when I am post-handling data, the message will be happened after I click any button:

Error: FLUENT received a fatal signal (SEGMENTATION VIOLATION).
Error Object: ()

How to remove/repair the error? Thanks.
Conan is offline   Reply With Quote

Old   March 20, 2009, 14:51
Default
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 225
Rep Power: 18
paka is on a distinguished road
That's what sometimes happens on machines with Windows system. I guess there problem in memory handling. Because I used to use Windows on my Mac, that was the most probable reason, not enough memory for my Windows partition. The way I used to do it was to relaunch it couple times or just reboot Windows.

Someone here sometime ago advised to run Fluent with -serv option, which means, run Fluent from command line such as:

fluent 2ddp -serv

if it doesn't help try to run with -driver option and select appropriate driver.

Krst
paka is offline   Reply With Quote

Old   August 9, 2015, 06:21
Default
  #3
Member
 
zduno
Join Date: Dec 2013
Posts: 55
Rep Power: 13
zdunol is on a distinguished road
Hello,

could it be somehow related to having two fluid zones, or shadow wall boundary? I'm asking because I solved a case where I used udf file and everything was fine and now I changed the mesh so I have two fluid parts and interface between them and when I run calculations now I get: Error: FLUENT received a fatal signal (SEGMENTATION VIOLATION).
Error Object: ()
zdunol is offline   Reply With Quote

Old   August 10, 2015, 13:28
Default
  #4
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,762
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Sometimes it can be caused by a udf that is designed for serial mode but crashes when you run Fluent in parallel because the udf is not compatible with parallel variables. Try running in serial mode to see if you no longer get segmentation faults.
LuckyTran is offline   Reply With Quote

Old   August 11, 2015, 06:30
Default
  #5
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
If you are using UDF, this is probably because your UDF is trying to access some information that is not available. For example: you can not access gradients in the first iteration, so you need to add a line to avoid this problem.

Check your variables if they are all initialized in your code and if you properly defined all UDM/UDS in your case.
alinik and antoinetonee like this.
Bruno Machado is offline   Reply With Quote

Old   November 26, 2015, 07:28
Post fatal error
  #6
New Member
 
angela huang
Join Date: Nov 2015
Posts: 6
Rep Power: 11
Turbo_hrf is on a distinguished road
hi, I have written a UDF about standard ke turbulence model and compiled successfully, but when i try initialize, it shows error: received a fatal signal (segmentation fault), does anyone help me remove this error?

my UDF code as follows:
#include "udf.h"
/*#include "math.h"*/

/* Turbulence model constants */
const real C1e=1.44;
const real C2e=1.92;
const real C_mu=0.09;
const real SIG_k=1.0;
const real SIG_e=1.3;

/* User-defined scalars */
enum
{
TK,
TE,
N_REQUIRED_UDS
};

/*Define source term in k equation */
DEFINE_SOURCE(TK_SOURCE, c, t, dS, eqn)
{
real source;

dS[eqn]=0.0;
source= C_MU_T(c,t)*C_STRAIN_RATE_MAG(c,t)*C_STRAIN_RATE_M AG(c,t)-C_R(c,t)*C_R(c,t)*C_mu*C_UDSI(c,t,TK)*C_UDSI(c,t,T K)/C_MU_T(c,t);

return source;
}

/* define source term in eplison equation */
DEFINE_SOURCE(TE_SOURCE, c, t, dS, eqn)
{
real source, Pk;

Pk=C_MU_T(c,t)*C_STRAIN_RATE_MAG(c,t)*C_STRAIN_RAT E_MAG(c,t);
dS[eqn]=0.0;
source=C1e*C_UDSI(c,t,TE)*Pk/C_UDSI(c,t,TK)-C2e*C_R(c,t)*C_UDSI(c,t,TE)*C_UDSI(c,t,TE)/C_UDSI(c,t,TK);

return source;
}

/* define diffusion coefficienct */
DEFINE_DIFFUSIVITY(KE_diffusivity,c,t,i)
{
real diff;
real mu_t;
int nscalar=i;

mu_t=C_R(c,t)*C_mu*C_UDSI(c,t,TK)*C_UDSI(c,t,TK)/C_UDSI(c,t,TE);
if (nscalar==TK)
diff= mu_t/SIG_k + C_MU_L(c,t);
else
diff = mu_t/SIG_e + C_MU_L(c,t);
return diff;
}

/*define turbulent viscosity */
DEFINE_TURBULENT_VISCOSITY(turbVis,c,t)
{
real mu_t;
mu_t=C_R(c,t)*C_mu*C_UDSI(c,t,TK)*C_UDSI(c,t,TK)/C_UDSI(c,t,TE);
return mu_t;
}
Turbo_hrf is offline   Reply With Quote

Old   November 3, 2016, 14:49
Default
  #7
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 18
alinik is on a distinguished road
Hi Angela,

Did you find any solution to this problem?


Quote:
Originally Posted by Turbo_hrf View Post
hi, I have written a UDF about standard ke turbulence model and compiled successfully, but when i try initialize, it shows error: received a fatal signal (segmentation fault), does anyone help me remove this error?

my UDF code as follows:
#include "udf.h"
/*#include "math.h"*/

/* Turbulence model constants */
const real C1e=1.44;
const real C2e=1.92;
const real C_mu=0.09;
const real SIG_k=1.0;
const real SIG_e=1.3;

/* User-defined scalars */
enum
{
TK,
TE,
N_REQUIRED_UDS
};

/*Define source term in k equation */
DEFINE_SOURCE(TK_SOURCE, c, t, dS, eqn)
{
real source;

dS[eqn]=0.0;
source= C_MU_T(c,t)*C_STRAIN_RATE_MAG(c,t)*C_STRAIN_RATE_M AG(c,t)-C_R(c,t)*C_R(c,t)*C_mu*C_UDSI(c,t,TK)*C_UDSI(c,t,T K)/C_MU_T(c,t);

return source;
}

/* define source term in eplison equation */
DEFINE_SOURCE(TE_SOURCE, c, t, dS, eqn)
{
real source, Pk;

Pk=C_MU_T(c,t)*C_STRAIN_RATE_MAG(c,t)*C_STRAIN_RAT E_MAG(c,t);
dS[eqn]=0.0;
source=C1e*C_UDSI(c,t,TE)*Pk/C_UDSI(c,t,TK)-C2e*C_R(c,t)*C_UDSI(c,t,TE)*C_UDSI(c,t,TE)/C_UDSI(c,t,TK);

return source;
}

/* define diffusion coefficienct */
DEFINE_DIFFUSIVITY(KE_diffusivity,c,t,i)
{
real diff;
real mu_t;
int nscalar=i;

mu_t=C_R(c,t)*C_mu*C_UDSI(c,t,TK)*C_UDSI(c,t,TK)/C_UDSI(c,t,TE);
if (nscalar==TK)
diff= mu_t/SIG_k + C_MU_L(c,t);
else
diff = mu_t/SIG_e + C_MU_L(c,t);
return diff;
}

/*define turbulent viscosity */
DEFINE_TURBULENT_VISCOSITY(turbVis,c,t)
{
real mu_t;
mu_t=C_R(c,t)*C_mu*C_UDSI(c,t,TK)*C_UDSI(c,t,TK)/C_UDSI(c,t,TE);
return mu_t;
}
alinik is offline   Reply With Quote

Old   November 3, 2016, 22:35
Default
  #8
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 18
alinik is on a distinguished road
Hi Bruno,

I have gradient of a user defined scalar(C_UDSI_G) in my UDF and I am receiving the segmentation violation error. I am suspecting that this might be the issue. I have initialized the two UDS that I have in my UDF with the hope that I do not get that error again but apparently it did not work. Fluent does not allow me to initialize the gradient (C_UDSI_G). You said by adding a line we can find a solution. Can you please say how?

Thanks,

Ali

Quote:
Originally Posted by Bruno Machado View Post
If you are using UDF, this is probably because your UDF is trying to access some information that is not available. For example: you can not access gradients in the first iteration, so you need to add a line to avoid this problem.

Check your variables if they are all initialized in your code and if you properly defined all UDM/UDS in your case.
alinik is offline   Reply With Quote

Old   November 5, 2016, 16:55
Default
  #9
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 18
alinik is on a distinguished road
Thanks for your repsonse but I am pretty sure that it is not a graphic card issue. It has to be related to the way the parameters are stored in the code.
alinik is offline   Reply With Quote

Old   December 20, 2019, 13:31
Default gradient calculation, C_UDSI_G, segmentation fault
  #10
Member
 
Join Date: Dec 2009
Location: Kanpur, India
Posts: 54
Rep Power: 17
Shoonya is on a distinguished road
Quote:
Originally Posted by alinik View Post
Hi Bruno,

I have gradient of a user defined scalar(C_UDSI_G) in my UDF and I am receiving the segmentation violation error. I am suspecting that this might be the issue. I have initialized the two UDS that I have in my UDF with the hope that I do not get that error again but apparently it did not work. Fluent does not allow me to initialize the gradient (C_UDSI_G). You said by adding a line we can find a solution. Can you please say how?

Thanks,

Ali
I also was facing the same issue of UDSI_G causing segmentation fault. This error is coming because C_UDSI_G(c,t,0) used in UDF is not initialized. To do so following way of writing the code would solve the segmentation fault error:


DEFINE_ADJUST(adjust_sources,d)
{
Thread *t;
cell_t c;

real grad1,grad2;



/*==========================================
*ADD THE FOLLOWING TWO RED lines below "if condition" PART AND

THIS PLACE AND IT WILL SOLVE THE PROBLEM
*=========================================*/
if (NULL != THREAD_STORAGE(t,SV_UDS_I(0) ) &&
NULL != T_STORAGE_R_NV(t,SV_UDSI_G(0)))




thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
/* now here you can use C_UDSI_G as below*/

grad1 = C_UDSI_G(c,t,0)[0];
grad2 = C_UDSI_G(c,t,0)[1];

------
------ so on



}
}
see this also
https://www.afs.enea.it/project/nept...df/node247.htm


Best Wishes

Last edited by Shoonya; December 20, 2019 at 13:40. Reason: forgot to add useful link
Shoonya 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
FLUENT received fatal signal (ACCESS_VIOLATION) shashikant FLUENT 3 November 29, 2014 13:03
FLUENT received fatal signal (ACCESS_VIOLATION) samy FLUENT 0 November 10, 2007 14:09
Fluent.6.2.received a fatal signal (SEGMENTATION ) Jungfeng FLUENT 0 October 8, 2007 12:05
received fatal signal brusly FLUENT 1 April 12, 2007 13:49
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


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