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

Generating a file for each time step

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By blackmask

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 21, 2013, 15:34
Default Generating a file for each time step
  #1
New Member
 
Raditya Wiranegara
Join Date: Aug 2009
Location: United Kingdom
Posts: 22
Rep Power: 17
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, 21:50
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
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, 23:34
Default
  #3
New Member
 
Raditya Wiranegara
Join Date: Aug 2009
Location: United Kingdom
Posts: 22
Rep Power: 17
radix is on a distinguished road
Cheers! It helps a lot
radix is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transient simulation not converging skabilan OpenFOAM Running, Solving & CFD 14 December 17, 2019 00:12
wmake compiling new solver mksca OpenFOAM Programming & Development 14 June 22, 2018 07:29
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 02:22
Doxygen documentation Tanay OpenFOAM Installation 9 September 23, 2011 12:40
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08


All times are GMT -4. The time now is 17:41.