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

Compiling UDF

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 8, 2009, 12:55
Unhappy Compiling UDF
  #1
New Member
 
hossein
Join Date: Sep 2009
Posts: 1
Rep Power: 0
hosna is on a distinguished road
Hi everyone;
I have got kind of error when compiling a UDF file to fluent and the error when I try to built is:
C:\Program Files\microsoft visual studio\vc98\include\eh.h(32) : fatal error C1189: #error : "eh.h is only for C++!"
I also get error of the type:
Opening library "libudf"...
Error: open_udf_library: The system cannot find the file specified.

Error: open_udf_library: The system cannot find the file specified.
Error Object: #f
when I try to load the file. My UDF file is suppose to read some flow data (a text file has time, and volume rate data in matrix format and as you see I have to somehow define the matrix for C) and produce a fully developed velocity profile. you can see the file below. I will appreciate if anyone of you can help we where I have been working on this problem for some times.

#include "udf.h"
#include "iostream"
#include "fstream"
#include "string"
DEFINE_PROFILE(velocity_inlet, thread, index)
using namespace std;
int main()
{
face_t f;
real z[ND_ND];
real y;
real x;
real VOL;
real t = RP_Get_Real("flow-time");
#define row 40
#define col 10
FILE *p;
int i, j, loop = 0;
char buffer[10], ch;
float matrx [row][col];
for (i=0; i<row; i++)
for (j=0; j<col; j++)
matrx[i][j] = 0;

p = fopen("num.txt", "r");
if (p) {
ch = fgetc( p );
/* skip to start of record */
while( ((ch == '\n') || (ch == ' ')) && (ch != EOF) )
ch = fgetc( p );
if( ch == EOF ) return 0;
for(i=0; i<row; i++)
{
for(j=0; j<col; j++)
{

loop = 0;
/* read character */
while( (ch != '\n') && (ch != ' ') && (ch != EOF)) {
buffer[loop++] = ch;
ch = fgetc( p );
}

buffer[loop] = 0;
matrx[i][j] = atof( buffer );

if( ch == EOF ) break;
/* skip to start of next field */
while( ((ch == '\n') || (ch == ' ')) && (ch != EOF) )
ch = fgetc( p );
if( ch == EOF ) break;
}
if( ch == EOF ) break;
}

} else {
printf("File does not exist.\n");
}
fclose(p);
for (i=0; i<row; i++)
for (j=0; j<col; j++)
printf("%f\n", matrx[i][j]);
// system("PAUSE");
// return EXIT_SUCCESS;
return 0;
for (i=0; i<40; i++)
{
Ļif (fd[i][1]<=t && t=<fd[i+1][1]
{
VOL = fd[i][8]/fd[i][1];
}
}
begin_f_loop(f, thread)
{
F_CENTROID(z,f,thread);
y = z[0];
x = z[1];
F_PROFILE(f, thread, index) = VOL - VOL*((x*x)+(y*y))/(0.025*0.025)
}
end_f_loop(f, thread)
}
hosna 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
About UDF compiling issues: 'nmake' Haoyin Shan Fluent UDF and Scheme Programming 7 January 2, 2013 11:49
UDF compiling problem in Flient 6.3 jeevan kumar FLUENT 2 February 25, 2009 01:43
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
On Compiling a UDF David Chabot FLUENT 5 May 20, 2005 09:13
Discussing UDF and C++ Compiling Big Stone FLUENT 9 April 12, 2004 15:07


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