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

read wall-time, cpu-time etc from udf

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By gernzn

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 24, 2018, 11:20
Default read wall-time, cpu-time etc from udf
  #1
New Member
 
DS
Join Date: May 2016
Posts: 28
Rep Power: 9
denis.sanga@hotmail.it is on a distinguished road
Goodmorning,

I would use the output parameters as "time/iter" and variables obtained with /parallel/timer/usage command as "Average wall-clock time per iteration", "Total-clock time" etc in my UDF.

Do someone know how to import that parameters in UDF?

Thank you very much
Best Regards
DS
denis.sanga@hotmail.it is offline   Reply With Quote

Old   September 28, 2018, 06:31
Default
  #2
New Member
 
Gernot Pongratz
Join Date: Aug 2018
Posts: 1
Rep Power: 0
gernzn is on a distinguished road
Hi Denis!

What I did is defining a UNIX-timestamp as an User Defined Report Definition. Put following code in a ".c" file and compile it in your fluent (make sure, you have VisualStudio installed). You can then make a User Defined Report Definition with the function "getSystemTime" and write a UNIX time stamp for every saved data-set in an output file. When you copy the output file in a Excel-Sheet and format the column with the timestamp like "DD.MM.YYYY hh:mm:ss" you get time and can calculate the time-difference between your iterations. If you don't get your time, you might be in another timezone. In that case, change the code like follows: timestamp = (now + <hoursOfTimezoneDifference> * 3600) / 86400.0 + 25569.0;

Hope that did help.

#include <udf.h>
#include<time.h>

DEFINE_REPORT_DEFINITION_FN(getSystemTime)
{
time_t now;
double timestamp;

time(&now);

timestamp = now / 86400.0 + 25569.0;

return timestamp;
}
hesamna likes this.
gernzn is offline   Reply With Quote

Reply

Tags
cpu-time, udf, wall-time


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
[General] Extracting ParaView Data into Python Arrays Jeffzda ParaView 30 November 6, 2023 21:00
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 04:13
GenerateVolumeMesh Error - Surface Wrapper Self Interacting (?) AndreP STAR-CCM+ 10 August 2, 2018 07:48
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 07:56
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58


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