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

UDF fluent:Change boundary condition. determination inlet and outlet boundary in "t"

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 27, 2015, 06:32
Default UDF fluent:Change boundary condition. determination inlet and outlet boundary in "t"
  #1
New Member
 
golriz
Join Date: Sep 2015
Posts: 11
Rep Power: 11
gzamiri@gmail.com is on a distinguished road
hi everybody
I want to simulate far field boundary for incompressible flow. in my model , far field boundary is circle. in each step time, I want fluent to specify inlet and outlet boundary. for this purpose, I consider this condition:
if:
1. u.n<0 inlet boundary
2.u.n>0 outlet boundary

n is normal vector, u is velocity vector.

I would like to know how could I apply this condition in fluent. I guess I should develop a UDF do you think that my way is correct?

I appreciate your help!

my udf is as follows:


/* UDF for determination of inlet and outlet */
#include "udf.h"
#include "sg.h"

DEFINE_EXECUTE_AT_END(determination_boun)
{
Domain *d;
face_t f;
Thread *t;
real velocity_vector[2], mag_velocity, normal_vec, mag_normal_vec;
real A[ND_ND], ds, es[ND_ND], A_by_es, dr0[ND_ND];
real X_component,Y_component, Guage_Pressure;
d=Get_Domain(1);
int ID=12; /*Zone ID for farfield zone from boundary condition task page*/
t=Lookup_Thread(d,ID);
begin_f_loop(f,t)
{
/* find velocities*/
velocity_vector[0]=F_U(f,t);
velocity_vector[1]=F_V(f,t);

/* magnitude of velocity vector*/
mag_velocity=NV_MAG(velocity_vector);
/* magnitude of normal vector*/
/*BOUNDARY_FACE_GEOMETRY(f,t,A,ds,es,A_by_es,dr0);*/
F_AREA(A,f,t);
mag_normal_vec=NV_MAG(A);
/* attack angle*/
double teta=0;
if((mag_velocity* mag_normal_vec*cos(teta))<0)
{
X_component=F_U(f,t); Y_component=F_V(f,t);
}
else
{
Guage_Pressure=F_P(f,t);
}
}
end_f_loop(f,t)
}
gzamiri@gmail.com is offline   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
Wind turbine simulation Saturn CFX 60 July 17, 2024 06:45
map outlet boundary profile as an inlet condition using UDF Daniel_Khazaei Fluent UDF and Scheme Programming 2 June 20, 2016 12:53
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


All times are GMT -4. The time now is 17:10.