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

Error: received a fatal signal (Segmentation fault). Error Object: #f

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Bruno Machado

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 3, 2016, 13:33
Default Error: received a fatal signal (Segmentation fault). Error Object: #f
  #1
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 17
alinik is on a distinguished road
I know that this is a general error but thought someone might be able to help as I am sure many have faced this problem.

I am having a UDF and I think that the C_UDSI_G (gradient of a user defined scalar) is causing this error. Apparently this error occurs whenever we would like to access a variable that is not available.

Does anybody have a solution to this?

Thanks,

Ali
alinik is offline   Reply With Quote

Old   November 4, 2016, 11:44
Default
  #2
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 17
alinik is on a distinguished road
I have excluded the gradient terms in UDF and have put some constants there instead. I am still receiving the same error.

Anyone?
alinik is offline   Reply With Quote

Old   November 13, 2016, 21:36
Default
  #3
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road
"this error occurs whenever we would like to access a variable that is not available"

Maybe you can go to find a method to get the value of the variable?
SJSW is offline   Reply With Quote

Old   November 14, 2016, 19:32
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
What is your UDF and have you found the line of code that is causing the error?
`e` is offline   Reply With Quote

Old   December 9, 2016, 16:34
Default thread_loop_c (t,domain) is causing the error
  #5
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 17
alinik is on a distinguished road
Hi 'e'

Sorry it has been a while and I was finishing something else.
I printed out messages at different lines in the code to see where the error is being generated and observed this line is causing the error:

thread_loop_c (t,domain)

I use this line in an adjust macro.
Any ideas?

Thanks,
Ali
alinik is offline   Reply With Quote

Old   December 9, 2016, 19:22
Default
  #6
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
What is your UDF code? Have you appropriately declared/initialised the 't' and 'domain' variables?
`e` is offline   Reply With Quote

Old   December 11, 2016, 10:20
Default
  #7
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road
Quote:
Originally Posted by alinik View Post
Hi 'e'

Sorry it has been a while and I was finishing something else.
I printed out messages at different lines in the code to see where the error is being generated and observed this line is causing the error:

thread_loop_c (t,domain)

I use this line in an adjust macro.
Any ideas?

Thanks,
Ali
Hi~
How do you print out messages at different lines in the code to see where the error is being generated?
Thank you!
SJSW is offline   Reply With Quote

Old   December 12, 2016, 07:04
Default
  #8
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 12
Bruno Machado is on a distinguished road
Quote:
Originally Posted by SJSW View Post
Hi~
How do you print out messages at different lines in the code to see where the error is being generated?
Thank you!
put Message through your code and see where it stops. Then you can direct you debug.

Message("1");
.
.
.
Message("2");
SJSW likes this.
Bruno Machado is offline   Reply With Quote

Old   January 20, 2017, 16:48
Default
  #9
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 17
alinik is on a distinguished road
Hi folks,

I am still having this problem.
Whenever I want to use C_UDSI_G I get segmentation error. I have traced the error and I am 100% sure that this is causing the error.

Any one has any similar experience?

Thanks,

Ali
alinik is offline   Reply With Quote

Old   January 22, 2017, 11:22
Default
  #10
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road
I found some information in
http://jullio.pe.kr/fluent6.1/help/html/udf/node107.htm


UDF used to calculate gradient for post-processing

User defined scaler (UDS) and user defined memory (UDM) are used.
For any UDS, Fluent will automatically calculate the gradient. So,
we need to pass the variable to UDS, and fluent will calculate the
gradient for you. UDM is used to save the results.

Steps to take to make it work:
1. Build UDF library
2. Read in the converged case and data
3. Hook the UDF (Define->User Defined->Function->Compiled)
4. Hook adjust function (Define->User Defined->Function Hooks->
Adjust Function)
5. Define UDM (Define->User Defined->Memory 1)
6. Define UDS (Define->User Defined->Scalars 1)
7. Define BC for UDS (the same as the function for which you
want gradient)
8. Change UR for UDS to 1e-6 (Solve->Controls->Solution)
9. Turn off all equations except UDS (Solve->Controls->Solution)
10 Do A FEW iterations
11 Execute store_gradient (Define->User Defined->Execute On Demand)

