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

mathematical function in UDF

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 14, 2007, 11:36
Default mathematical function in UDF
  #1
Abhijit
Guest
 
Posts: n/a
Dear All,

I have trying to run UDF interpreted or compiled to define velocity profile on a face thread. But unable to hook the udf. Please find below udf

#include "udf.h" #include "math.h"

DEFINE_PROFILE(velocity_profile, thread, position)

{

face_t f;

real t = RP_Get_Real("flow-time");

begin_f_loop(f, thread)

{

if(t>=5 & t<=10)

F_PROFILE(f, thread, position) = double pow (double t, double 2);

else

F_PROFILE(f, thread, position) = 25;

}

end_f_loop(f, thread)

}

The error message obtained for both the interpreted & compiled user defined functions are below

Error: C:\udf_inlet\trial.c: line 14: parse error.

(chdir "libudf")() (chdir "ntx86\2ddp")() 'nmake' is not recognized as an internal or external command, operable program or batch file. 'nmake' is not recognized as an internal or external command, operable program or batch file.

The probable reasons for malfunctioning of udf is the computation of t raised to power 2 using mathematical functions. Can anyone through more light on this & help

Thanking you, Abhijit

  Reply With Quote

Old   October 15, 2007, 02:18
Default Re: mathematical function in UDF
  #2
Kiran
Guest
 
Posts: n/a
There is a problem in the logical statement which you have written. if(t>=5 & t<=10) should be if(t>=5 && t<=10) Rgds
  Reply With Quote

Old   October 15, 2007, 03:19
Default Re: mathematical function in UDF
  #3
Abhijit
Guest
 
Posts: n/a
Thanks for your reply. I could solve the same udf with both the options in the logical statement considering different calculations to calculate the velocity.

But now I have changed on the below statement in the udf

F_PROFILE(f, thread, position) = double pow (double t, double 2);

I have also tried by placing global.h in working folder.

thanks & bye...abhijit

  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
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 05:37
Version 15 on Mac OS X gschaider OpenFOAM Installation 120 December 2, 2009 11:23
UDF for density as a function of something not necessarily temperature! rmousavibt FLUENT 0 May 12, 2009 10:12
Create an UDF function for defining a zone ... CFDNewbie FLUENT 0 July 18, 2007 14:19
UDF, about function int Data_Valid_P() Johnix FLUENT 0 April 7, 2002 01:51


All times are GMT -4. The time now is 08:36.