|
[Sponsors] |
|
January 4, 2014, 15:28 |
Define velocity profile for cavity
|
#1 |
New Member
arrif toufik
Join Date: Apr 2009
Posts: 9
Rep Power: 17 |
Hi
I m trying to write a UDF for a velocity profile for a cavity problem. The velocity profile is only in the horizontal direction(x direction) like : =-4340.4Z2+8608.2Z-4267 (see figure attached) But im new in udf programming I was found some examples in fluent tutorial like this /************************************************** ***********************/ /* udfexample.c */ /* UDF for specifying a steady-state velocity profile boundary condition */ /************************************************** ***********************/ #include "udf.h" 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]; F_PROFILE(f, thread, index) = 20. - y*y/(.0745*.0745)*20.; } end_f_loop(f, thread) } But must I applic this code simply? Please can anyone help me? |
|
January 4, 2014, 21:24 |
|
#2 |
Member
CAO Liushuai
Join Date: Apr 2012
Posts: 30
Rep Power: 14 |
Where is the attached figure ?
What is the Z means ? If it means the coordinate in the z-axis direction, then you can write your own udf similar to the example. If you have any problem, I can help you. |
|
January 6, 2014, 10:38 |
velocity profile _file attached missed?
|
#3 |
New Member
arrif toufik
Join Date: Apr 2009
Posts: 9
Rep Power: 17 |
thank you shuai ,
1-about attached figure i dont now i try to do it again 2-about the z coordinate : no sorry i was wrong its the y direction,The velocity profile is only in the horizontal direction(x direction) like: u (x=0; 0 < z< W ; 1-h/H <y<1)=-4340.4y2+8608.2y-4267 (see file:cavity.docx attached), thank u in advance |
|
January 6, 2014, 19:00 |
|
#4 |
Member
CAO Liushuai
Join Date: Apr 2012
Posts: 30
Rep Power: 14 |
#include "udf.h"
DEFINE_PROFILE(velocity_inlet, thread, index) { real x[ND_ND]; /* this will hold the position vector */ real y, h; real H = 20; /* the height H, for example */ face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; h = (H-y)/H; F_PROFILE(f, thread, index) = -4340.4*h*h+8608.2*h-4267.; } end_f_loop(f, thread) } You may try my code |
|
January 7, 2014, 12:32 |
|
#5 |
New Member
arrif toufik
Join Date: Apr 2009
Posts: 9
Rep Power: 17 |
thank, u i will try it and reply to u
|
|
February 4, 2014, 09:21 |
inlet profile
|
#6 |
New Member
arrif toufik
Join Date: Apr 2009
Posts: 9
Rep Power: 17 |
i tested your example but didnt work ,i dnt now why
I want to test the tutorial provided by fluent about: Example 2 - Velocity, Turbulent Kinetic Energy, and Turbulent Dissipation Rate Profiles in 2D configuration, to my case which is a cavity with an inlet an outlet vent, My configuration is attached Please help /************************************************** ******************** Concatenated UDFs for fully-developed turbulent inlet profiles ************************************************** *********************/ #include "udf.h" #define YMIN 0.0 /* constants */ #define YMAX 0.4064 #define UMEAN 1.0 #define B 1./7. #define DELOVRH 0.5 #define VISC 1.7894e-05 #define CMU 0.09 #define VKC 0.41 /* profile for x-velocity */ DEFINE_PROFILE(x_velocity,t,i) { real y, del, h, x[ND_ND], ufree; /* variable declarations */ face_t f; h = YMAX - YMIN; del = DELOVRH*h; ufree = UMEAN*(B+1.); begin_f_loop(f,t) { F_CENTROID(x,f,t); y = x[1]; if (y <= del) F_PROFILE(f,t,i) = ufree*pow(y/del,B); else F_PROFILE(f,t,i) = ufree*pow((h-y)/del,B); } end_f_loop(f,t) } /* profile for kinetic energy */ DEFINE_PROFILE(k_profile,t,i) { real y, del, h, ufree, x[ND_ND]; real ff, utau, knw, kinf; face_t f; h = YMAX - YMIN; del = DELOVRH*h; ufree = UMEAN*(B+1.); ff = 0.045/pow(ufree*del/VISC,0.25); utau=sqrt(ff*pow(ufree,2.)/2.0); knw=pow(utau,2.)/sqrt(CMU); kinf=0.002*pow(ufree,2.); begin_f_loop(f,t) { F_CENTROID(x,f,t); y=x[1]; if (y <= del) F_PROFILE(f,t,i)=knw+y/del*(kinf-knw); else F_PROFILE(f,t,i)=knw+(h-y)/del*(kinf-knw); } end_f_loop(f,t) } /* profile for dissipation rate */ DEFINE_PROFILE(dissip_profile,t,i) { real y, x[ND_ND], del, h, ufree; real ff, utau, knw, kinf; real mix, kay; face_t f; h = YMAX - YMIN; del = DELOVRH*h; ufree = UMEAN*(B+1.); ff = 0.045/pow(ufree*del/VISC,0.25); utau=sqrt(ff*pow(ufree,2.)/2.0); knw=pow(utau,2.)/sqrt(CMU); kinf=0.002*pow(ufree,2.); begin_f_loop(f,t) { F_CENTROID(x,f,t); y=x[1]; if (y <= del) kay=knw+y/del*(kinf-knw); else kay=knw+(h-y)/del*(kinf-knw); if (VKC*y < 0.085*del) mix = VKC*y; else mix = 0.085*del; F_PROFILE(f,t,i)=pow(CMU,0.75)*pow(kay,1.5)/mix; } end_f_loop(f,t) } |
|
September 21, 2023, 03:23 |
|
#7 |
New Member
ANH VU LE
Join Date: Apr 2023
Posts: 1
Rep Power: 0 |
Hi,
I'm trying to create the UDF based on the examples above. Please elaborate to me about this functions below: h = YMAX - YMIN; del = DELOVRH*h; ufree = UMEAN*(B+1.); ff = 0.045/pow(ufree*del/VISC,0.25) What is the meaning of "h", "del", "ff", "DELOVRH" ? Thank you so much |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for inlet velocity profile | Bollonga | Fluent UDF and Scheme Programming | 4 | June 29, 2021 04:40 |
UDF error - parabolic velocity profile - 3D turbine | Zaqie | Fluent UDF and Scheme Programming | 9 | June 25, 2016 19:08 |
Velocity profile boundary condition | Tuca | FLOW-3D | 1 | April 23, 2013 12:02 |
How to apply an outlet velocity profile to another inlet? | siw | FLUENT | 4 | April 10, 2013 11:19 |
Velocity Profile | Jeff | FLUENT | 1 | November 24, 2008 08:21 |