CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   Generating a file for each time step (

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.


blackmask July 21, 2013 20:50


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 16:10.