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

UDF interpreted

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Johannes Soulis

Reply
 
LinkBack Thread Tools Display Modes
Old   December 16, 2003, 05:28
Default UDF interpreted
  #1
Johannes Soulis
Guest
 
Posts: n/a
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) }
mm.abdollahzadeh likes this.
  Reply With Quote

Old   December 16, 2003, 06:49
Default Re: UDF interpreted
  #2
emma
Guest
 
Posts: n/a
as I remember, the "structure" date type can not be used in interpreted udf. Hope it helps.

Regards

Emma
  Reply With Quote

Old   December 16, 2003, 10:03
Default Re: UDF interpreted
  #3
ap
Guest
 
Posts: n/a
If you use such a kind of istruction, you have to use compiled UDF.

Hi

ap
  Reply With Quote

Old   December 21, 2003, 07:57
Default Re: UDF interpreted
  #4
Venkatesh
Guest
 
Posts: n/a
yes ap had answered to your questions.

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

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Problem of Fluent Interpreted UDF: parse error knight Fluent UDF and Scheme Programming 11 December 8, 2013 10:00
Interpreted UDF in parallel David Chabot Fluent UDF and Scheme Programming 8 May 30, 2012 03:18
compiled or interpreted udf Aireen FLUENT 11 August 25, 2005 00:54
Interpreted UDF Bikash FLUENT 8 September 1, 2004 02:30
error of Interpreted udf Zhang Junmei FLUENT 6 December 12, 2001 09:03


All times are GMT -4. The time now is 06:12.