CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to delete the same time folder in different processors folder (https://www.cfd-online.com/Forums/openfoam-solving/234292-how-delete-same-time-folder-different-processors-folder.html)

chandra shekhar pant March 2, 2021 04:44

How to delete the same time folder in different processors folder
 
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.

shock77 March 2, 2021 05:34

rm -r processor*/0.05

chandra shekhar pant March 2, 2021 07:00

Great! Thanks a lot shock77 for your prompt reply and help.

AndreasPe March 3, 2021 00:40

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

chandra shekhar pant March 3, 2021 01:11

Hello AndreasPe, that's indeed very useful. I am using OpenFOAM v1906, tried for this version, and it worked, great, thanks a lot :)

olesen March 3, 2021 14:12

Quote:

Originally Posted by AndreasPe (Post 797707)
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).

chandra shekhar pant May 1, 2021 11:53

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.

AndreasPe May 3, 2021 01:40

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.

chandra shekhar pant May 3, 2021 01:45

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.

AndreasPe May 3, 2021 01:51

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...

chandra shekhar pant May 3, 2021 01:54

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.


All times are GMT -4. The time now is 01:35.