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

reconstructPar - deleting data simultaneously

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By sharonyue

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 15, 2018, 13:58
Default reconstructPar - deleting data simultaneously
  #1
Senior Member
 
cyln
Join Date: Jul 2016
Posts: 102
Rep Power: 10
cyln is on a distinguished road
Hello,

I am working with transient simulations (large in size). While I am reconstructing data using reconstructPar, simultaneously I would like the decomposed data to be deleted.


Is this possible in OpenFOAM?


Cheers

Last edited by cyln; May 15, 2018 at 19:52.
cyln is offline   Reply With Quote

Old   May 15, 2018, 19:23
Default
  #2
New Member
 
Ed Barry
Join Date: May 2018
Posts: 4
Rep Power: 8
ed_bar is on a distinguished road
I'm unsure if there is an utility available for that, however you could write a bash script to do it. If you are really short on space and need to remove each time step at every reconstruction, then you would probably need to write a loop with (this is not correct bash, but gives the idea).



Code:
for timeName in processor0/ ignoring directory uniform do

reconstructPar -time $timeName
rm -rf processor*/$timeName
done

Otherwise reconstruct the fields and then delete the processor directories afterwards.
Code:
reconstructPar ; rm -rf process*
ed_bar is offline   Reply With Quote

Old   May 15, 2018, 19:51
Default
  #3
Senior Member
 
cyln
Join Date: Jul 2016
Posts: 102
Rep Power: 10
cyln is on a distinguished road
Thanks Ed. I am already deleting the corresponding files in processor directories after reconstruction while the simulation is still running (I am not deleting the processor directories since the simulation has to continue). I do it using the second way you described.

For now, I will keep using the second way since I do not have a good command of C++. But if anyone has another suggestion, please let me know.


Cheers
cyln is offline   Reply With Quote

Old   March 19, 2020, 19:12
Default
  #4
Senior Member
 
Join Date: Jul 2019
Posts: 148
Rep Power: 7
Bodo1993 is on a distinguished road
Hi,
I am wondering if you figured out a better way.
I want this because I have a limitation on the number of files that I can write on the allocated space in clusters.
I would appreciate any assistance.
Thanks!
Bodo1993 is offline   Reply With Quote

Old   July 14, 2020, 04:19
Default
  #5
Senior Member
 
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 540
Rep Power: 20
JBeilke is on a distinguished road
Here is my Perl6/Raku code to delete all but the last time directories from the processor dirs.


Code:
#!/usr/bin/env perl6

use v6;

shell 'reconstructPar -newTimes';    
    
my @processor_dirs = dir( test => /:i ^ 'processor' \d+ / ).grep({ $_.IO.d }).sort;
my @time_dirs;

for @processor_dirs -> $processor_dir {

    chdir $processor_dir;

    once {
        @time_dirs = dir( test => /^ \d+ \.* / ).sort({ $^a <=> $^b });
        @time_dirs.pop;
    }    

    for @time_dirs {
        say "Removing: " , $processor_dir.Str , "/" ,  $_.Str;
        shell "rm -rf $_";
    }

    chdir "..";

}
JBeilke is offline   Reply With Quote

Old   August 12, 2021, 21:53
Default
  #6
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18
sharonyue is on a distinguished road
You can use the following:

Code:
#!/bin/bash
for i in $(foamListTimes -case processor0); do
    reconstructPar -time ${i}
    rm -r processo*/${i}    
done
Luiz likes this.
__________________
My OpenFOAM algorithm website: http://dyfluid.com
By far the largest Chinese CFD-based forum: http://www.cfd-china.com/category/6/openfoam
We provide lots of clusters to Chinese customers, and we are considering to do business overseas: http://dyfluid.com/DMCmodel.html
sharonyue is offline   Reply With Quote

Old   May 7, 2022, 12:04
Default
  #7
New Member
 
Konstantinos Missios
Join Date: Mar 2017
Location: Copenhagen, Denmark.
Posts: 12
Rep Power: 9
missios is on a distinguished road
Hi,


Have you considered setting
Code:
purgeWrite 1;
in your control dict?


Best

K
missios is offline   Reply With Quote

Old   May 7, 2022, 12:10
Default
  #8
New Member
 
Konstantinos Missios
Join Date: Mar 2017
Location: Copenhagen, Denmark.
Posts: 12
Rep Power: 9
missios is on a distinguished road
Quote:
Originally Posted by Bodo1993 View Post
Hi,
I am wondering if you figured out a better way.
I want this because I have a limitation on the number of files that I can write on the allocated space in clusters.
I would appreciate any assistance.
Thanks!

Hi,



there is a new option (introduced back in v1712) when running in parallel mode. It is called collated and reduces significantly the number of output files. What it doed in escence is that it collects the output in one master file. More info regarding that can be found here https://www.openfoam.com/news/main-n...v1712/parallel .



Watch out since this choice can affect the computational performance (see here https://www.archer2.ac.uk/training/c...4-openfoam-io/ ).



Best,

K
missios is offline   Reply With Quote

Old   May 7, 2022, 16:07
Default
  #9
Senior Member
 
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 540
Rep Power: 20
JBeilke is on a distinguished road
Quote:
Originally Posted by missios View Post
Hi,


Have you considered setting
Code:
purgeWrite 1;
in your control dict?


Best

K

But purge write just deletes the time directories without a reconstructPar before.
JBeilke is offline   Reply With Quote

Old   June 23, 2022, 05:17
Default
  #10
Member
 
Mahmoud
Join Date: Nov 2020
Location: United Kingdom
Posts: 43
Rep Power: 6
Mahmoud Abbaszadeh is on a distinguished road
I have the same problem. I use "decomposePar" first and then run snappyHexMesh in parallel. After that, I use recontructMeshPar and I would like to delete the old decomposed directories before running my simulation. Has anyone had the solution for it?
Mahmoud Abbaszadeh 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
A CFX-POST error (ver 14.5.7) wangyflp88 CFX 2 July 22, 2017 01:17
[OpenFOAM] Paraview doesn't seem to be picking up data generated by icofoam MikeHersee ParaView 2 January 6, 2015 09:27
Data Produced From Fine Marine Cant Match with The Experimental Data PeiSan Fidelity CFD 4 August 23, 2014 06:33
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 11:52
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27


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