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

udf interpretation successful but does't work

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By kornetka

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2013, 09:09
Default udf interpretation successful but does't work
  #1
New Member
 
Haoxin Xu
Join Date: Sep 2013
Posts: 3
Rep Power: 13
haoxin is on a distinguished road
Hi,

I need to compile a non-uniform heat flux boundary condition on a cylindrical target. The udf has been successifully interpreted in fluent and I can see the functions listed in the menu of the respecting boundary conditions.

But after I chose them and run the simulation, the results did not present the effects of the B.C. I wonder if i missed some important set-up or if my udf was wrong in some way.

Here are the codes:
/*cylinder wall flux*/
#include "udf.h"
#define a0 0.2262
#define a1 -0.173
#define b1 0.1471
#define a2 -0.04443
#define b2 -0.04578
#define a3 0.009039
#define b3 0.001342
#define a4 0.002360
#define b4 0.006975
#define w 19.87

DEFINE_PROFILE(outwall_flux1, t, i)
{
real x[ND_ND];
real l;
face_t f;
begin_f_loop(f, t)
{
F_CENTROID(x, f, t);
l=x[0];
if(0 <= l <= 0.25)
F_PROFILE(f, t, i)= (1e6)*(a0 + a1*cos(l*w) + b1*sin(l*w) + a2*cos(2*l*w) + b2*sin(2*l*w) + a3*cos(3*l*w) + b3*sin(3*l*w) + a4*cos(4*l*w) + b4*sin(4*l*w));
else
F_PROFILE(f, t, i)=0;
}
end_f_loop(f, t)
}

/*bottom wall flux*/

#include "udf.h"
#define a01 0.3031
#define a11 0.02634
#define b11 -0.02008
#define a21 -0.01549
#define b21 -0.01143
#define a31 -0.003358
#define b31 0.005991
#define w1 32.99
DEFINE_PROFILE(Bottomwall_flux2, t, i)
{
real x[ND_ND];
real y;
real z;
real r;
face_t f;
begin_f_loop(f, t)
{
F_CENTROID(x, f, t);
y=x[1];
z=x[2];
r=sqrt(y*y+z*z);
if(0 <= r <= 0.1)
F_PROFILE(f, t, i)= (1e6)*(a01 + a11*cos(r*w1) + b11*sin(r*w1) + a21*cos(2*r*w1) + b21*sin(2*r*w1) + a31*cos(3*r*w1) + b31*sin(3*r*w1));
else
F_PROFILE(f, t, i)=0;
}
end_f_loop(f, t)
}

I really appreciate it if someone could help!

Best,
Haoxin
haoxin is offline   Reply With Quote

Old   September 23, 2013, 16:21
Default
  #2
New Member
 
kornetka's Avatar
 
Join Date: Jun 2013
Posts: 15
Rep Power: 13
kornetka is on a distinguished road
Hi,
I'm not really sure if it will work, but maybe try changing the condition in if statement
Code:
if(0 <= l <= 0.25)
into something like
Code:
if(0 <= l && l <= 0.25)
Though it's only my guess, maybe Fluent has problem with this part of your code.
Cheers,
kornetka
haoxin likes this.
kornetka is offline   Reply With Quote

Old   September 24, 2013, 08:25
Smile
  #3
New Member
 
Haoxin Xu
Join Date: Sep 2013
Posts: 3
Rep Power: 13
haoxin is on a distinguished road
Quote:
Originally Posted by kornetka View Post
Hi,
I'm not really sure if it will work, but maybe try changing the condition in if statement
Code:
if(0 <= l <= 0.25)
into something like
Code:
if(0 <= l && l <= 0.25)
Though it's only my guess, maybe Fluent has problem with this part of your code.
Cheers,
kornetka
Hi Kornetka!

It worked! Thanks a lot! I could have never realized this small trick on my own .

Cheers,
Haoxin
haoxin is offline   Reply With Quote

Reply

Tags
fluent - udf


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
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 07:12
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 16:45
DEFINE_GEOM UDF Problems Pat FLUENT 0 August 14, 2003 14:16
help on UDF (on_demand) Marc FLUENT 4 July 9, 2003 14:50
Will the UDF work?? H.S.Fang FLUENT 0 December 27, 2001 22:21


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