|
[Sponsors] |
June 10, 2005, 01:00 |
Debugging 3d parabolic udf
|
#1 |
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) } |
|
June 10, 2005, 07:37 |
Re: Debugging 3d parabolic udf
|
#2 |
Guest
Posts: n/a
|
Hello David,
I just tried this UDF. You forgot to declare some variables. After doing this it works well. Dirk |
|
June 10, 2005, 16:51 |
Re: Debugging 3d parabolic udf
|
#3 |
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) } |
|
June 11, 2005, 06:07 |
Re: Debugging 3d parabolic udf
|
#4 |
Guest
Posts: n/a
|
This works fine. Just apply the inlet BC, make one iteration and plot the inlet velocity.
|
|
June 13, 2005, 15:20 |
Re: Debugging 3d parabolic udf
|
#5 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF Unsteady velocity parabolic profile | Rashad | FLUENT | 3 | October 1, 2018 16:27 |
UDF error - parabolic velocity profile - 3D turbine | Zaqie | Fluent UDF and Scheme Programming | 9 | June 25, 2016 20:08 |
help debugging Beam deflection UDF | josik_1982 | Fluent UDF and Scheme Programming | 0 | December 19, 2010 18:36 |
How to define a parabolic velocity inlet of particles with UDF | zumaqiong | FLUENT | 2 | February 22, 2010 10:46 |
IdeasUnvToFoam Bug amp Fix | benru | OpenFOAM Bugs | 42 | November 13, 2009 08:59 |