NOTES on item 7 8 and 9
step 7 is VERY IMPORTANT, otherwise the gradient close to the
boundary will not be correct.
step 8 is VERY IMPORTANT, otherwise the solution will change.
Fluent will try to solve an equation for UDS; we want to
force it to be unchanged.
step 9 will save you time as the solution is already converged.
step 10 Three is determined to be the minimum.
SJSW is offline   Reply With Quote

Old   March 7, 2017, 09:34
Default
  #11
New Member
 
Bharath
Join Date: Mar 2017
Posts: 1
Rep Power: 0
bharathcfd is on a distinguished road
Hi I am new to fluent
I received a
Error : fatal signal (segmentation fault)
Error object : #f for the following udf in defining nano fluid properties please help me in solving.
#include "udf.h"
#define FI 0.1
#define RHO_np 3600
#define SI_1 0.9830
#define SI_2 12.959
#define KTC_np 30
#define TI 5E4
#define BETA_1 8.4407
#define BETA_2 -1.07304
#define CP_w 4200
#define KA 1.383E-23
#define SIi_1 2.8217E-2
#define SIi_2 3.917E-3
#define SIi_3 -3.0669E-2
#define SIi_4 -3.91123E-3
#define T_0 298.15
#define D_np 59E-9
#define CP_np 785
DEFINE_PROPERTY(cell_conductivity,cell,thread)
{
real ktc,ktc_w,temp,f,beta;
temp = C_T(cell,thread);
f = ((SIi_1*FI+SIi_2)*temp/T_0)+(SIi_3*FI+SIi_4);
beta = BETA_1*(pow(100*FI,BETA_2));
ktc_w = (-8.354*0.000001*(pow(temp,2)))+((6.53*0.001*temp)-0.5981);
ktc = ((KTC_np+(2*ktc_w)-2*(ktc_w-KTC_np)*FI)/(KTC_np+(2*ktc_w)+(ktc_w-KTC_np)*FI))*ktc_w+(TI*beta*FI*CP_w*(pow(((KA*temp )/(RHO_np*D_np)),0.5))*f);
return ktc;
}

DEFINE_PROPERTY(cell_density,cell,thread)
{
real temp,rho_w,rho;
temp = C_T(cell,thread);
rho_w = (-3.570*(pow(10,-3))*(pow(temp,2))+1.88*temp+753.2);
rho = (FI*RHO_np)+((1-FI)*rho_w);
return rho;
}

DEFINE_PROPERTY(cell_viscosity,cell,thread)
{
real mu,mu_w,temp;
temp = C_T(cell,thread);
mu_w = (2.591*(pow(10,-5))*(pow(10,(238.3/(temp-143.2)))));
mu = (SI_1*exp(SI_2*FI)*mu_w);
return mu;
}

DEFINE_PROPERTY(cell_specificheat,cell,thread)
{
real temp,cp,cp_w,rho_w,rho,T;
temp = C_T(cell,thread);
rho_w = (-3.570*(pow(10,-3))*(pow(T,2))+(1.88*T+753.2));
rho = (FI*RHO_np)+((1-FI)*rho_w);
cp_w = 4.2174356-0.0056181625*temp+0.0012992528*pow(temp,1.5)-0.00011535353*pow(temp,2.0)+4.14964*pow(10.0,-6.0)*pow(temp,2.5);
cp = ((FI*RHO_np*CP_np)+((1-FI)*rho_w*CP_w))/rho;
return cp;
}


Sent from my SM-G600FY using CFD Online Forum mobile app
bharathcfd is offline   Reply With Quote

Old   March 7, 2017, 09:56
Default
  #12
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road
Maybe you can try the method from Bruno Machado at #8 in this thread.
Try to insert 「Message("1");」 between lines, and find out which line would result in the problem.
SJSW is offline   Reply With Quote

Old   June 30, 2017, 03:12
Default Received a fatal Signal ( Segmentation fault )
  #13
Member
 
Muhammad Furqan Ali
Join Date: Oct 2014
Location: beijing
Posts: 53
Rep Power: 11
furqanrk is on a distinguished road
Send a message via Skype™ to furqanrk
Hi everyone !

