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

OpenFOAM - Quick way to delete previous calculation & HowTo get access to variables

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

Like Tree3Likes
  • 1 Post By mixkats
  • 2 Post By RobertHB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2010, 11:18
Default OpenFOAM - Quick way to delete previous calculation & HowTo get access to variables
  #1
New Member
 
Christoph
Join Date: Apr 2010
Posts: 19
Rep Power: 11
kriz is on a distinguished road
Hi!

Is there a quick way to delete all previous timesteps in a calculation (e.g. a script, deleting all directories regarding the time-steps w/o the "0" directory)?

plus: how can I tell the solver which variables to write to the result file - using buoyantBoussinesqPisoFoam I would like to have access to e.g. k and eps for post-processing.

Regards,
Kriz
kriz is offline   Reply With Quote

Old   April 19, 2010, 12:18
Default
  #2
Senior Member
 
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 14
eelcovv is on a distinguished road
Hi Kriz,

Just install pyFoam, a great set of python utilities by Bernhard Gschaider for doing all kind of openfoam tasks. Have a look at
http://openfoamwiki.net/index.php/Contrib_PyFoam

For clearing your case directory, it would become one single command:

pyFoamClearCase.pl .

Regards,

Eelco
eelcovv is offline   Reply With Quote

Old   April 19, 2010, 13:02
Default
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,105
Rep Power: 45
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by kriz View Post
Hi!

Is there a quick way to delete all previous timesteps in a calculation (e.g. a script, deleting all directories regarding the time-steps w/o the "0" directory)?
There might be a script in OpenFOAM-1.6/bin (only had a quick glance and nothing caught my fancy)

It's not an uncommon task. I usually use http://openfoamwiki.net/index.php/Co...amClearCase.py for that (but usually every computer I touch becomes polluted with that stuff, so this is the easiest thing to do for ME, not necessarily for everyone)

Quote:
Originally Posted by kriz View Post
plus: how can I tell the solver which variables to write to the result file - using buoyantBoussinesqPisoFoam I would like to have access to e.g. k and eps for post-processing.
That was discussed last week (I think the discussion was about rho) and two functionObjects that do that were referenced

Just curious: are you sure you're using a turbulence model that HAS k/epsilon (because usually such a turbulence model writes these out)

Bernhard
gschaider is offline   Reply With Quote

Old   February 14, 2018, 18:16
Default
  #4
New Member
 
Katsantonis Michalis
Join Date: Dec 2017
Posts: 11
Rep Power: 3
mixkats is on a distinguished road
There is a command included in OpenFOAM that lists all of the time directories, you just just have to type > foamListTimes.

Now, if you want to remove all those directories, you type > foamListTimes -rm
ssa_cfd likes this.
mixkats is offline   Reply With Quote

Old   February 15, 2018, 00:27
Default
  #5
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 590
Rep Power: 7
piu58 is on a distinguished road
Code:
mv 0 O
rm -r 0*
rm -r 1*
rm -r 2*
rm -r 3*
rm -r 4*
rm -r 5*
rm -r 6*
rm -r 7*
rm -r 8*
rm -r 9*
mv O 0
rm -r postProcessing
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   February 15, 2018, 09:33
Default
  #6
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 295
Rep Power: 7
RobertHB is on a distinguished road
Or shorter
Code:
rm -r 0.* [1-9]*
removes all time folders but zero.
babak_n and Giantsda like this.
RobertHB is offline   Reply With Quote

Old   February 15, 2018, 10:30
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,105
Rep Power: 45
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by RobertHB View Post
Or shorter
Code:
rm -r 0.* [1-9]*
removes all time folders but zero.
Which can be problematic for some of the tutorial-cases that have a 0.orig-directory
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 31, 2019, 02:59
Default
  #8
Member
 
Carlo_P
Join Date: May 2019
Location: I
Posts: 35
Rep Power: 2
Carlo_P is on a distinguished road
Hey guys,

if you need, it is possible to use the command "foamCleanTutorials".
It is very usefull command to clean the directory.
Cheers,
Carlo
Carlo_P is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
The calculation efficiency of OpenFOAM chiven OpenFOAM Running, Solving & CFD 4 September 14, 2009 04:44
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55
A new Howto on the OpenFOAM Wiki Compiling OpenFOAM under Unix mbeaudoin OpenFOAM Installation 2 April 28, 2006 08:54
Warning 097- AB Siemens 6 November 15, 2004 04:41
access to variables at interface of porous media? Mazyar FLUENT 0 October 10, 2003 14:59


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