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

udf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 24, 2007, 10:15
Default udf
  #1
Jihwan
Guest
 
Posts: n/a
Temp Gradient in UDF

Hi

I have a problem accessing the temperature gradient in a UDF.

I want to give temperature gradient on the 2-D wall.

(Methematical fucntion is T(x)= 30 + ( 1.5 * lxl )

I am writing using DEFINE_PROFILE.

I just following UDF manuals Ex.

But my udf file didn't warking.

I didn't know what is problem.. becuz I'm rookie on fluent.

Could anyone help me in this

*** cpp file (made by me) ***

#include "udf.h"

DEFINE_PROFILE(wall_temp,thread,index) {

real x[ND_ND];

real temp;

face_t f;

begin_f_loop(f,thread)

{

temp = F_T(f,thread);

F_UDMI(f,thread,0) = 30 + (1.5 * x );

if (x < 1)

x * = - 1

}

end_f_loop(f,t) }
  Reply With Quote

Old   January 24, 2007, 15:39
Default Re: udf
  #2
Sujith
Guest
 
Posts: n/a
there are errors in the udf. F_UDMI(f,thread,0) is reqd. only if a user defined memory is not needed for storing some information.

begin_f_loop(f,thread) will loop over all the faces where you are hooking the udf.

get the centroid of each face using the macro F_CENTROID(x,f,thread)

u will get x,y,z coordinates as x[0],x[1],x[2]

then define your profile F_PROFILE(f,t,i) = f(x,y,z)

You may refer the documentations....

Best wishes, Sujith
  Reply With Quote

Old   January 25, 2007, 00:08
Default Re: udf
  #3
Jihwan
Guest
 
Posts: n/a
dear Sugith

Thanks for your advice.

I'll more try again.

Can I send mail to you when I have a problen about this?

Have a nice day.
  Reply With Quote

Old   January 25, 2007, 09:17
Default Re: udf
  #4
Sujith
Guest
 
Posts: n/a
most welcome
  Reply With Quote

Old   January 29, 2007, 09:59
Default Re: udf
  #5
Jihwan
Guest
 
Posts: n/a
hi Sujith

I tried again..

But I failed again..

I was so confuse.

can you help me?

I made new udf file...

even though that failed interpreted.

****************************************** #include <udf.h> #include <math.h>

DEFINE_PROFILE(temp_wall,thread,position) {

real x [ND_ND];

real r,z,y;

face_t f;

begin_f_loop(f,thread)

{

F_CENTROID(x,f,thread);

r=x[1];

r=sqrt(x*x);

F_PROFILE(f,thread,position)=30.+(1.5*r);

}

end_f_loop(f,thread) }
  Reply With Quote

Old   January 29, 2007, 10:54
Default Re: udf
  #6
Jihwan
Guest
 
Posts: n/a
Hi Sujith

I succeed interpreted.

But I failed the compiling..

I don't know what is problem..

************************************************** ** #include <udf.h>

DEFINE_PROFILE(temp_wall,thread,position) {

real x [ND_ND];

real a,y;

face_t f;

begin_f_loop(f,thread)

{

F_CENTROID(x,f,thread);

a=x[1];

F_T(f,thread)=30.+(1.5*fabs(a));

}

end_f_loop(f,thread) }

I need your help
  Reply With Quote

Old   January 29, 2007, 11:51
Default Re: udf
  #7
Sujith
Guest
 
Posts: n/a
What is the error message? Probly u will not be havin a recommended microsoft compiler for windows
  Reply With Quote

Old   January 29, 2007, 21:08
Default Re: udf
  #8
Jihwan
Guest
 
Posts: n/a
Message is

I succeed interpreted. but I failed compiling..

massage aappear after clik Load button at compiling.

"pening library "Temp_wall"...

Error: open_udf_library: can't not found file.

Error Object: ()"

And I use visual c++

  Reply With Quote

Reply


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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


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