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

reconstruct certain time steps

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

Like Tree6Likes
  • 1 Post By olesen
  • 2 Post By Dohyun
  • 3 Post By s1291

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 12, 2011, 15:43
Default reconstruct certain time steps
  #1
Member
 
Join Date: Nov 2010
Posts: 54
Rep Power: 15
usergk is on a distinguished road
Hi

I have the time directories as 0, 0.001, 0.002 .... 0.499, 0.5 in the processors.

I want to reconstruct only 0, 0.05, 0.10, ... 0.40, 0.45, 0.50

I know one could individually generate these time directories, but is there a single statement that I could use to reconstruct at intervals of 0.05 instead of 0.001?

Thanks,
gk
usergk is offline   Reply With Quote

Old   February 14, 2011, 03:51
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,679
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by usergk View Post
Hi

I have the time directories as 0, 0.001, 0.002 .... 0.499, 0.5 in the processors.

I want to reconstruct only 0, 0.05, 0.10, ... 0.40, 0.45, 0.50

I know one could individually generate these time directories, but is there a single statement that I could use to reconstruct at intervals of 0.05 instead of 0.001?
There is no simple way to do this. The -times option can handle ranges, but doesn't handle step sizes (which can be a bit messy/fuzzy for non-integer values).
If you don't mind a small workaround:
Use a small Perl/Python/whatever program to generate the required list for you and then use it. For example,
Code:
reconstructPar $(myTimes) ...
where 'myTimes' would emit the required times list
Code:
-times 0,0.05,0.10,0.40,0.45,0.50
This might even prove more flexible for you than anything else that could be added to OpenFOAM.
EddySouth likes this.
olesen is offline   Reply With Quote

Old   February 14, 2011, 13:19
Default
  #3
Member
 
Join Date: Nov 2010
Posts: 54
Rep Power: 15
usergk is on a distinguished road
Thanks so much, Mark!

This looks quite convenient too.

gk
usergk is offline   Reply With Quote

Old   April 30, 2019, 13:22
Default
  #4
Member
 
Ramin
Join Date: Oct 2015
Posts: 33
Rep Power: 10
rmn_990 is on a distinguished road
It doesn't have to be a time range. You can do it with this command:
Quote:
reconstructPar -time 0,0.05,0.10,0.40,0.45,0.50
rmn_990 is offline   Reply With Quote

Old   December 9, 2021, 03:30
Default floating point loop command
  #5
New Member
 
Dohyun Kim
Join Date: Jul 2021
Posts: 2
Rep Power: 0
Dohyun is on a distinguished road
I've solved this problem using a loop command in linux terminal as below.
The range from 36 to 38, with time interval 0.05.

Code:
for t in $(seq 36 .05 38); do reconstructPar -time $t; done
Behradskn and skaal like this.
Dohyun is offline   Reply With Quote

Old   December 9, 2021, 05:14
Default
  #6
Member
 
s1291's Avatar
 
Join Date: Aug 2017
Location: Algeria
Posts: 98
Rep Power: 8
s1291 is on a distinguished road
Without using an explicit for loop, try:

Code:
reconstructPar -time $(seq -s ',' 0 0.05 0.5)
quarkz, Dohyun and skaal like this.
__________________
"When in doubt, use brute force." -- Ken Thompson
s1291 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 05:35
Time Steps gets smaller and smaller titio OpenFOAM Running, Solving & CFD 1 July 22, 2009 09:19
UDF for time steps David FLUENT 0 August 14, 2007 12:54
Time steps - Large Eddy - LES Gernot FLUENT 0 September 14, 2005 12:54
Number of time steps in fluent 4-NT Newbie FLUENT 0 March 24, 2001 14:44


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