CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF interpreted (

Johannes Soulis December 16, 2003 05:28

UDF interpreted
Hello, everybody

I have tried to compile the following source code (as interpreted code) in Fluent 6.0. It is given as an example UDF by Fluent but the statement t0 = t->t0; is not recognised by the compiler. The comment it gives is: "line 25: structure reference not implemented". Please, give me some help. Thank you.

Johannes Soulis Greece

#include "udf.h"

DEFINE_PROFILE(coupled_uds, t, position)

{ real C1_COORD[ND_ND]; real C0_COORD[ND_ND]; real F_COORD[ND_ND]; real x0[ND_ND],x1[ND_ND],Area[ND_ND],DIFF0,DIFF1,y; real Coef0,Coef1; real e_x0[ND_ND],e_x1[ND_ND];

cell_t c0; cell_t c1; Thread *t0; Thread *t1; face_t f;

real A0,A1,dx0,dx1;

begin_f_loop(f, t)

{ c0 = F_C0(f, t); c1 = F_C1(f, t); t0 = t->t0; t1 = t->t1; C_CENTROID(C0_COORD, c0, t0); C_CENTROID(C1_COORD, c1, t1); F_CENTROID(F_COORD, f, t); NV_VV(x0, =, F_COORD, -, C0_COORD); dx0 = NV_MAG(x0); NV_VV(x1, =, F_COORD, -, C1_COORD); dx1 = NV_MAG(x1);

NV_VS(e_x0, =, x0, /, dx0); /* e_x0 is the unit vector */ NV_VS(e_x1, =, x1, /, dx1); /* e_x1 is the unit vector */

F_AREA(Area, f, t); Coef0 = (dx0 * NV_MAG(Area))/NV_DOT(Area,e_x0); Coef1 = (dx1 * NV_MAG(Area))/NV_DOT(Area,e_x1);

Coef0 = sqrt(Coef0*Coef0); Coef1 = sqrt(Coef1*Coef1);

DIFF0 = C_UDSI_DIFF(c0,t0,0); DIFF1 = C_UDSI_DIFF(c1,t1,0);

A0 = DIFF0/Coef0; A1 = DIFF1/Coef1;

y = (A0 * C_UDSI(c0,t0,0) + A1 * C_UDSI(c1,t1,0)) / (A0 + A1);

F_PROFILE(f, t, position) = y;

} end_f_loop(f, t) }

emma December 16, 2003 06:49

Re: UDF interpreted
as I remember, the "structure" date type can not be used in interpreted udf. Hope it helps.



ap December 16, 2003 10:03

Re: UDF interpreted
If you use such a kind of istruction, you have to use compiled UDF.

Hi :)


Venkatesh December 21, 2003 07:57

Re: UDF interpreted
yes ap had answered to your questions.

When you are using interpreted UDF's you cannt use the by accessing memory.

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