CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   define boundary condition in just one cell face (http://www.cfd-online.com/Forums/fluent-udf/77220-define-boundary-condition-just-one-cell-face.html)

 om1234 June 16, 2010 19:11

define boundary condition in just one cell face

Hi all
i'm going to analysis 2d centrifugal pump.in outlet line,i try to define static pressure in a single face of grid. i use this udf. but it doesn't work correctlly.
i have some questions and i wish any one could answer me.
is the define adjust updated in every iteration and is it usefull in this udf?
any one know any thing about the working of fluent memory?
is the memory values updated in each iteration,i mean is the previous values deleted and replaced by the new pressure value or not?

#include"udf.h"

{
real p;
face_t f;
int ID=7;/*this is the outlet ID*/
int k=0;

begin_f_loop(f,t)
{
p=F_P(f,t); /*F_P read the pressure of each face and assign it to p*/
F_UDMI(f,t,k)= p; /*this macro is used to store/access the values of the user-defined memory on the face.the outlet boundary is devided to 12 subline.so i set the number of memory 12.define>user deine>memory*/
k=k+1;
}
end_f_loop(f,t)
}

DEFINE_PROFILE(pressure_outlet, t, i) /* this macro is used to define values in BCs*/
{
real pr;
real x[ND_ND];
real y;
face_t f;
int j=0;
if(!Data_Valid_P()) /*check for the availability of data*/
return;
begin_f_loop(f, t)
{
F_CENTROID(x,f,t)
y=x[0]; /* the outlet line is horizontal and i need the x coordinate*/
if (y>-0.005 && y<0.001) /* there is a face centroid in this interior*/
{
F_PROFILE(f, t, i) = 100000; /* the desired value of the defined face cell*/
j=j+1;
}
else