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

how to get current time as scalar?

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

Like Tree3Likes
  • 3 Post By su_junwei

Reply
 
LinkBack Thread Tools Display Modes
Old   May 9, 2009, 22:08
Default how to get current time as scalar?
  #1
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Québec, QC, Canada
Posts: 200
Rep Power: 9
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, 07: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: 10
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
nimasam, McCarra and Sun like this.
su_junwei is offline   Reply With Quote

Old   May 10, 2009, 10:01
Default
  #3
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Québec, QC, Canada
Posts: 200
Rep Power: 9
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

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
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 28 May 28, 2015 13:37
Changing deltaT of current time step olwi OpenFOAM Running, Solving & CFD 1 April 30, 2009 04: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 12:38
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 01:23.