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

UDF code not working

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 3, 2018, 04:11
Default UDF code not working
  #1
New Member
 
newuser
Join Date: Dec 2017
Posts: 11
Rep Power: 8
new_cfd is on a distinguished road
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)
}
new_cfd is offline   Reply With Quote

Old   May 3, 2018, 07:08
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Which fluxes did it give, and which fluxes are the "right fluxes"?
pakk is offline   Reply With Quote

Old   May 3, 2018, 09:41
Default
  #3
New Member
 
newuser
Join Date: Dec 2017
Posts: 11
Rep Power: 8
new_cfd is on a distinguished road
It gave a uniform flux of 125 W/m2. It should increase from 0 to 500.
new_cfd is offline   Reply With Quote

Old   May 3, 2018, 10:55
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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.)
pakk is offline   Reply With Quote

Old   May 3, 2018, 21:22
Default
  #5
New Member
 
newuser
Join Date: Dec 2017
Posts: 11
Rep Power: 8
new_cfd is on a distinguished road
Yes! It works! Thanks a lot!
new_cfd is offline   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 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


All times are GMT -4. The time now is 16:21.