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

something wrong when compiling udf, however the code is correct when interpreting

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 30, 2013, 10:59
Default something wrong when compiling udf, however the code is correct when interpreting
  #1
Member
 
ben
Join Date: Apr 2013
Posts: 36
Rep Power: 13
richard ben is on a distinguished road
Hey, everyone,

I began to change my udf from interpet to compile, however meet some problem and have no idea how to do.

1. The diffusivity

the code:

DEFINE_DIFFUSIVITY(uds_diffusivity_2,c,t,i)
{
return s_lamda*(1.0-POR)/3.0;
}
when I load this code, the uds goes to divergence. However, when I change "s_lamda*(1.0-POR)/3.0" into a constant, it works fine. In fact, s_lamda*(1.0-POR)/3.0 is a constant in my code since I defined "s_lamda" and "POR" in the begining of the code. This is weird

2. The source term

the code:
DEFINE_SOURCE(fluid_source_1,c,t,dS,eqn)
{
real Re, P, alamda_f, h,source_f;
alamda_f=C_K_L(c,t);
Re=C_U(c,t)/POR*ds*C_R(c,t)/C_MU_L(c,t);
P=-8.278*pow(POR,0.38)+57.384*pow(POR,1.38)-106.63*pow(POR,2.38)+95.756*pow(POR,3.38)-37.24*pow(POR,4.38);
h=2.096*pow(POR,0.38)*alamda_f*pow(Re,0.438)*P/(ds*ds);
source_f=h*(C_UDSI(c,t,0)-C_T(c,t));
dS[eqn]=-h;
return source_f;
}

I can load this source without any problem when interpreting, however in compiling it doesn't work at all. And the error is:
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

I have no idea what's wrong with my code or is there any difference between compile and interpret?

I will appreciate a lot for your help.
richard ben 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
please help me to correct my code Ardalan Main CFD Forum 1 June 2, 2010 18:32
UDF compiling problem in Flient 6.3 jeevan kumar FLUENT 2 February 25, 2009 00:43
What's wrong with my UDF? It worked in the past. CF FLUENT 3 September 26, 2007 20:09
compiling a UDF co2 FLUENT 2 January 5, 2004 19:34
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56


All times are GMT -4. The time now is 18:40.