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

UDF compiled error, please help

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 6, 2006, 21:43
Default UDF compiled error, please help
  #1
GBLiu
Guest
 
Posts: n/a
Hi all, i use windows and microsoft visual studio .net 2003 on my system,and i start the fluent according to Ravi's suggestion:

STEP 1: Place the source file in the folder which contain case & data file (place it in C-Drive) [Create a new folder in C-Drive and place the case and data files and the Source file (.c file)]

STEP 2: Start --> All Programs --> Microsoft Visual Studio .NET 2003 --> Visual Studio .NET Tools --> Visual Studio .NET 2003 Command Prompt (it opens a command prompt)

STEP 3: In the command prompt browse the folder in which the case & data files and the source files are placed

STEP 4: Type "fluent 2ddp &" (it opens FLUENT console)

STEP 5: File --> Read --> Case & Data Files (browse for the case and data files)

STEP 6: Define --> User-Defined --> Functions --> Compiled

STEP 7: Add the source files and click BUILD

However,there are some errors in the file udf_names.c generated automatically, the error information are below:

"# Generating udf_names.c because of makefile case.obj udf_names.c

udf_names.c(7) : error C2059: syntax error : "}"

udf_names.c(8) : warning C4034: sizeof return 0 "

then i check this file udf_names.c, its content is :

"/* This file generated automatically. */

/* Do not modify. */

#include "udf.h"

#include "prop.h"

#include "dpm.h"

__declspec(dllexport) UDF_Data udf_data[] = {

}; ==c(7) : error C2059: syntax error : "}"==

__declspec(dllexport) int n_udf_data =sizeofudf_data)/sizeof(UDF_Data);

#include "version.h"

__declspec(dllexport) void UDF_Inquire_Release(int *major, int *minor, int *revision)

{

*major = RampantReleaseMajor;

*minor = RampantReleaseMinor;

*revision = RampantReleaseRevision;

}"

so i don't know what's wrong with the automatically generated file "udf_names.c", and i can not load the library. And i try this process by a very simple source file, and it content is:

#include "udf.h"

DEFINE_SOURCE(cell_uds4_source,c,t,ds,eqn)

{

double source,dt,temp1,temp2,ct;

source=0.0;

return source;

}

i still get the same error information, please kindly help me, bilons of thanks.

GBLiu

  Reply With Quote

Old   June 7, 2006, 07:02
Default Re: UDF compiled error, please help
  #2
Miri
Guest
 
Posts: n/a
Hello try using real insead of double
  Reply With Quote

Old   June 7, 2006, 07:07
Default Re: UDF compiled error, please help
  #3
adriano
Guest
 
Posts: n/a
to build the library it is important that your case file is in the same directory of your UDF file (i.e.: udf.c).

in your case there are any sintax error

(udf_names.c(7) : error C2059: syntax error : "}" )

udf_names.c(8) : warning C4034: sizeof return 0 "

)

First u must delete them! It may helpfull. Regards

Adriano
  Reply With Quote

Old   June 7, 2006, 07:24
Default Re: UDF compiled error, please help
  #4
GBLiu
Guest
 
Posts: n/a
thanks Miri and adriano for your precious help, first:I change the double to real, and use Fluent 6.1.22 version not the 6.2.16 version, the error mentioned above disappeared, but the new error appeared:"..\..\src\udf.h(47) : fatal error C1083: Cannot open include file: 'six_dof.h': No such file or directory"; second: I am sure that my case file and my udf.c file in the same direction, and the problem is these errors are related to the automatically generated file "udf_names.c" not my own udf file. please help me!

GBliu
  Reply With Quote

Old   June 7, 2006, 21:31
Default Re: UDF compiled error, please help
  #5
GBLiu
Guest
 
Posts: n/a
At the moment, the problem is solved, thanks all. my enviromental variables are ok, but my own UDF file is not written regularly, it is the error sources, so the C compiler can not correctly compile it. thanks again! GBLiu
  Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 22:38
I want to use pressure of 1 face in udf that compiled on other face iman_1844 Fluent UDF and Scheme Programming 3 June 10, 2010 13:55
Why udf can not be compiled in my pc? Xinqiang FLUENT 0 June 10, 2009 15:32
difference between udf compiled and udf interprete chandra sekhar FLUENT 2 April 11, 2006 01:04
how to quit compiled or interprited UDF tian FLUENT 0 April 9, 2003 00:53


All times are GMT -4. The time now is 09:50.