CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

Working in parallel with OpenFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 6, 2009, 09:27
Default Working in parallel with OpenFoam
  #1
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 171
Rep Power: 6
fs82 is on a distinguished road
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
fs82 is offline   Reply With Quote

Old   July 6, 2009, 09:53
Default
  #2
Member
 
Etienne Lorriaux
Join Date: Mar 2009
Location: Compiegne, France
Posts: 43
Rep Power: 7
elorriaux is on a distinguished road
Hello,

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

Regards, Etienne.
elorriaux is offline   Reply With Quote

Old   July 6, 2009, 09:57
Default
  #3
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 171
Rep Power: 6
fs82 is on a distinguished road
No, I know this possibility. But I want to keep the time directories until my run is finished, e.g. for error searching.
fs82 is offline   Reply With Quote

Old   July 6, 2009, 10:13
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,470
Rep Power: 23
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   July 7, 2009, 02:40
Default
  #5
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 171
Rep Power: 6
fs82 is on a distinguished road
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
fs82 is offline   Reply With Quote

Old   July 8, 2009, 03:36
Default
  #6
Senior Member
 
Prapanch Nair
Join Date: Mar 2009
Location: Bangalore, India
Posts: 105
Rep Power: 7
prapanj is on a distinguished road
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.
prapanj is offline   Reply With Quote

Old   July 8, 2009, 03:46
Default
  #7
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 171
Rep Power: 6
fs82 is on a distinguished road
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
fs82 is offline   Reply With Quote

Old   July 8, 2009, 06:16
Default
  #8
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 771
Rep Power: 17
olesen will become famous soon enough
Quote:
Originally Posted by prapanj View Post
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.
olesen is offline   Reply With Quote

Old   July 8, 2009, 06:43
Default
  #9
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 171
Rep Power: 6
fs82 is on a distinguished road
great, thats the information I was looking for. Thx a lot :-D

kind regards,
Fabian
fs82 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with parallel working instalation. Jonathan FLUENT 9 November 7, 2011 23:25
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 17 August 22, 2009 03:59
Modified OpenFOAM Forum Structure and New Mailing-List pete Site News & Announcements 0 June 29, 2009 05:56
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 11:16
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 14:25


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