|
[Sponsors] |
reconstructPar - deleting data simultaneously |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Senior Member
cyln
Join Date: Jul 2016
Posts: 102
Rep Power: 10 ![]() |
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 18:52. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
Ed Barry
Join Date: May 2018
Posts: 4
Rep Power: 8 ![]() |
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* |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
cyln
Join Date: Jul 2016
Posts: 102
Rep Power: 10 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Join Date: Jul 2019
Posts: 148
Rep Power: 7 ![]() |
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! |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 511
Rep Power: 20 ![]() |
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 ".."; } |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 844
Rep Power: 18 ![]() |
You can use the following:
Code:
#!/bin/bash for i in $(foamListTimes -case processor0); do reconstructPar -time ${i} rm -r processo*/${i} done
__________________
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 |
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
Konstantinos Missios
Join Date: Mar 2017
Location: Copenhagen, Denmark.
Posts: 12
Rep Power: 9 ![]() |
Hi,
Have you considered setting Code:
purgeWrite 1; Best K |
|
![]() |
![]() |
![]() |
![]() |
#8 | |
New Member
Konstantinos Missios
Join Date: Mar 2017
Location: Copenhagen, Denmark.
Posts: 12
Rep Power: 9 ![]() |
Quote:
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 |
||
![]() |
![]() |
![]() |
![]() |
#9 |
Senior Member
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 511
Rep Power: 20 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#10 |
Member
Mahmoud
Join Date: Nov 2020
Location: United Kingdom
Posts: 43
Rep Power: 5 ![]() |
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?
|
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
A CFX-POST error (ver 14.5.7) | wangyflp88 | CFX | 2 | July 22, 2017 00:17 |
[OpenFOAM] Paraview doesn't seem to be picking up data generated by icofoam | MikeHersee | ParaView | 2 | January 6, 2015 08:27 |
Data Produced From Fine Marine Cant Match with The Experimental Data | PeiSan | Fidelity CFD | 4 | August 23, 2014 05:33 |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 10:52 |
How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 17:27 |