I hope you are fine. I am using UDF in VOF model in ANSYS FLUENT, although, my VOF model without UDF is running fine. The UDF is written by my friend used it successfully. He has graduated last year after getting the results from same UDF. The UDF was working well on his server. He was using Fluent 6.3 on Linux system. When I am using same case, date and UDF on my laptop the case is not running, although UDF compilation is very fine. I also check it on Linux system too. During or after initialization, Error occurred segmentation fault error. It is very strange that same case and UDF is not working on his office now. Main error occurred when I am hooking ADJUST and EXECUTE-AT-END UDFs. May be there is some problem of writing/calling style is different in Windows and Linux system with 32bit and 64bit. ( this is just my opinion).

I hope you can understand the situation and have a try to fix the problem. I would be highly thankful if you guide me that where is the problem. I can send UDF by email if needed..

Thanks in Advance,
Regards,
M. F. ALi
furqanrk is offline   Reply With Quote

Old   July 3, 2017, 04:34
Default
  #14
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road
1.The syntax could be different in different FLUENT version.
2.The order of declaration of the variables could be a major problem in different OS such as Windows and Linux.
It seems that the order could be more casual in Linux than in Windows.
3.The compiler is not installed completely.
4.The environment variables are not well set up.
SJSW is offline   Reply With Quote

Old   May 2, 2018, 05:18
Default PLease help about my wroted UDF for nanofluid properties in Fluent
  #15
New Member
 
Hooman
Join Date: May 2018
Posts: 5
Rep Power: 7
newton2009 is on a distinguished road
Hi My Good Friends, I am a master student and for my thesis.
I wrote a udf for importing nano fluid properties in a 2D simple geometry by Fluent.
my case is:
laminar
single phase
I wrote udf and compiled it without any error when I want to initialize the case in fluent gave error please help me to find the reason
my udf is:
/************************************************** ************/
/* */
/* User-Defined Functions for temperature-dependent viscosity */
/* density , conductivity and heat capacity of */
/* Ansys FLUENT 18.2 */

#include "udf.h"

real phi=0;
real kp=35;
real rhop=3890;
real cp=880;
real dp=10;
real alphap=0.00001022435;
DEFINE_PROPERTY(cell_conductivity,cell,thread)
{
real knf;
real kb;
real mub;
real rhob;
real alphab;
real T=C_T(cell,thread)-273.15;
kb=0.56112+0.00193*T-0.0000026015*pow(T,2)-0.0000000608803*pow(T,3);
mub=0.00169-0.000042526*T+0.00000049255*pow(T,2)-0.00000000209935*pow(T,3);
rhob=(1000*(119000+(T*1365)-4*pow(T,2)-pow((T-4),2)))/(119000+(T*1365)-4*pow(T,2));
alphab=kb/(rhob*mub);
knf=kb*0.8938*pow(1+(phi/100),1.37)*pow(1+(T/70),0.2777)*pow(1+(dp/150),-0.0336)*pow((alphap/alphab),0.01737);
return knf;
}
DEFINE_PROPERTY(cell_density,cell,thread)
{
real T=C_T(cell,thread)-273.15;
real rhob;
real rhonf;
rhob=1000*(119000+(T*1365)-4*pow(T,2)-pow((T-4),2))/(119000+(T*1365)-4*pow(T,2));
rhonf=(1-phi)*rhob+phi*(rhop);
return rhonf;
}
DEFINE_PROPERTY(cell_viscosity, cell, thread)
{
real munf;
real T , mub;
T=C_T(cell,thread)-273.15;
mub=0.00169-0.000042526*T+0.00000049255*pow(T,2)-0.00000000209935*pow(T,3);
munf=mub*pow(1+(phi/100),11.3)*pow(1+(T/70),-0.038)*pow(1+(dp/170),-0.061);
return munf;
}
DEFINE_PROPERTY(cell_specificheat, cell, thread)
{
real rhob;
real rhonf;
real cnf;
real T, cb;
T = C_T(cell, thread) - 273.15;
rhob = 1000 * (119000 + (T * 1365) - 4 * pow(T, 2) - pow((T - 4), 2)) / (119000 + (T * 1365) - 4 * pow(T, 2));
rhonf = (1 - phi)*rhob + phi*(rhop);
cb = 4217.629-3.20888*T + 0.09503*pow(T, 2) - 0.00132*pow(T, 3)+0.000009415*pow(T, 4)-0.000000025479*pow(T, 5);
cnf = ((1-phi)*(rhob*cb)+phi*(rhop*cp))/((1-phi)*rhob+phi*rhop);
return cnf;
}
newton2009 is offline   Reply With Quote

