CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Generating a file for each time step

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

Like Tree1Likes
  • 1 Post By blackmask

Reply
 
LinkBack Thread Tools Display Modes
Old   July 21, 2013, 14:34
Default Generating a file for each time step
  #1
New Member
 
raditya yudha
Join Date: Aug 2009
Posts: 11
Rep Power: 7
radix is on a distinguished road
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
radix is offline   Reply With Quote

Old   July 21, 2013, 20:50
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 315
Rep Power: 12
blackmask will become famous soon enough
Code:
char filename[100];
sprintf(filename, "data-(%.3f).txt", CURRENT_TIME);
radix likes this.
blackmask is offline   Reply With Quote

Old   July 21, 2013, 22:34
Default
  #3
New Member
 
raditya yudha
Join Date: Aug 2009
Posts: 11
Rep Power: 7
radix is on a distinguished road
Cheers! It helps a lot
radix is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
wmake compiling new solver mksca OpenFOAM Programming & Development 13 August 18, 2014 22:26
what is swap4foam ?? AB08 OpenFOAM 27 July 1, 2013 09:17
Doxygen documentation Tanay OpenFOAM Installation 9 September 23, 2011 11:40
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08
Transient simulation not converging skabilan OpenFOAM Running, Solving & CFD 12 September 17, 2007 17:48


All times are GMT -4. The time now is 08:30.