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

storing and using a volVectorField from last timestep and the timestep before

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2015, 22:10
Default storing and using a volVectorField from last timestep and the timestep before
  #1
Member
 
Join Date: Jul 2012
Posts: 67
Rep Power: 13
Carlen is on a distinguished road
Hi foamers,

I am wondering if I could store a volVectorField for two consecutive previous timesteps and call it at current timestep. I know that I can output such a field at every time step using IOobject, but this is not efficient especially when I need to run thousands of steps.

Does anyone know if OpenFoam has the similar function of C_UDSI_M1 and C_UDSI_M2 in Fluent? How can I implement such a procedure.

Thank you in advance,
carlen
Carlen is offline   Reply With Quote

Old   April 2, 2015, 00:51
Default
  #2
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Dear Carlen,

This is very interesting query

Please consider my comment as a hint (it's my guess/way of solving). I may not be very specific.

Try defining a counter which varies from 0 to 1. where 1 refers to previous iteration value and 0 refers to a value before previous iteration. Assign volVectorField variables for the respective counters. Access these variables inside your code.

-
Best Luck!

Last edited by Tushar@cfd; April 2, 2015 at 02:12.
Tushar@cfd is offline   Reply With Quote

Old   April 2, 2015, 04:54
Default
  #3
Member
 
Join Date: Jul 2012
Posts: 67
Rep Power: 13
Carlen is on a distinguished road
Thanks Tushar,

I manged to solve this problem by using e.g. U.oldTime() for the last timestep and U.oldTime().oldTime() for the timestep before last.

kind regards,
carlen
Carlen is offline   Reply With Quote

Old   April 3, 2015, 00:39
Default
  #4
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Quote:
Originally Posted by Carlen View Post
Thanks Tushar,

I manged to solve this problem by using e.g. U.oldTime() for the last timestep and U.oldTime().oldTime() for the timestep before last.

kind regards,
carlen
Dear Carlen,

Thanks for sharing these information of inbuilt OpenFOAM functions with all.


-
Best Regards!
Tushar@cfd 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



All times are GMT -4. The time now is 13:06.