CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   udf problem (https://www.cfd-online.com/Forums/fluent-udf/101496-udf-problem.html)

hillator May 5, 2012 06:41

udf problem
 
i try to write a udf that detemenie the bondury condithions and u and v (x y vilocities)
how can i do it?
i wrote the folloing file:
Code:

/**********************************************************************
unsteady.c
UDF for specifying a transient velocity profile boundary condition
***********************************************************************/
#include"udf.h"
DEFINE_PROFILE(unsteady_velocity, thread, position) { 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, position) = -0.06*y*y+0.06*y; F_PROFILE1(f, thread, position)=-1; } end_f_loop(f, thread)}

and it written to me: F_PROFILE1: undeclared variable
where i need to declared this variable?
thanks for the help
hilla

hillator May 5, 2012 07:24

when i try to write it that way:
Code:

 
/**********************************************************************
unsteady.c
UDF for specifying a transient velocity profile boundary condition
***********************************************************************/
#include"udf.h"
DEFINE_PROFILE(unsteady_velocity, thread, position) { 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, position) = -0.06*y*y+0.06*y; } end_f_loop(f, thread)}
DEFINE_PROFILE_y(unsteady_velocity_y, thread, position) { 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_y(f, thread, position) = -1; } end_f_loop(f, thread)}

it's write to me "syntax error"

duri May 5, 2012 09:10

DEFINE_PROFILE and F_PROFILE are predefined macros, you cannot change as you wish. If you need a new profile change the first argument of DEFINE_PROFILE and hook it appropriately.


All times are GMT -4. The time now is 05:07.