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

how to get current time as scalar?

Register Blogs Community New Posts Updated Threads Search

Like Tree37Likes
  • 34 Post By su_junwei
  • 3 Post By louisgag

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2009, 23:08
Default how to get current time as scalar?
  #1
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Hi,


I am trying to get something like sin(time().timeName()) but timeName is of type word and I couldn't find a scalar equivalent..

Anmyone has a simple solution to this?

thanks!

-Louis
louisgag is offline   Reply With Quote

Old   May 10, 2009, 08:50
Default runTime.value()
  #2
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 20
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Hi Louis

just test

//read from runTime
scalar t=runTime.value();

//read from a field ,for example U
scalar t=U.mesh().time().value() ;

//read from mesh
scalar t=mesh.time().value();

Junwei
su_junwei is offline   Reply With Quote

Old   May 10, 2009, 11:01
Default
  #3
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Hi Junwei,

thanks for the help. I got it working with time().value()

-Louis
louisgag 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
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 32 June 16, 2021 07:55
Changing deltaT of current time step olwi OpenFOAM Running, Solving & CFD 1 April 30, 2009 05:55
SimpleFoam k and epsilon bounded nedved OpenFOAM Running, Solving & CFD 1 November 25, 2008 21:21
FSI time YY CFX 0 April 25, 2008 13:38
How to read out time used for current solution Angelo Sozzi FLUENT 1 July 7, 2004 14:16


All times are GMT -4. The time now is 12:18.