CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   Fluent UDF for Micro Flow Face Slip Velocity (

daniel_george_carter May 12, 2013 05:39

Fluent UDF for Micro Flow Face Slip Velocity
I am trying to implement a slip condition in a UDF with the following code, I am just unsure of how to actually write the slip velocity expression, can anybody help?

/************************************************** *********************
Slip velocity profile
************************************************** **********************/
#include "udf.h"

DEFINE_PROFILE(wall_slip, thread, position)
double xf[ND_ND]; /* this will hold the face centroid position */
double xc[ND_ND]; /* this will hold the cell centroid position */
double rUF;
double rUC;
double rRho,rT;

/*face in the thread */
face_t f;
/*cell in the thread */
cell_t c0;
/*thread pointer */
Thread *t0;

#define PI 3.14159265358979323846 /* number pi */
#define Boltzmann 1.3806505e-23 /* Boltzmann constant */
#define SQRT_2 1.41421356237309504880 /* sqrt(2) */
#define SpHR 1.4 /* specific heat ratio; Air
#define sigma 1 /* sigma(molecule diameter) */

/*loop over all faces in the thread*/
begin_f_loop(f, thread)
/*Get current face centroid */
/*Find cell attached to current face */
c0 = F_C0(f,thread);
/*Find thread containing this cell*/
t0 = F_C0_THREAD(f,thread);
/*Get adjacent cell centroid */
/*Get velocity in the adjacent cell*/
/*Get density in the current face cell*/
/*Get temperature in the current face cell*/
/*compute face velocity*/
/* You can print values to the fluent window, for example */
printf("Face center: %e Cell Center: %e\n",xf[1],xc[1]);

/* set the current value to be returned for this face */
F_PROFILE(f, thread, position) = rUF;

end_f_loop(f, thread)

All times are GMT -4. The time now is 16:47.