CFD Online Discussion Forums

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

Marijo November 3, 2006 15:39

UDF problem
 
Hi,

How can I print a value that is calculated in the UDF? Something with print command in the UDF?

Thank you.

C. H. November 3, 2006 16:43

Re: UDF problem
 
print in file or on screen? There are of course other and maybe better possibilities but within my UDF's it works.

screen: Message0("Your Text %20.13e \n", Variable); %20.13e is the format for the value that would be written at this place. 20 is the whole length and 13 is the amount of numbers after . and e means it is written in 3.0000000000000e-03 for example. You can also use %f for a float number or %i for an integer. \n is End of line

file: File *pointer_to_file; pointer_to_file = fopen("test.dat", "w"); fprintf(pointer_to_file, "Text in file %20.13e \n", Variable); fclose(pointer_to_file);


All times are GMT -4. The time now is 07:00.