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

how to put time folders in a unique folder

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pad

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 13, 2013, 11:28
Default how to put time folders in a unique folder
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
when run is doing a lot of time folders originate in the root folder of case.
in such situation may it take a lot of time to find essential folders 0,constant and system or maybe delete them mistakenly with other folders.
how can have time folders in a separate folder?
is there a script for this purpose?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 13, 2013, 12:39
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
What do you mean with find the essential folders? From the shell it is just "cd folder" right?

Did you consider improving your work flow with utilities pyFoamClearCase.py and pyFoamCloneCase.py?

You can improve one of these utlities to do what you want. It seems not too difficult, add some function to the SolutionDirectory class, and create a new instance of this class in some fancy utility

Or, of course you could try to move it with bash and fancy regular expressions.
Bernhard is offline   Reply With Quote

Old   August 13, 2013, 12:52
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
Hi Bernhard
none of them! I meant main folders that are :0,constant and system.
I mean that if all other time folders could be written in a separate folder we had a more well-ordered case folder,then we had this folders:0,constant,system,time_folder
that time_folder is a folder that includes all time folders after 0 time.
do you mean I can do this by Swak utilities?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 13, 2013, 14:27
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
If you are really, really, really sure that you want to do this, then try the following, which ought to work:

Code:
mkdir time_folders
list=`ls -d [0-9]* | grep -v "^0$"`
mv $list time_folders/.
Kind regards

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   August 13, 2013, 15:00
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
Hi Niels
thanks for the script but I like a way that it can be done automatically with the solver itself.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 13, 2013, 15:07
Default
  #6
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
If that should be done nicely, then it means that you need to change the core of OpenFoam. Also, you would need to modify paraFoam/ParaView to be able to visualise data.

Depending on how you approach the above, you might need to put "if's" into all utilities/solvers, as the 0-folder and all other time folders have a different relative path to the root-case directory.

Shortly: Why don't you merely learn to work with the existing file structure?

Kind regards

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   August 13, 2013, 15:17
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
then there is a lot of work to do that.I just said that it would be better if the root folder was less crowded! whats your opinion?
I think maybe they do it in later releases.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 14, 2013, 03:59
Default
  #8
pad
New Member
 
PA
Join Date: Mar 2009
Posts: 25
Rep Power: 17
pad is on a distinguished road
Maybe you could use a function object with your controlDict. I use this with some success to reduce the number of files created at runtime to only the latest.

sysCall2
{
type systemCall;
functionObjectLibs ( "libsystemCall.so" );
executeCalls 0();
endCalls 0();
writeCalls 2("ls -1td $PWD/_impellerSurfacePressure/* | tail -n +3 | xargs echo rm -rf" "ls -1td $PWD/_impellerSurfacePressure/* | tail -n +3 | xargs rm -rf");
outputControl outputTime;
// outputInterval 10;
}
__________________
Regards,
Per
pad is offline   Reply With Quote

Old   August 14, 2013, 05:39
Default
  #9
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
Hi
seems be nice,could you explain its lines a bit to me?thanks.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 14, 2013, 06:03
Default
  #10
pad
New Member
 
PA
Join Date: Mar 2009
Posts: 25
Rep Power: 17
pad is on a distinguished road
Typing --help after the different linux commands usually gets you a long way in linux.

It may be faster for you to try the lines below than me trying to explain.

ls -1td <OF case folder>
ls -1td <OF case folder> | tail -n +3 (try varying the number 3)
ls -1td <OF case folder> | tail -n +3 | xargs echo rm -rf (echo just ensures that you don't delete anything by mistake)

The above is called twice in my function object just to get some output with 'echo'. Not the most beautiful approach but it worked for me.

Regarding function object see http://openfoamwiki.net/index.php/Ti...ect_systemCall
immortality likes this.
__________________
Regards,
Per
pad 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
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 32 June 16, 2021 07:55
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 05:13
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 12:08
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 05:35
Modeling in micron scale using icoFoam m9819348 OpenFOAM Running, Solving & CFD 7 October 27, 2007 01:36


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