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

how to put time folders in a unique folder

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

Like Tree1Likes
  • 1 Post By pad

Reply
 
LinkBack Thread Tools Display Modes
Old   August 13, 2013, 10: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,186
Rep Power: 16
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, 11:39
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
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, 11:52
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
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, 13:27
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,607
Rep Power: 25
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, 14:00
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
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, 14:07
Default
  #6
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,607
Rep Power: 25
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, 14:17
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
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, 02:59
Default
  #8
pad
New Member
 
PA
Join Date: Mar 2009
Posts: 23
Rep Power: 8
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, 04:39
Default
  #9
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
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, 05:03
Default
  #10
pad
New Member
 
PA
Join Date: Mar 2009
Posts: 23
Rep Power: 8
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

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
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 28 May 28, 2015 13:37
AMI speed performance danny123 OpenFOAM 19 October 24, 2012 07:44
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM 6 April 12, 2011 11:24
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 04:35
Modeling in micron scale using icoFoam m9819348 OpenFOAM Running, Solving & CFD 7 October 27, 2007 00:36


All times are GMT -4. The time now is 06:29.