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

udf initalizing problem

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 5, 2012, 06:32
Lightbulb udf initalizing problem
  #1
New Member
 
studen
Join Date: Jan 2012
Posts: 12
Rep Power: 14
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, 06:14
Default
  #2
Senior Member
 
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17
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 Search this Thread
Search this Thread:

Advanced Search
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 Off
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 40 March 18, 2018 07:05
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 07:56
udf compiling problem akr FLUENT 3 August 22, 2007 08:14
UDF problem chiseung FLUENT 4 January 10, 2002 10:58


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