CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   compiler (http://www.cfd-online.com/Forums/fluent/29903-compiler.html)

stephanie June 14, 2002 08:04

compiler
 
Hello dear Fluent Users,

I am a new user of Fluent and I would like to compile the following source programm in fluent 6.0.

-------------------------------------------------------

#include "udf.h"

DEFINE_SOURCE(cell_x_source,cell,thread,dS,eqn) {

float source;

double C,A,dh,S2,S1,SpeedValue,T;

SpeedValue=sqrt(C_U(cell,thread)*C_U(cell,thread)+ C_V(cell,thread)*C_V(cell,thread)+C_W(cell,thread) *C_W(cell,thread));

T = 300.;

C = 1000 ;

A = 0.2;

dh = 0.001;

S2 = pow(C*(C_R(cell,thread)*SpeedValue*dh/C_MU_L(cell,thread)),A);

S1 = T*S2;

source = S1-S2*C_T(cell,thread);

return source;

}

-------------------------------------------------------

With cpp I obtain the following error:

cpp -I/usr2/fluent_6012/Fluent.Inc/fluent6.0/src -I/usr2/fluent_6012/Fluent.Inc/fluent6.0/cortex/src -I/usr2/fluent_6012/Fluent.Inc/fluent6.0/client/src -I/usr2/fluent_6012/Fluent.Inc/fluent6.0/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" source.csh: cpp: not found

Error: source.c: line 1: Syntax error.

-------------------------------------------------------

And with cc:

cc -I/usr2/fluent_6012/Fluent.Inc/fluent6.0/src -I/usr2/fluent_6012/Fluent.Inc/fluent6.0/cortex/src -I/usr2/fluent_6012/Fluent.Inc/fluent6.0/client/src -I/usr2/fluent_6012/Fluent.Inc/fluent6.0/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" source.cNo such feature exists (-5,116:2) No such file or directory

The MIPSpro C Compiler (license FEATURE string = cc) requires a license password.

For license installation and trouble shooting information visit the web page:

http://www.sgi.com/Support/Licensing/install_docs.html

To obtain a Permanent license (proof of purchase required) or an Evaluation license please visit our license request web page:

http://www.sgi.com/Products/license.html

or send a blank email message to:

license@sgi.com

In North America, Silicon Graphics' customers may request Permanent licenses by sending a facsimile to:

(650) 932-0537

or by calling our technical support hotline

1-800-800-4SGI

If you are Outside of North America or you are not a Silicon Graphics support customer then contact your local support provider.

ld32: ERROR 33 : Unresolved text symbol "main" -- 1st referenced by /usr/lib32/mips4/crt1.o.

Use linker option -v to see when and which objects, archives and dsos are loaded. ld32: ERROR 33 : Unresolved text symbol "sqrt" -- 1st referenced by source.o.

Use linker option -v to see when and which objects, archives and dsos are loaded. ld32: ERROR 33 : Unresolved text symbol "pow" -- 1st referenced by source.o.

Use linker option -v to see when and which objects, archives and dsos are loaded. ld32: INFO 152: Output file removed because of error. Error: source.c: line 1: Syntax error.

-------------------------------------------------------

Has somebody an idea what the problem could be?

Damien June 14, 2002 10:23

Re: compiler
 
Voilą ! ----------------- #include "udf.h"

DEFINE_SOURCE(cell_x_source,cell,thread,dS,eqn)

{

real source;

real C,A,dh,S2,S1,SpeedValue,T;

SpeedValue=sqrt(C_U(cell,thread)*C_U(cell,thread)+ C_V(cell,thread)*C_V(cell,thread)+C_W(cell,thread) *C_W(cell,thread));

T = 300.; C = 1000. ; A = 0.2; dh = 0.001; S2 = pow(C*(C_R(cell,thread)*SpeedValue*dh/C_MU_L(cell,thread)),A); S1 = T*S2; source = S1-S2*C_T(cell,thread); dS[eqn]=-S2; return source;

} ------------------- It works for me, and you? I used it as a compiled UDF, I'm not sure if you are trying to use Interpreted UDF. I prefer to avoid it, especially if its to use it every iteration. I just changed float and double by real. and added the dS[eqn] sequence

I hope it helps

Kind Regards

Damien

stephanie June 19, 2002 07:49

Re: compiler
 
Salut Damien,

I could compile the programm. Thank you for your help.

Salutations,

Stephanie


All times are GMT -4. The time now is 18:08.