CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Check current time

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ngj

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   March 13, 2012, 03:43
Default Check current time
  #1
New Member
 
Jordi Muela
Join Date: Mar 2011
Posts: 27
Rep Power: 16
jordi.muela is on a distinguished road
Hi all,

I'm programming a new class for six DoF motion to allow socket comunication for cosimulation with other tool (exchanging force data..). And I'm having a trouble, how can I consult the current time value?

Now I'm doing a little (...big!) trick using system():

system("grep 'Time = ' log.interDyMFoam | tail -n 1 | sed 's/Time = //g' > calcTime");

and then I can read the time from file calcTime, but I thought must be a better and elegant way... I've taked a look to "timeVaryingUniformFixedValuePointPatchField" since this BC must consult the time to do the proper interpolation, and it looks like the solution must come from a function called db(), which is declared in "pointPatchField"... but I'm falling in black-hole of classes and I can't see the light. So please, if somebody can show me the way of do this I'll be very pleased!

Thanks!!

Best regards,

Jordi.

Edit: now I see that I've had a lapsus with thread title, I'm interested in the actual time, no in time step! Thanks! And sorry the mistake...

Last edited by jordi.muela; March 13, 2012 at 05:05.
jordi.muela is offline   Reply With Quote

 


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
Multiple floating objects CKH OpenFOAM Running, Solving & CFD 14 February 20, 2019 09:08
Set current time step tsram90 FLUENT 0 November 11, 2011 10:19
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 04:35
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07
How to read out time used for current solution Angelo Sozzi FLUENT 1 July 7, 2004 13:16


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