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

a fatal signal (segmentation fault)

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   November 26, 2015, 06:52
Post a fatal signal (segmentation fault)
  #1
New Member
 
angela huang
Join Date: Nov 2015
Posts: 6
Rep Power: 10
Turbo_hrf is on a distinguished road
I have written a UDF about standard k-e turbulence model and compiled successfully, but when I try to initialize this code, it shows error: received a fatal signal (segmentation fault)
does anyone help me to remove this problem please?

My UDF code are listed below:
#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

 


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
receive fluent received a fatal signal (Segmentation fault). chenkaiqe FLUENT 2 March 10, 2015 08:21
Fluent Error: fatal signal received (Segmentation fault) gopalkrishnan FLUENT 0 December 16, 2014 01:37
Error: received a fatal signal (Segmentation fault). Revist Fluent UDF and Scheme Programming 1 December 12, 2014 13:18
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 12:39.