CFD Online URL
[Sponsors]
Home > Forums > FLUENT

UDF

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 21, 2005, 06:21
Default UDF
  #1
Vinod
Guest
 
Posts: n/a
Hello, I just want to know how to create a logarithmic profile in the inlet plane of the domain using UDF. I tried by using C prog and hook it into fluent and seems its doesn't work.please look over the prog...

#include "udf.h" DEFINE_PROFILE(velocity_profile,t,i)

{

real x[ND_ND]; /* hold the position vector */

real z;

real U=0.68; /* Frictional velocity (UABL )*/

real k=0.42; /*Von-karman constant */

real z0=0.03; /*Ground roughness length*/

real tmp=0; face_t f;

begin_f_loop(f,t)

{

F_CENTROID(x,f,t);

z = x[1];

tmp=(z+z0)/z0;

F_PROFILE(f,t,i) = (U/k)*log(tmp); /*lag-law */

} end_f_loop(f,t) }

Please help me to solve this problem Regards, Vinod
  Reply With Quote

Old   July 21, 2005, 22:24
Default Re: UDF
  #2
Sham
Guest
 
Posts: n/a
#include "udf.h" #include "math.udf"

/* This UDF defines a positive, steady current profile that varies with depth. */ /* Velocity U = 0.38m/s Re=1.423x10^5*/

#define Ur 0.02044 /* reference current velocity (m/s)*/ #define Zo 0.0003 /* bottom roughness parameter */

DEFINE_PROFILE(ux_steady_current, 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+Zo)>0) F_PROFILE(f, thread, index) = (Ur/0.4)*log((y+Zo)/Zo);

else F_PROFILE(f, thread, index) = 0.0;

}

end_f_loop(f, thread) }
  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 parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 22:38
Dynamic Mesh UDF Qureshi FLUENT 1 December 2, 2009 01:27
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 13:26.