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

Working in parallel with OpenFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2009, 10:27
Default Working in parallel with OpenFoam
  #1
Senior Member
 
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18
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, 10:53
Default
  #2
Member
 
Etienne Lorriaux
Join Date: Mar 2009
Location: Compiegne, France
Posts: 45
Rep Power: 17
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, 10:57
Default
  #3
Senior Member
 
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18
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, 11:13
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
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, 03:40
Default
  #5
Senior Member
 
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18
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, 04:36
Default
  #6
Senior Member
 
Prapanch Nair
Join Date: Mar 2009
Location: Bangalore, India
Posts: 105
Rep Power: 17
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, 04:46
Default
  #7
Senior Member
 
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18
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, 07:16
Default
  #8
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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, 07:43
Default
  #9
Senior Member
 
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18
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


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
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Help with parallel working instalation. Jonathan FLUENT 9 November 8, 2011 00:25
Modified OpenFOAM Forum Structure and New Mailing-List pete Site News & Announcements 0 June 29, 2009 06:56
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 12:16
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 15:25


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