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

UDF-temperature profile

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

Like Tree1Likes
  • 1 Post By A CFD free user

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2013, 15:34
Default UDF-temperature profile
  #1
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
Hi all,

I had input the below file to the FLUENT as boundary condition. why its not work ? where is my mistake? I know its not work becuase after analysis the fluent used constant temperature (its default value).


start the program:


#include "udf.h"

DEFINE_PROFILE(Temp_Profile, thread, position)
{
face_t f;
real x[ND_ND]; /* this will hold the position vector */
real y;

begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[0];
F_PROFILE(f, thread, position) = (9e-5*y*y*y*y*y)-(0.0038*y*y*y*y)+(0.028*y*y*y)+(0.3856*y*y)-(2.3528*y)+11.456;

}
end_f_loop(f,t)
}
ahvz is offline   Reply With Quote

Old   April 23, 2013, 17:34
Default
  #2
Senior Member
 
A CFD free user's Avatar
 
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14
A CFD free user is on a distinguished road
Hey
I suppose you need to change y=x[0] to y=x[1]. C language recognize
x=x[0]
y=x[1]
z=x[2]
Try it
__________________
Regard yours
A CFD free user is offline   Reply With Quote

Old   April 23, 2013, 19:08
Default
  #3
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
Thank you very much for the reply,

still the same problem...

Regards,
ahvz is offline   Reply With Quote

Old   April 23, 2013, 22:49
Default
  #4
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 21
blackmask will become famous soon enough
How do you hook your UDF? Does y vary at the boundary your UDF is hooked to?

By the way, although
end_f_loop(f,t)
only serves as dummy placeholder, for clearness it should be rewritten as
end_f_loop(f, thread)
blackmask is offline   Reply With Quote

Old   April 24, 2013, 06:02
Default
  #5
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
Hi,

I am trying to do transient analysis. the attached file shows what I want to write at UDF file which is temperature versus time. for now I prepared the below C program:

first, I am not sure the program is true.

second, if its true why after interrupting its attached to program but its not work ( I know because the default value considered automatically by the Fluent during the analysis process).

start the UDF file :


#include "udf.h"

DEFINE_PROFILE(Temp_Profile, thread, position) /* Temp_profile is alternative, thread is boundary,
{
face_t f;
real x[ND_ND]; /* this will hold the position vector */
real y;

begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
F_PROFILE(f, thread, position) = (-9e-27*y*y*y*y*y*y)+(2e-21*y*y*y*y*y)-(2e-16*y*y*y*y)+(1e-11*y*y*y)-(2e-7*y*y)+0.0009*y+9.4751;

}
end_f_loop(f,thread)
}


any helps?


thanks,
Attached Images
File Type: jpg Capture.JPG (36.3 KB, 12 views)

Last edited by ahvz; April 25, 2013 at 09:40.
ahvz is offline   Reply With Quote

Old   April 29, 2013, 13:51
Default
  #6
Senior Member
 
A CFD free user's Avatar
 
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14
A CFD free user is on a distinguished road
Hey
I didn't take your point by saying " if its true why after interrupting its attached to program but its not work ( I know because the default value considered automatically by the Fluent during the analysis process)", but I think you need to try this:
1- There should be a space between face_t and f. Don't neglect that.
2- Try to define your variable as float.
3- Change " position" to "index".
I don't see anything weird in your code any more longer. By the way, are you trying to write a code to define a periodic temperature profile? A friend of mine has the same problem. If so, I suppose you should change your code and consider the periodic profile as well.
I look forward to hearing more.
ahvz likes this.
__________________
Regard yours

Last edited by A CFD free user; April 29, 2013 at 14:35.
A CFD free user is offline   Reply With Quote

Old   April 29, 2013, 14:00
Default
  #7
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
thank you for the reply,

Last edited by ahvz; May 11, 2013 at 11:29.
ahvz 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
please help UDF for velocity profile in y-directio raju Fluent UDF and Scheme Programming 6 April 13, 2019 00:21
UDF error - parabolic velocity profile - 3D turbine Zaqie Fluent UDF and Scheme Programming 9 June 25, 2016 20:08
defining temperature profile with UDF mohammadkm Fluent UDF and Scheme Programming 11 July 3, 2013 01:15
UDF temp. profile BC Shashikant FLUENT 0 June 24, 2006 04:16
temperature profile on boundary sivakumar FLUENT 5 November 24, 2002 01:58


All times are GMT -4. The time now is 15:31.