CFD Online Logo CFD Online URL
Home > Forums > FLUENT

Wall temp UDF

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

LinkBack Thread Tools Display Modes
Old   April 5, 2004, 13:08
Default Wall temp UDF
Posts: n/a
Dear Frnds,

I am relatively new user to FLUENT .I have two queries,

1. I want to access wall tempearture from FLUENT and that I have to use in my UDF(interpreted) which is return as follows, but it is giving an error as

Error: all-new.c: line 9269: face: undeclared variable

I hve been trying it for a long time but I couldn't solve it.

So what is wrong in the UDF Is syntax for wall temperature is wrong?

#include "udf.h" DEFINE_PROFILE(hvar_comb,thread,position)

{ face_t f;

real x[ND_ND]; real temp=F_T(face,thread);

real to,m,p,q,taw,h,murf,rhorf,trf,st,rerf,v,rho,ht,hr;

real gamma=1.4,r=0.878,Pr=0.68; real tw=300,C=1006,R=287;

begin_f_loop(f, thread) { F_CENTROID(x,f,thread);

t = 69.224*(pow(x[0],2)) + 441.47*x[0] + 684.92;

if(x[0]>=1.15 && x[0] < 1.509)

{ m = -0.8668*x[0] + 2.9991; }

if(x[0]>=1.509 && x[0]<= 3.0) { m= -0.1631*(pow(x[0],4)) + 1.6039*(pow(x[0],3)) - 5.9183*(pow(x[0],2)) + 9.5667*x[0] - 3.9286; }

if(x[0]>=1.15 && x[0]<1.5224) {

p = 51394*x[0] + 1818.1; }

if (x[0]>=1.5224 && x[0]<=3.0) { p = -25791*(pow(x[0],3)) + 198961*(pow(x[0],2)) - 519832*x[0]+ 499456; }

rho=p/(R*t); v=m*(sqrt(gamma*R*t)); to=t*(1+0.2*(pow(m,2))); taw=t+r*(to-t); trf=t+0.5*(tw-t)+0.22*(taw-t); murf = -1E-11*pow(trf,2) + 5E-08*trf + 6E-06; rhorf=p/(R*trf);

rerf=rhorf*v*x[0]/murf; st=0.0296 *(pow(rerf,(-0.2)))/(pow(Pr,0.6667)); h=st*rho*C*v;

hr=((0.9*5.67e-8*((pow(temp,4))-(pow(237,4)))/(1843-temp); ht=h-hr;

F_PROFILE(f,thread,position)=ht; } end_f_loop(f, thread) }

Second problem I facing in variable properties .

2. I need to give variable thermal conductivity in material properties(which is polynomial eaquation k = 1E-06x2 + 0.0158x + 11.421.) I am selecting polynomial option in the fluent giving three coefficients as 1e-06,0.0158 and 11.421.

so is it correct?

results I am getting are absurd.

So could u please extend help regarding these queries?

Sorry for troubling u,but I hope u will not mind it.

thanks and regards.

  Reply With Quote

Old   April 5, 2004, 15:10
Default Re: Wall temp UDF
Posts: n/a
real temp=F_T(face,thread);

should be real temp=F_T(f,thread);

as you have defined face_t f , I noticed that you have used f at all other places , Its the 3rd line which is giving you problem as "face " is undeclared .

  Reply With Quote

Old   April 5, 2004, 22:41
Default Re: Wall temp UDF
Posts: n/a

The second question of your remarks is O.K. Your inputs are correct.

Thank you

  Reply With Quote

Old   April 11, 2004, 02:56
Default Define_adjust
Posts: n/a
Hi friends, thanks a lot ajay & FJ for ur valuable suggestions.

have second problem now.

I need to control the coolant flow through a channel with reference to flow time. For e.g. for first 40 sec of computatation i don't want to allow the coolant to pass through for next 40 sec(ie 40 to 80 sec)I want aloow the coolant to pass through. again for next 150 sec i don't want to allow the coolant to pass through a channel.

This I know that I have do by using DEFINE_on_demand or DEfine_adjust.

But I don't know how to do it and where to implement this UDF (tht means at velocity inlet bondary condition or somewhere else)

Could anybody help me out regarding this problem.

Thanks in advance
  Reply With Quote

Old   April 11, 2004, 22:17
Default Re: Define_adjust
Posts: n/a

Do you want to switching your BC as a time function,don't you?. If it is, DEFINE_PROFILE is suitable. Other macros make you bother. I'll explain below.

DEFINE_ON_DEMAND is called when you want to do(I mean , writing a file or reading a file, calculate a certain value). So I think this macro makes no sense in this problem.

DEFINE_ADJUST is called at every iteration. If calculation is steady flow, it's O.K. But if it's unsteady flow ,this thing is sometimes bothering us and DEFINE_ADJUST should not be used. Since DEFINE_ADJUST is called at every iteration(it's not the end of time step), when we defined some equations in this macro ,returned values are calculated from un-convergence results. This thing is unphysical and makes calculation divergence .

So DEFINE_EXECUTE_AT_END should be used. This macro is called at the end of each time step and can return values but is not able to set a value for BC. So we have to use both DEFINE_EXECUTE_AT_END and DEFINE_PROFILE.

It's bother but we are able to do everything via UDF .

Thank you.

  Reply With Quote


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
How to get the wall shear stress by UDF Chen Fangzhi FLUENT 2 May 21, 2010 09:32
udf variable for wall temperature Kiran FLUENT 0 July 31, 2008 08:31
wall suction udf osman turan FLUENT 2 July 17, 2008 07:09
Wall boundary condition – UDF Ssn FLUENT 0 January 25, 2008 03:43
How to write udf of slip wall condition cxzhao FLUENT 0 April 27, 2005 21:20

All times are GMT -4. The time now is 22:23.