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

Print

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 4, 2002, 14:07
Default Print
  #1
MON
Guest
 
Posts: n/a
Hi every body ! for my UDF (Define_source) i use several "printf()" for debugging. when my UDF is interpreted it work. but, when i run it i see nothing. how can i print things to screen. is there another way to debug an UDF? I work in (Pc win nt4, ntx86) of everybody? thanks and excuse my poor english ************************************************** *****#include"udf.h" #define mu 0.8 /*mu coefficient d<attenuation du spectre solaire*/ DEFINE_SOURCE(cell_Source,cell,thread,dS,eqn)

{

face_t f;

FILE *fichier;

double source,y,t,time[47],Hs[47];

real x[ND_ND];

int i;

y=x[1];

fichier= fopen("Source1.txt","r");/* read data file*/

t=((RP_Get_Real("flow-time"))/3600.);

printf("\n temp=%lf \n",t);

C_CENTROID(x,cell,thread);

for (i =0; i<48 ;i++)

fscanf(fichier,"%lf %lf",&time[i],&Hs[i]);

if ( (time[i] <= t) && (t < time[i+1]) )

{

source = 0.6 * Hs[i]* mu *exp(-mu*(2.2-y));

dS[eqn]=0; printf("\n\n i=%lf time=%lf Hs=%lf So=%lf \n",i,time[i],Hs[i],source); }

fclose(fichier);

return source;

}

  Reply With Quote

Old   October 7, 2002, 07:20
Default Re: Print
  #2
Keil
Guest
 
Posts: n/a
Hi,

The printf is invalid command on PC . You have to use message command. see below.

message("\n\n i=%lf time=%lf Hs=%lf So=%lf \n",i,time[i],Hs[i],source);

Regards,

Keil
  Reply With Quote

Old   October 8, 2002, 03:43
Default Re: Print
  #3
Keil
Guest
 
Posts: n/a
Oops!. the message is Message, m is a capital.

Keil

  Reply With Quote

Old   October 9, 2002, 11:13
Default Re: Print
  #4
MON
Guest
 
Posts: n/a
Hi Keil you can use printf or message to print things to screen . i found my mistake .(i shoud define C_CENTROID(x,cell,thread); in the loup if. Thank you very much
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
print position of Lagrangian particle? sven82 OpenFOAM Running, Solving & CFD 4 June 16, 2016 09:58
,newbie C++: how to print a matrix? mirko OpenFOAM Programming & Development 3 September 6, 2011 20:15
Print value to screen in user coding? Cb Siemens 1 September 30, 2005 08:29
How to Print Forces Akin FLUENT 1 September 9, 2005 13:26
PRINT VALUE FROM UDF Pravesh Kumar FLUENT 5 October 9, 2002 02:53


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