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

udf initalizing problem

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 5, 2012, 05:32
Lightbulb udf initalizing problem
  #1
New Member
 
studen
Join Date: Jan 2012
Location: From Bangalore, India. Presently pursuing PhD in Malaysia
Posts: 8
Rep Power: 4
studen is on a distinguished road
#include "udf.h"
DEFINE_PROPERTY(cell_viscosity, c,t)
{
double u, uo, A, B, C, T; //uo, A, B, C are constant
uo = 4.485e-8;
A = -7.5907e-7;
B = 3.8968e-4;
C = 4.0130e-2;

for (T=1; T<101; T++)
{
u = uo*(exp(1/((A*T*T)+(B*T)+C)));
printf ("T = %3.0f, u= %3.8f \n", T, u);
}
return u;
}

this is my programme to simulate heat transfer considering variable viscosity, the programme can be interpreted but when i initalize it goes into an infinte loop, need suggestions and help.

thanks in advance
studen is offline   Reply With Quote

Old   March 6, 2012, 05:14
Default
  #2
Senior Member
 
Max
Join Date: Mar 2009
Posts: 131
Rep Power: 7
coglione is on a distinguished road
First of all, the loop counter T should be defined as integer and not as real. Don't know how your compiler handles this exactly but fix it anyway.

Secondly DEFINE_PROPERTY macros are called for each cell every iteration. That means your udf will loop 100 times for each cell which may take a long time if your mesh is big.

cheers
coglione is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 30 March 21, 2014 06:34
what's the problem with my udf zzyan FLUENT 0 November 4, 2010 04:56
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
UDF problem chiseung FLUENT 4 January 10, 2002 09:58


All times are GMT -4. The time now is 16:29.