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

Debugging 3d parabolic udf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 10, 2005, 00:00
Default Debugging 3d parabolic udf
  #1
david
Guest
 
Posts: n/a
Hi all,

I am just starting my first 3d case and I am having problems with this UDF posted in another thread. I use it for a 3d laminar pipe flow. I was wondering if someone had encountered difficulty using this UDF. The imposed velocity profile should be imposed on the face perpendicular to the z-axis right?

When interpreting I get the following error message. Find below the UDF in question.

Error: GENERAL-CAR-CDR: invalid argument [1]: improper list Error Object: #f

Best Regards, David

---------------------------------------------

DEFINE_PROFILE(z_velocity, thread, position)

{

float r, x[2];

face_t f;

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread);

/* 3D: r = sqrt(pow(x[0]-xc, 2)+pow(x[1]-yc, 2)); */

/* here: r means not radius but distance from the centerline or symmetryline */ r = x[0]-xc;

F_PROFILE(f,thread,position)=2*umean*(1-pow(r/radius,2));

/* ************************************************** ***** */

/* controle output

printf("x=%.6f\t r=%.6f\t

u=%.5f\n",x[0],r,2*umean*(1-pow(r/radius,2))); */

/************************************************** *******/

}

end_f_loop(f, thread)

}

  Reply With Quote

Old   June 10, 2005, 06:37
Default Re: Debugging 3d parabolic udf
  #2
dirk
Guest
 
Posts: n/a
Hello David,

I just tried this UDF. You forgot to declare some variables. After doing this it works well.

Dirk
  Reply With Quote

Old   June 10, 2005, 15:51
Default Re: Debugging 3d parabolic udf
  #3
david
Guest
 
Posts: n/a
Hi Dirk,

Thanks for your response. You were right, I had forgotten to declare some variables. But I now have another problem. Consider the UDF posted which was adapted from the original. I include printf commands to see if UDF executes properly. It appears that the UDF interprets correctly but it seems that FLUENT avoids the code starting from

"begin_f_loop(f, thread)" downward. Do you have any clues why this is happening?

Best Regards David

--------------------------------------------------- #include "udf.h"

/* coordinates of the inlet center */

#define xc 0.

#define yc 0.

/* here: radius means half slit with or distance from the symmetryline to the wall */

#define radius 0.0014

/*mean velocity: (Ufree=Ucenter!!) */

#define umean 0.232

/*================================================= =================*/

DEFINE_PROFILE(z_velocity, thread, position)

{

float r, x[2];

face_t f;

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread);

r = sqrt(pow(x[0]-xc, 2)+pow(x[1]-yc, 2)); printf("r=%.6f\n",r);

/* here: r means not radius but distance from the centerline or symmetryline */ r = x[0]-xc;

F_PROFILE(f,thread,position)=2*umean*(1-pow(r/radius,2));

printf("x=%.6f\t r=%.6f\t u=%.5f\n",x[0],r,2*umean*(1-pow(r/radius,2)));

}

end_f_loop(f, thread)

}

  Reply With Quote

Old   June 11, 2005, 05:07
Default Re: Debugging 3d parabolic udf
  #4
dirk
Guest
 
Posts: n/a
This works fine. Just apply the inlet BC, make one iteration and plot the inlet velocity.
  Reply With Quote

Old   June 13, 2005, 14:20
Default Re: Debugging 3d parabolic udf
  #5
david
Guest
 
Posts: n/a
Hi Dirk, Thank you for responding. I have tried this and it still does not work. I mean it interprets fine but when I apply this profile to my velocity inlet and iterate nothing happens.

I am suspecting that something might be wrong with my mesh itself. Do you have a small 3d mesh file that I could use to test further my UDF as Fluent manual does not provide such mesh files.

If this not possible perhaps I could email my mesh file so you can have a look at it...

Best Regards, David
  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 Unsteady velocity parabolic profile Rashad FLUENT 3 October 1, 2018 15:27
UDF error - parabolic velocity profile - 3D turbine Zaqie Fluent UDF and Scheme Programming 9 June 25, 2016 19:08
help debugging Beam deflection UDF josik_1982 Fluent UDF and Scheme Programming 0 December 19, 2010 17:36
How to define a parabolic velocity inlet of particles with UDF zumaqiong FLUENT 2 February 22, 2010 09:46
IdeasUnvToFoam Bug amp Fix benru OpenFOAM Bugs 42 November 13, 2009 07:59


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