|
[Sponsors] |
April 23, 2013, 15:34 |
UDF-temperature profile
|
#1 |
Senior Member
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0 |
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) } |
|
April 23, 2013, 17:34 |
|
#2 |
Senior Member
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14 |
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 |
|
April 23, 2013, 19:08 |
|
#3 |
Senior Member
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0 |
Thank you very much for the reply,
still the same problem... Regards, |
|
April 23, 2013, 22:49 |
|
#4 |
Senior Member
|
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) |
|
April 24, 2013, 06:02 |
|
#5 |
Senior Member
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0 |
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, Last edited by ahvz; April 25, 2013 at 09:40. |
|
April 29, 2013, 13:51 |
|
#6 |
Senior Member
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14 |
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.
__________________
Regard yours Last edited by A CFD free user; April 29, 2013 at 14:35. |
|
April 29, 2013, 14:00 |
|
#7 |
Senior Member
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0 |
thank you for the reply,
Last edited by ahvz; May 11, 2013 at 11:29. |
|
|
|
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 |