CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Generating a file for each time step (http://www.cfd-online.com/Forums/fluent-udf/121103-generating-file-each-time-step.html)

radix July 21, 2013 14:34

Generating a file for each time step
 
Hi Everyone,

I am working on a transient case and using a UDF with DEFINE_EXECUTE_AT_END macro. As I understand, the macro will execute the command or function at the end of each time step.

For my case,I want a file to be generated for each time step;i.e. let's say the file name is data.txt, I want the file to be data-(CURRENT_TIME).txt. Is it possible? Can anyone here help?

Thank you.

Radit

blackmask July 21, 2013 20:50

Code:

char filename[100];
sprintf(filename, "data-(%.3f).txt", CURRENT_TIME);


radix July 21, 2013 22:34

Cheers! It helps a lot :)


All times are GMT -4. The time now is 02:23.