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 Community New Posts Updated Threads Search

Like Tree22Likes
  • 10 Post By mixkats
  • 2 Post By piu58
  • 5 Post By RobertHB
  • 1 Post By Carlo_P
  • 2 Post By Yugal Sharma
  • 2 Post By Yann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2010, 12: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: 16
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, 13:18
Default
  #2
Senior Member
 
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 19
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, 14:02
Default
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 19:16
Default
  #4
New Member
 
Katsantonis Michalis
Join Date: Dec 2017
Posts: 21
Rep Power: 9
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
86682164, njdyck, Soll and 7 others like this.
mixkats is offline   Reply With Quote

Old   February 15, 2018, 01:27
Default
  #5
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
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
tariq and Kar93 like this.
__________________
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, 10:33
Default
  #6
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 12
RobertHB is on a distinguished road
Or shorter
Code:
rm -r 0.* [1-9]*
removes all time folders but zero.
tariq, piu58, babak_n and 2 others like this.
RobertHB is offline   Reply With Quote

Old   February 15, 2018, 11:30
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 03:59
Default
  #8
Senior Member
 
Carlo_P
Join Date: May 2019
Location: Italy
Posts: 176
Rep Power: 8
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
Aliosat likes this.
Carlo_P is offline   Reply With Quote

Old   July 23, 2021, 08:32
Default
  #9
New Member
 
Yugal Sharma
Join Date: Apr 2021
Posts: 3
Rep Power: 5
Yugal Sharma is on a distinguished road
Quote:
Originally Posted by mixkats View Post
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
Thanks it worked on OpenFoam version 2012 as well.
GergoSchmidt and Goatow like this.
Yugal Sharma is offline   Reply With Quote

Old   July 23, 2021, 08:39
Default
  #10
New Member
 
Yugal Sharma
Join Date: Apr 2021
Posts: 3
Rep Power: 5
Yugal Sharma is on a distinguished road
Quote:
Originally Posted by Carlo_P View Post
Hey guys,

if you need, it is possible to use the command "foamCleanTutorials".
It is very usefull command to clean the directory.
Cheers,
Carlo
But it also will remove the mesh-related files, (which are in constant/polymesh/ directory)
So you have to again do the meshing stuff (i.e.- blockMesh).
Basically, the foamCleanTutorial command makes your case's folder contain only the 0/, constant/, system/ directories. (and maybe someother files), more like a fresh case folder.
Yugal Sharma is offline   Reply With Quote

Old   September 1, 2021, 03:23
Default decomposed
  #11
New Member
 
Yanjun Tong
Join Date: Jul 2020
Posts: 17
Rep Power: 6
Hughtong is on a distinguished road
Quote:
Originally Posted by mixkats View Post
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
This is useful when the time files are reconstructed, but when the time files are in decomposed processors use this is good :

rm -rf processor*/[time]
or
rm -rf processor*
to delete all processors
Hughtong is offline   Reply With Quote

Old   September 1, 2021, 10:42
Default
  #12
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
For decomposed cases, you can also use foamListTimes with the processor option:

Code:
foamListTimes -processor -rm

Cheers,
Yann
Edee and Goatow like this.
Yann is offline   Reply With Quote

Old   March 6, 2023, 04:20
Default
  #13
New Member
 
Karthik Lukka
Join Date: Nov 2022
Location: Roorkee, India
Posts: 2
Rep Power: 0
Kar93 is on a distinguished road
Vielen Danke.
Kar93 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
The calculation efficiency of OpenFOAM chiven OpenFOAM Running, Solving & CFD 4 September 14, 2009 05:44
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
A new Howto on the OpenFOAM Wiki Compiling OpenFOAM under Unix mbeaudoin OpenFOAM Installation 2 April 28, 2006 09:54
Warning 097- AB Siemens 6 November 15, 2004 05:41
access to variables at interface of porous media? Mazyar FLUENT 0 October 10, 2003 15:59


All times are GMT -4. The time now is 11:45.