CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   printing values from udf!!! (http://www.cfd-online.com/Forums/fluent/32837-printing-values-udf.html)

Shekhar January 13, 2004 05:50

printing values from udf!!!
 
how can i print the values returned by an udf in the fluent console window.....i want to check whether my udf is giving the correct values or not... hi:) shekhar

Manoj January 13, 2004 10:16

Re: printing values from udf!!!
 
you can write in your udf the printf statement as you do in C programming. it will print whatever values you want.

ap January 13, 2004 12:49

Re: printing values from udf!!!
 
You can use the command:


Message ("Text %g \n", var_name);


where:


- Text is a string.

- %g is the placeholder where the value of the variable var_name will be written. %g is for real values, if you want to write an integer (int) value, use %d.

- \n is the new line command.


For example, if you want to write two variables i (int) and s (real), viewing something like this in the console:

"The value of i is 9 and the value of s is 3.5."

you have to write the command:

Message("The value of i is %d and the value of s is %g\n",i,s);

Hi :)

ap


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