|
[Sponsors] |
October 14, 2007, 12:36 |
mathematical function in UDF
|
#1 |
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 |
|
October 15, 2007, 03:18 |
Re: mathematical function in UDF
|
#2 |
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
|
|
October 15, 2007, 04:19 |
Re: mathematical function in UDF
|
#3 |
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 |
|
|
|
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 | 113 | December 2, 2009 11:23 |
UDF for density as a function of something not necessarily temperature! | rmousavibt | FLUENT | 0 | May 12, 2009 11:12 |
Create an UDF function for defining a zone ... | CFDNewbie | FLUENT | 0 | July 18, 2007 15:19 |
UDF, about function int Data_Valid_P() | Johnix | FLUENT | 0 | April 7, 2002 02:51 |