CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Help with UDF

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 18, 2011, 15:00
Default Help with UDF
  #1
Member
 
Billy
Join Date: Jan 2011
Posts: 31
Rep Power: 7
skaboy607 is on a distinguished road
Hi

This is my first UDF and I keep getting a undeclared variable on line 13.

Any help would be appreciated.

Thanks

Will

#include "udf.h"

DEFINE_PROFILE(inlet_y_velocity, thread, index)
{
real x[ND_ND], y;
real t = CURRENT_TIME;
face_t f;

begin_f_loop(f, thread);
{
F_CENTROID(x, f, thread);
y = x[1];
F_PROFILE(f, thread, position) = 10*(1+0.3.0*sin(2.0*3.141592654*(20.0*t));
}
end_f_loop(f, thread);
}
skaboy607 is offline   Reply With Quote

Old   November 19, 2011, 10:37
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 15
Amir is on a distinguished road
Hi,

try this:
Quote:
F_PROFILE(f, thread, index) = 10*(1+0.3.0*sin(2.0*3.141592654*(20.0*t));
Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   November 19, 2011, 12:44
Default
  #3
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 992
Rep Power: 16
ghost82 will become famous soon enough
F_PROFILE(f, thread, position) = 10*(1+0.3.0*sin(2.0*3.141592654*(20.0*t)));


...is this an error?

I'm not an expert but you can try this:
F_PROFILE(f, thread, position) = 10.*(1.+0.3*sin(2.0*3.141592654*(20.0*t)));

Last edited by ghost82; November 19, 2011 at 18:27.
ghost82 is offline   Reply With Quote

Old   November 19, 2011, 13:11
Default
  #4
Member
 
Billy
Join Date: Jan 2011
Posts: 31
Rep Power: 7
skaboy607 is on a distinguished road
Hi

Yea that was a typo.

Changing it to index gives a parse error.

Thanks

Will
skaboy607 is offline   Reply With Quote

Old   November 19, 2011, 18:29
Default
  #5
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 992
Rep Power: 16
ghost82 will become famous soon enough
Edited message above: also a parenthesis was missing..
ghost82 is offline   Reply With Quote

Old   November 19, 2011, 20:56
Default
  #6
Member
 
Billy
Join Date: Jan 2011
Posts: 31
Rep Power: 7
skaboy607 is on a distinguished road
That sorted it, well it got it loaded into Fluent!
skaboy607 is offline   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 00:21.