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

UDF help (about temp gradient)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 29, 2007, 10:08
Default UDF help (about temp gradient)
  #1
Jihwan
Guest
 
Posts: n/a
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 spent a lot of time with manual. But I failed.

I need your help.
  Reply With Quote

Old   January 29, 2007, 10:59
Default Re: UDF help (about temp gradient)
  #2
pinks
Guest
 
Posts: n/a
Use DEFINE_profile macro, F_T and F_centroid. read centroid of the cell, assingn x(0) to a variable, and define the function on each face as F_T(f,t)= 30 + (1.5 * fabs(a)).where a=x(0). I hope this should work. All the best.

  Reply With Quote

Old   January 29, 2007, 11:12
Default Re: UDF help (about temp gradient)
  #3
Jihwan
Guest
 
Posts: n/a
thanks for your advice.

I tried..

But that couldn't interpreted..

and I don't know what is problem..

when I tried interpreted, than message came out -line 13: a: undeclared variable

can you help me?

my ccp file is

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

DEFINE_PROFILE(temp_wall,thread,position) {

real x [ND_ND];

real r,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) }

  Reply With Quote

Old   January 29, 2007, 11:29
Default Re: UDF help (about temp gradient)
  #4
pinks
Guest
 
Posts: n/a
you have not defined variable a, use r instead or define real a instead of real r,y; ur udf. u r using x[1], i hope ur wall is in y direction.

  Reply With Quote

Old   January 29, 2007, 11:45
Default Re: UDF help (about temp gradient)
  #5
Jihwan
Guest
 
Posts: n/a
thanks a lot. I succeed interpreted. but I failed compiling..

massage aappear

"pening library "Temp_wall"...

Error: open_udf_library: μ§€μ •λœ νŒŒμΌμ„ 찾을 수 μ-†μŠ΅λ‹ˆλ‹€.(<--KOREAN)

Error Object: ()"

what's prlblem?

  Reply With Quote

Old   January 29, 2007, 11:49
Default Re: UDF help (about temp gradient)
  #6
Jihwan
Guest
 
Posts: n/a
And my wall is in X direction

--------------------------->(wall-direction)

and My changed cpp file is

************************************************** *

#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) }
  Reply With Quote

Old   January 30, 2007, 00:40
Default Re: UDF help (about temp gradient)
  #7
pinks
Guest
 
Posts: n/a
Hi, I am able to compile as well as load. try the following udf. Keep the [filename].c file in your working directory.. and confirm that you have a c compiler.

#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[0];

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

}

end_f_loop(f,thread) }
  Reply With Quote

Old   January 30, 2007, 00:41
Default Re: UDF help (about temp gradient)
  #8
pinks
Guest
 
Posts: n/a
x[0], x[1], x[2] stands for x,y and z dirctn respetively. If you ahve your wall in x direction use x[0]
  Reply With Quote

Old   January 30, 2007, 01:04
Default Re: UDF help (about temp gradient)
  #9
Jihwan
Guest
 
Posts: n/a
Thanks a lot Pinks.

I use visual C++.

But I don't know why didn't compiling.

I'll try again. (I got it about problem. udf coding is work, and compiler has a problem. is correct?)

And can I ask again if I continually failed ?

Have a nice day.. see ya

  Reply With Quote

Old   January 30, 2007, 02:10
Default Re: UDF help (about temp gradient)
  #10
Jihwan
Guest
 
Posts: n/a
Finally, I found problem.

my c compiler has not udf.h file.

bottom is message when try compiling to use C++

--------------------Configuration: temp_wall - Win32 Debug-------------------- Compiling... temp_wall.cpp d:\fluenty\c++\temp_wall.cpp(1) : fatal error C1083: Cannot open include file: 'udf.h': No such file or directory Error executing cl.exe.

temp_wall.exe - 1 error(s), 0 warning(s)

how can I do it ?

  Reply With Quote

Old   January 31, 2007, 01:02
Default Re: UDF help (about temp gradient)
  #11
pinks
Guest
 
Posts: n/a
Fluent provides free compiler visual studio.NET at the following link http://www.fluentusers.com/support/i...udf_serial.htm. If you are licensed user you can download. You just need to launch Fluent the .net command prompt.

  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
UDF to Access Wall Normal Concentration Gradient Daniel Tanner Fluent UDF and Scheme Programming 4 February 18, 2015 15:35
specified shear at wall - temperature gradient - UDF - access violation error senD Fluent UDF and Scheme Programming 9 September 18, 2014 08:29
UDF temp gradient tutotial tejasvikrishna FLUENT 0 April 4, 2011 12:10
UDF for Species Mass Fraction Gradient *IN SPECIFIC ZONE * -- e.g. along axis of sym. ksiegs2 Fluent UDF and Scheme Programming 0 February 27, 2011 13:55
UDF for species-mass-fraction gradient at outlet sisir FLUENT 0 June 9, 2007 03:40


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