CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Working in parallel with OpenFoam (http://www.cfd-online.com/Forums/openfoam/66103-working-parallel-openfoam.html)

fs82 July 6, 2009 09:27

Working in parallel with OpenFoam
 
Hello,

I have some cases running on a High Performance Computer (SGI Altix 4700) in parallel with 16 CPUs. They produce a large amount of foam time directories. I need this time directories for checking my case during run but in the end I only need the time directories over a period of time. So my question: Is there any tool or any option of a tool which allows me to delete a huge amount of data in every processor* directory? Doing this by hand is to time expensive for me. May be I can tell reconstructPar to reconstruct more than one time directory and delete the processor* directories?

thx for help,
fs82

elorriaux July 6, 2009 09:53

Hello,

I think you are searching after the writeCOntrol, purgeWrite and writeInterval keywords in the controDict.

Regards, Etienne.

fs82 July 6, 2009 09:57

No, I know this possibility. But I want to keep the time directories until my run is finished, e.g. for error searching.

ngj July 6, 2009 10:13

Hi Fabian

Then I would suggest that you make some kind of shell script to run through the time directories. It could be something like this (warning, not tested:))

#!/usr/bin/bash
list=`ls -d processor0/*`
listP=`ls -d processor*`

# this limit should be any of you liking, i.e. time step
limit=20

for i in $i
do
var=${i#processor/}
flag=`awk -v lim=$limit -v current=$var '{if (var>=limit) print GO}'`
if [ -n $flag ]
then
for j in $listP
do
echo "Removing: " $j/$var
# rm -r $j/$var
done
fi
done

As you can see, I have removed the "Remove" command. You can include it, if you find the above to work satisfactory.

Best regards,

Niels

fs82 July 7, 2009 02:40

Allright, that is the answer I expected but I had a little hope that there is an option or a tool which I didn't found up to now to do this task. Thx Niels

kind regards,
Fabian

prapanj July 8, 2009 03:36

Hey,

If you just want to reconstruct only certain time directories from the processor folders you can simple do this:

reconstructPar -latestTime (which will reconstruct the latest time step)
reconstructPar -time 100 ( which will reconstruct the time step 100, or any number for that case).

The same flags can be applied in many places. Like for example, you can do

foamToVTK -latestTime

You may write a short script that reconstruct a bunch of time steps.

Hope this helps,

Cheers,
Prapanj.

fs82 July 8, 2009 03:46

Thx I allready know the options of reconstructPar. But I need to reconstruct a period of time. Due to Niels suggestion I worte a little bash script to remove the unnecessary time directories in every processor* folder and afterwards I use reconstructPar without any option :-D I do not use the script provided by niels above, because I am not familiar with awk and do not like it very much. But there are many ways to achieve the same without using awk. So everything works fine :-D

thk
Fabian

olesen July 8, 2009 06:16

Quote:

Originally Posted by prapanj (Post 221868)
If you just want to reconstruct only certain time directories from the processor folders you can simple do this:

reconstructPar -latestTime (which will reconstruct the latest time step)
reconstructPar -time 100 ( which will reconstruct the time step 100, or any number for that case).

Actually many of the utilities now use the timeSelector::select0() method (which uses Foam::scalarRange - http://foam.sourceforge.net/doc/Doxygen/html/classFoam_1_1scalarRange.html), so you often specify time ranges directly.
Eg,
reconstructPar -time 10:100,1000:2000,5000:

The order of the time ranges should be irrelevant. Even overlapping time-ranges should work fine.

fs82 July 8, 2009 06:43

great, thats the information I was looking for. Thx a lot :-D

kind regards,
Fabian


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