|
[Sponsors] |
May 3, 2018, 04:11 |
UDF code not working
|
#1 |
New Member
newuser
Join Date: Dec 2017
Posts: 11
Rep Power: 8 |
Hi,
I used the following code to increase the heat flux along a vertical wall from 0-500 linearly. However it doesn't work. I checked the wall heat flux at different locations in the CFD post, but it didn't give the right fluxes.Please let me know the correct solution. DEFINE_PROFILE(lin_incr,t,i) { face_t f; float x[ND_ND]; begin_f_loop(f,t) { F_CENTROID(x,f,t); F_PROFILE(f,t,i)=0+1250*x[0]; } end_f_loop(f,t) } |
|
May 3, 2018, 07:08 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
Which fluxes did it give, and which fluxes are the "right fluxes"?
|
|
May 3, 2018, 09:41 |
|
#3 |
New Member
newuser
Join Date: Dec 2017
Posts: 11
Rep Power: 8 |
It gave a uniform flux of 125 W/m2. It should increase from 0 to 500.
|
|
May 3, 2018, 10:55 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
Does your boundary happen to be located at x=0.1 m?
What is probably happening: you wrote a UDF that varies linearly in x-coordinate, but your boundary varies in y-coordinate. (Or z-coordinate?) Use x[1] in stead of x[0] if you want to vary in y-coordinate. (Or x[2] for z-coordinate.) |
|
May 3, 2018, 21:22 |
|
#5 |
New Member
newuser
Join Date: Dec 2017
Posts: 11
Rep Power: 8 |
Yes! It works! Thanks a lot!
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF For Electrical Conductivity Not working | rage | Fluent UDF and Scheme Programming | 2 | December 9, 2016 10:03 |
Difficulty with UDF code for HEAT FLUX | etudiant_IITB | Fluent UDF and Scheme Programming | 1 | December 7, 2015 09:07 |
UDF is not working | er.mkumar | Fluent UDF and Scheme Programming | 0 | September 8, 2012 10:33 |
Request for UDF code for forced vibrations | jagadeesh putta | Main CFD Forum | 0 | November 21, 2007 22:46 |
Design Integration with CFD? | John C. Chien | Main CFD Forum | 19 | May 17, 2001 16:56 |