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

Whar's the error in my UDF?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 6, 2005, 02:47
Default Whar's the error in my UDF?
  #1
Jason
Guest
 
Posts: n/a
My udf is v=function(y,z,t). The err mesage is invalid type for pointer dereference: int. Anybody help me? Thanks!

/************************************************** ********************

unsteady.c UDF for specifying a transient velocity profile boundary condition

************************************************** *********************/

#include "udf.h"

DEFINE_PROFILE(unsteady_velocity, thread, position)

{

face_t f;

real t = CURRENT_TIME;

real y, z, rr, rd, D, t, x[ND_ND] ;

D=0.006 ;

begin_f_loop(f, thread)

{

F_CENTROID(x, f, thread);

y=x[1];

z=x[2];

rr=sqrt(y**2+z**2)

rd=rr*rr/D*D

if(t1>=0 && t1<=0.2)

F_PROFILE(f, thread, position) = 2*(2*t)*(1-

4*rd) ;

else

if(t1>0.2 && t1<=0.4)

F_PROFILE(f, thread, position) = 2*(3*t)*(1-

4*rd)

}

end_f_loop(f, thread)

}

  Reply With Quote

Old   April 6, 2005, 05:08
Default Re: Whar's the error in my UDF?
  #2
P
Guest
 
Posts: n/a
Where did you define t1? Can you also give the details of the error message?
  Reply With Quote

Old   April 6, 2005, 06:40
Default Re: Whar's the error in my UDF?
  #3
Jason
Guest
 
Posts: n/a
Hi,

The UDF is describe the 3-d fully-developed flow. And the velocity is changed with time v=function(y,z,t). I think the problem is about how to define the z-coodinate.

/************************************************** ********************

unsteady.c UDF for specifying a transient velocity profile boundary condition

************************************************** *********************/

#include "udf.h"

DEFINE_PROFILE(unsteady_velocity, thread, position)

{

face_t f;

real t = CURRENT_TIME;

real y, z, rr, rd, D, t, x[ND_ND] ;

D=0.006 ;

begin_f_loop(f, thread)

{

F_CENTROID(x, f, thread);

y=x[1];

z=x[2];

rr=sqrt(y**2+z**2)

rd=rr*rr/D*D

if(t>=0 && t<=0.2)

F_PROFILE(f, thread, position) = 2*(2*t)*(1-

4*rd) ;

else

if(t>0.2 && t<=0.4)

F_PROFILE(f, thread, position) = 2*(3*t)*(1-

4*rd)

}

end_f_loop(f, thread)

}

  Reply With Quote

Old   April 6, 2005, 06:57
Default Re: Whar's the error in my UDF?
  #4
P
Guest
 
Posts: n/a
Does it give some error message can you cut and paste those error message. Only then it will be possible for us to help u P
  Reply With Quote

Old   April 6, 2005, 10:34
Default Re: Whar's the error in my UDF?
  #5
Jason
Guest
 
Posts: n/a
The error message: Error: D:\fluent\CASE\pulmonary\v1.c: line 24: invalid type for pointer dereference: int.

/************************************************** ********************

unsteady.c

UDF for specifying a transient velocity profile boundary condition

************************************************** *********************/

#include "udf.h"

DEFINE_PROFILE(unsteady_velocity, thread, position)

{

face_t f;

real t = CURRENT_TIME;

real y, z, rr, rd, D, x[ND_ND] ;

D=0.006 ;

begin_f_loop(f, thread)

{

F_CENTROID(x, f, thread);

y=x[1];

z=x[2];

rr=sqrt(y**2+z**2)

rd=rr*rr/D*D

if(t>=0 && t<=0.2)

F_PROFILE(f, thread, position) = 2*(6.945*t)*(1-4*rd) ;

else

if(t>0.2 && t<=0.4)

F_PROFILE(f, thread, position) = 2*(4.23*t+0.543)*(1-4*rd) ;

}

end_f_loop(f, thread)

}

  Reply With Quote

Old   April 13, 2005, 05:43
Default Re: Whar's the error in my UDF?
  #6
saghir
Guest
 
Posts: n/a
salut si t est un variable globale temps il faut le definir comme CURRENT_TIME toi
  Reply With Quote

Old   April 21, 2005, 19:19
Default Re: Whar's the error in my UDF?
  #7
pUl|
Guest
 
Posts: n/a
English
  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
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
Dynamic Mesh UDF Qureshi FLUENT 1 December 2, 2009 01:27
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


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