CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF help (https://www.cfd-online.com/Forums/fluent/42455-udf-help.html)

Matt October 4, 2006 04:20

UDF help
 
do i need to install C++ compiler on my pc to compile my UDFs. regards...

M. ZAKI October 4, 2006 07:47

Re: UDF help
 
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

Matt October 4, 2006 07:52

Re: UDF help
 
Thanxs ZAKI, appreciated...


Matt October 4, 2006 08:09

Re: UDF help
 
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: ()


Matt October 4, 2006 08:33

Re: UDF help
 
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; }


M. ZAKI October 6, 2006 10:00

Re: UDF help
 
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.;

}

Matt October 7, 2006 01:53

Re: UDF help
 
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; }


Matt October 7, 2006 06:50

Re: UDF help
 
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.


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