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

velocity profile for inlet with UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 12, 2012, 03:51
Default velocity profile for inlet with UDF
  #1
New Member
 
selim
Join Date: Sep 2009
Location: UK
Posts: 16
Rep Power: 7
salihovic is on a distinguished road
Dear all,

I want to impose a velocity at the inlet which is parabolic at the bottom and top and constant in the middle of the inlet. But flunet does not regonize the locations correctly, so what is wrong in my UDF, pls help!!

Here is my udf,


#include "udf.h"
#define S 0.038
#define V1 10.86


DEFINE_PROFILE(inlet_x_velocity, thread, index)
{
real x[ND_ND]; /* this will hold the position vector */
real y;
face_t f;

begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
if (y<=S)
F_PROFILE(f, thread, index) = 249.384*y*y+249.384*y;

else if (S<=y<=3*S)
F_PROFILE(f, thread, index) = V1;
else if (3*S<=y<=4*S)
F_PROFILE(f, thread, index) = -83.514*y*y-83.514*y+14.6238;


}
end_f_loop(f, thread)
}


Thank you,
-Selim
salihovic is offline   Reply With Quote

Old   September 12, 2012, 04:51
Default
  #2
New Member
 
Zhi-Gang Zhai
Join Date: Sep 2012
Location: karlsruhe, Germany
Posts: 7
Rep Power: 4
zgzhai is on a distinguished road
pls show the mesh and what is the wrong result ? thank you!
zgzhai is offline   Reply With Quote

Old   September 12, 2012, 05:45
Default
  #3
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 899
Rep Power: 15
ghost82 will become famous soon enough
Hi,
the following udf will produce the following velocity-y coordinate chart; velocity will be a function of the only y coordinate.
Take care to operators <=, >= etc.: in your udf, if for example y=S both
F_PROFILE(f, thread, index) = 249.384*y*y+249.384*y;
F_PROFILE(f, thread, index) = V1;
are valid

Code:
#include "udf.h"
#define S 0.038
#define V1 10.86


DEFINE_PROFILE(inlet_x_velocity, thread, index) 
{
    real x[ND_ND];        /* this will hold the position vector */
    real y;
    face_t f;

    begin_f_loop(f, thread)
        {
        F_CENTROID(x,f,thread);
        y = x[1];
        if (y<=S)        /* y=S is included */
            F_PROFILE(f, thread, index) = 249.384*y*y+249.384*y;
        else if (S<y<3*S)        /* y=S and y=3S are not included */
            F_PROFILE(f, thread, index) = V1;
        else /* no need for another else if, 3S is included here */
        F_PROFILE(f, thread, index) = -83.514*y*y-83.514*y+14.6238;
        }
    end_f_loop(f, thread)
}
Attached Images
File Type: jpg notitle.jpg (31.0 KB, 16 views)
ghost82 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF problems - velocity profile Oli Fluent UDF and Scheme Programming 4 September 30, 2013 15:39
UDF Unsteady velocity profile Rashad FLUENT 0 February 27, 2008 15:57
How to specify the Velocity profile (eqn) by UDF Anant FLUENT 1 February 27, 2008 15:54
Multi step transient UDF velocity profile problem William177 FLUENT 1 February 3, 2008 07:47
UDF problem : inlet velocity in cyl. coord. system Jongdae Kim FLUENT 0 June 15, 2004 11:21


All times are GMT -4. The time now is 05:27.