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

How to delete the same time folder in different processors folder

Register Blogs Community New Posts Updated Threads Search

Like Tree11Likes
  • 2 Post By shock77
  • 1 Post By chandra shekhar pant
  • 5 Post By AndreasPe
  • 1 Post By olesen
  • 1 Post By AndreasPe
  • 1 Post By AndreasPe

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 2, 2021, 04:44
Default How to delete the same time folder in different processors folder
  #1
Senior Member
 
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16
chandra shekhar pant is on a distinguished road
Hello All,

I am running a OpenFOAM case in 50 processors, now I wanted to delete a time folder (say 0.5) from all the folders to save the memory. Earlier for less number of processors I used a very common/basic command to delete that specific file 0.5 by running the following command for each processor
Code:
rm -r 0.5
But now since the number of processors are larger (50), so it would be more time consuming and less effective to use this naive way. Could anyone please suggest a better way of doing this ? Any suggestion/comment will be a great help. Thanks in advance.
chandra shekhar pant is offline   Reply With Quote

Old   March 2, 2021, 05:34
Default
  #2
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 7
shock77 is on a distinguished road
rm -r processor*/0.05
shock77 is offline   Reply With Quote

Old   March 2, 2021, 07:00
Default
  #3
Senior Member
 
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16
chandra shekhar pant is on a distinguished road
Great! Thanks a lot shock77 for your prompt reply and help.
shock77 likes this.
chandra shekhar pant is offline   Reply With Quote

Old   March 3, 2021, 00:40
Default
  #4
Member
 
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 8
AndreasPe is on a distinguished road
In newer versions of OpenFOAM (i used it with version 6) you can also use the foamListTimes utility and thus can delete a time range:


Code:
foamListTimes -rm -processor -time "xxxx:xxxx"
for example


Code:
foamListTimes -rm -processor -time "0.1:0.5"
will delete all time folders from time 0.1 to time 0.5 in the processor folders.

See also https://www.openfoam.com/documentati...ListTimes.html
AndreasPe is offline   Reply With Quote

Old   March 3, 2021, 01:11
Default
  #5
Senior Member
 
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16
chandra shekhar pant is on a distinguished road
Hello AndreasPe, that's indeed very useful. I am using OpenFOAM v1906, tried for this version, and it worked, great, thanks a lot
chandra shekhar pant is offline   Reply With Quote

Old   March 3, 2021, 14:12
Default
  #6
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,689
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by AndreasPe View Post
In newer versions of OpenFOAM (i used it with version 6) you can also use the foamListTimes utility and thus can delete a time range:
This indeed the preferred way to clean out processor time directories. It's been there since OpenFOAM 1.5 or 1.6 (ie, not so terribly recent).
olesen is offline   Reply With Quote

Old   May 1, 2021, 11:53
Default
  #7
Senior Member
 
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16
chandra shekhar pant is on a distinguished road
Thanks a lot all for your kind help. In the continuation of this post, I have re--simulated a case from time =0.208 to time =0.21. Now I have a previous case (from time =0 to time = 0.21) in some server and I had simulated this case (from time = 0.208 to time = 0.21) in another server. For both the cases I have folders ranging from processors0 to processors179 (since I ran the case using 180 processors). I wanted to copy the newly created time folder of time =0.209 and time =0.21 to the previous case (from time =0 to time =0.208). Is there any smart way of coping the different time folders to the specific folders ranging from processors0 to 180? Sorry for confusing you with so many terminologies. Thanks in advance.
chandra shekhar pant is offline   Reply With Quote

Old   May 3, 2021, 01:40
Default
  #8
Member
 
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 8
AndreasPe is on a distinguished road
Just use reconstructPar on the one server with the re-simulated result, then copy the reconstructed time folder to the other server, delete the "wrong" time folders there as described above and then run "decomposePar -fields" to decompose the reconstructed time folder again on this server.
AndreasPe is offline   Reply With Quote

Old   May 3, 2021, 01:45
Default
  #9
Senior Member
 
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16
chandra shekhar pant is on a distinguished road
Hi AndreasPe,

Thanks a lot for your help, I think I understood your post 99% , what I don't understand is "delete the "wrong" time folders there as described above". What you want me to delete ? Many thanks again for your help, its indeed very helpful.
chandra shekhar pant is offline   Reply With Quote

Old   May 3, 2021, 01:51
Default
  #10
Member
 
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 8
AndreasPe is on a distinguished road
Maybe you confused me and you can just ignore this part...
It is not clear, if the previous case has time folders 0.208 to 0.21 in the processor folders or not. You state two different things here:


Quote:
Thanks a lot all for your kind help. In the continuation of this post, I have re--simulated a case from time =0.208 to time =0.21. Now I have a previous case (from time =0 to time = 0.21) in some server and I had simulated this case (from time = 0.208 to time = 0.21) in another server. For both the cases I have folders ranging from processors0 to processors179 (since I ran the case using 180 processors). I wanted to copy the newly created time folder of time =0.209 and time =0.21 to the previous case (from time =0 to time =0.208). Is there any smart way of coping the different time folders to the specific folders ranging from processors0 to 180? Sorry for confusing you with so many terminologies. Thanks in advance.

If the "previous case" has time folders from 0.209 to 0.21, then you need to delete them before you can copy them from the new case. If not, you can just copy them...
AndreasPe is offline   Reply With Quote

Old   May 3, 2021, 01:54
Default
  #11
Senior Member
 
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 16
chandra shekhar pant is on a distinguished road
Thanks a lot, yes I am pretty sure that my post was not so clear, apologies for that. Many thanks again for your time and consistent help.
chandra shekhar pant 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
laplacianFoam with source term Herwig OpenFOAM Running, Solving & CFD 17 November 19, 2019 13:47
pressure in incompressible solvers e.g. simpleFoam chrizzl OpenFOAM Running, Solving & CFD 13 March 28, 2017 05:49
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 00:01
AMI interDyMFoam for mixer nu problem danny123 OpenFOAM Programming & Development 8 September 6, 2013 02:34
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03


All times are GMT -4. The time now is 10:53.