|
[Sponsors] |
November 26, 2015, 06:52 |
a fatal signal (segmentation fault)
|
#1 |
New Member
angela huang
Join Date: Nov 2015
Posts: 6
Rep Power: 10 |
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; } |
|
|
|
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 |