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

UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 21, 2005, 05: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, 21: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


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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


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