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

UDF help

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 4, 2006, 04:20
Default UDF help
  #1
Matt
Guest
 
Posts: n/a
do i need to install C++ compiler on my pc to compile my UDFs. regards...
  Reply With Quote

Old   October 4, 2006, 07:47
Default Re: UDF help
  #2
M. ZAKI
Guest
 
Posts: n/a
yes i think you should

If you are working on WINDOWS and installed Microsoft Visual studios.NET then,

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 &" (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 and then click LOAD
  Reply With Quote

Old   October 4, 2006, 07:52
Default Re: UDF help
  #3
Matt
Guest
 
Posts: n/a
Thanxs ZAKI, appreciated...

  Reply With Quote

Old   October 4, 2006, 08:09
Default Re: UDF help
  #4
Matt
Guest
 
Posts: n/a
After I compile and load, i am getting the messages below... thanx much...

The system cannot find the file specified. (system "copy C:\Fluent.Inc\fluent6.2.16\src\makefile_nt.udf libudf\ntx86\3d\makefile") 1 file(s) copied. 0 (chdir "libudf")() (chdir "ntx86\3d")()

Done. "c:/cfd/avtoyarus"

Opening library "libudf"... Error: open_udf_library: The system cannot find the file specified.

Error Object: ()

  Reply With Quote

Old   October 4, 2006, 08:33
Default Re: UDF help
  #5
Matt
Guest
 
Posts: n/a
I tried to compile my simple UDF by C++ compiler and I am getting the message below:

myudf.cpp(7) : fatal error C1083: Cannot open include file: 'udf.h': No such file or director

my UDF is listed below:

#include "stdafx.h"

#include "myudf.h"

#include "udf.h"

DEFINE_SOURCE(energy_source,c,t,dS,eqn) {

real time = CURRENT_TIME;

real source = 100. * time; /* units of Watts/m3 */

dS[eqn] = 0.;

return source; }

  Reply With Quote

Old   October 6, 2006, 10:00
Default Re: UDF help
  #6
M. ZAKI
Guest
 
Posts: n/a
try it like this:

#include "udf.h"

DEFINE_SOURCE(energy_source,c,t,dS,eqn)

{

real time, source;

time = CURRENT_TIME;

source = 100. * time; /* units of Watts/m3 */

dS[eqn] = 0.;

}
  Reply With Quote

Old   October 7, 2006, 01:53
Default Re: UDF help
  #7
Matt
Guest
 
Posts: n/a
thank u so much for helping out ZAKI...

I am still getting the same error message. I am trying to compile my simple source file myudf.c by c++ visual compiler and compiler can not find udf.h

here is my simple udf

#include "udf.h"

DEFINE_SOURCE(energy_source,c,t,dS,eqn)

{

real time = CURRENT_TIME;

real source = 100. * time; /* units of Watts/m3 */

dS[eqn] = 0.;

return source; }

  Reply With Quote

Old   October 7, 2006, 06:50
Default Re: UDF help
  #8
Matt
Guest
 
Posts: n/a
ok, finally it worked by interpreter, compiling still does not work..,

now in my simple project, i am having this energy source and supposedly smoke as well (i will try to add mass source to my sub_volume as well).

however, my main challenge is to start the fan after two minutes of the fire start, how can i write this simple UDF, i am beginner in C so any help, advice would be much appreciated... best regards.
  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 10:18.