Old   May 2, 2018, 08:17
Default
  #16
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road
What is the error message?
You can post here.
I think that you can check if any value used in the UDF was missed in the setting pages.


Quote:
Originally Posted by newton2009 View Post
Hi My Good Friends, I am a master student and for my thesis.
I wrote a udf for importing nano fluid properties in a 2D simple geometry by Fluent.
my case is:
laminar
single phase
I wrote udf and compiled it without any error when I want to initialize the case in fluent gave error please help me to find the reason
my udf is:
/************************************************** ************/
/* */
/* User-Defined Functions for temperature-dependent viscosity */
/* density , conductivity and heat capacity of */
/* Ansys FLUENT 18.2 */

#include "udf.h"

real phi=0;
real kp=35;
real rhop=3890;
real cp=880;
real dp=10;
real alphap=0.00001022435;
DEFINE_PROPERTY(cell_conductivity,cell,thread)
{
real knf;
real kb;
real mub;
real rhob;
real alphab;
real T=C_T(cell,thread)-273.15;
kb=0.56112+0.00193*T-0.0000026015*pow(T,2)-0.0000000608803*pow(T,3);
mub=0.00169-0.000042526*T+0.00000049255*pow(T,2)-0.00000000209935*pow(T,3);
rhob=(1000*(119000+(T*1365)-4*pow(T,2)-pow((T-4),2)))/(119000+(T*1365)-4*pow(T,2));
alphab=kb/(rhob*mub);
knf=kb*0.8938*pow(1+(phi/100),1.37)*pow(1+(T/70),0.2777)*pow(1+(dp/150),-0.0336)*pow((alphap/alphab),0.01737);
return knf;
}
DEFINE_PROPERTY(cell_density,cell,thread)
{
real T=C_T(cell,thread)-273.15;
real rhob;
real rhonf;
rhob=1000*(119000+(T*1365)-4*pow(T,2)-pow((T-4),2))/(119000+(T*1365)-4*pow(T,2));
rhonf=(1-phi)*rhob+phi*(rhop);
return rhonf;
}
DEFINE_PROPERTY(cell_viscosity, cell, thread)
{
real munf;
real T , mub;
T=C_T(cell,thread)-273.15;
mub=0.00169-0.000042526*T+0.00000049255*pow(T,2)-0.00000000209935*pow(T,3);
munf=mub*pow(1+(phi/100),11.3)*pow(1+(T/70),-0.038)*pow(1+(dp/170),-0.061);
return munf;
}
DEFINE_PROPERTY(cell_specificheat, cell, thread)
{
real rhob;
real rhonf;
real cnf;
real T, cb;
T = C_T(cell, thread) - 273.15;
rhob = 1000 * (119000 + (T * 1365) - 4 * pow(T, 2) - pow((T - 4), 2)) / (119000 + (T * 1365) - 4 * pow(T, 2));
rhonf = (1 - phi)*rhob + phi*(rhop);
cb = 4217.629-3.20888*T + 0.09503*pow(T, 2) - 0.00132*pow(T, 3)+0.000009415*pow(T, 4)-0.000000025479*pow(T, 5);
cnf = ((1-phi)*(rhob*cb)+phi*(rhop*cp))/((1-phi)*rhob+phi*rhop);
return cnf;
}
SJSW 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
fluentError: received a fatal signal (Segmentation fault). thomaszhangjing Fluent UDF and Scheme Programming 11 January 13, 2021 09:37
fatal signal segmentation fault flo90000 Fluent UDF and Scheme Programming 16 October 26, 2017 18:28
Fluent udf Error: received a fatal signal (Segmentation fault) syble FLUENT 3 December 9, 2016 16:28
receive fluent received a fatal signal (Segmentation fault). chenkaiqe FLUENT 2 March 10, 2015 08:21
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 15:16


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