UDF code not working
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) } |
Which fluxes did it give, and which fluxes are the "right fluxes"?
|
It gave a uniform flux of 125 W/m2. It should increase from 0 to 500.
|
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.) |
Yes! It works! Thanks a lot!
|
All times are GMT -4. The time now is 09:44. |