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

Shell Script - Calling latestTime directory

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By clapointe

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 31, 2020, 09:02
Default Shell Script - Calling latestTime directory
  #1
Member
 
Conor Crickmore
Join Date: Jan 2020
Location: Leicestershire, United Kingdom
Posts: 36
Rep Power: 6
cjc96 is on a distinguished road
Hey CFD-Online,
I've been using the forum here as a source of info for a long time now but have only just had the need to post, so please be gentle!

I've searched around a bit for an answer, but had no luck, possibly because I'm not entirely sure how to word my question at a length Google would fine usable.


Basically, I am writing some ./Allrun scripts to help automate some snappyHexMesh iterations, and have run into an issue.


I understand that snappy builds its mesh over three time-steps, based on controlDict, and that you can overwrite your existing polyMesh (as opposed to having three new time directories) by using the -overwrite argument, however, I haven't been able to get -overwrite to function as expected when parallelising snappy using mpirun and reconstructing.


So my question is twofold, am I doing something wrong when it comes to parallel -overwrite, and if not, is there a way I can call the latestTime directory in a shell script in order to overwrite polyMesh in '0' manually?


Thanks for your help!
__________________
Conor Crickmore
PhD Researcher in Automotive Aerodynamics
Aeronautical and Automotive Engineering
Loughborough University
LE11 3TU
cjc96 is offline   Reply With Quote

Old   February 1, 2020, 09:55
Default
  #2
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
I am not sure why the overwrite wouldn't work in tandem with parallel snappy use, but I've not used it in parallel much. I can help with the latest time, though -- I've used the following in a script in which I identify the final time :

Code:
finalTime=$(foamListTimes | tail -1)
Caelan
cjc96 likes this.
clapointe is offline   Reply With Quote

Old   February 3, 2020, 10:28
Default
  #3
Member
 
Conor Crickmore
Join Date: Jan 2020
Location: Leicestershire, United Kingdom
Posts: 36
Rep Power: 6
cjc96 is on a distinguished road
Quote:
Originally Posted by clapointe View Post
I am not sure why the overwrite wouldn't work in tandem with parallel snappy use, but I've not used it in parallel much. I can help with the latest time, though -- I've used the following in a script in which I identify the final time :

Code:
finalTime=$(foamListTimes | tail -1)
Caelan

Thanks clapointe!


I'm still not sure why -overwrite wasn't working as expected, it didn't throw an error, and still seemed to overwrite the 0 directory (as opposed to making 1-3) but the final result was seemingly the original block mesh (not the final snappy mesh)


Your recommendation for the time directory worked like a treat though! For clarity however, it turns out you can use:


Code:
$(foamListTimes -latestTime)
Which I find to be a bit cleaner.


Thanks again for your help
__________________
Conor Crickmore
PhD Researcher in Automotive Aerodynamics
Aeronautical and Automotive Engineering
Loughborough University
LE11 3TU
cjc96 is offline   Reply With Quote

Reply

Tags
bash script, snappyhexmesh


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
[CGNS] CGNS converters available mbeaudoin OpenFOAM Meshing & Mesh Conversion 137 December 14, 2018 04:20
Problem installing on Ubuntu 9.10 -> 'Cannot open : No such file or directory' mfiandor OpenFOAM Installation 2 January 25, 2010 09:50
Statically Compiling OpenFOAM Issues herzfeldd OpenFOAM Installation 21 January 6, 2009 09:38
Compiling OpenFOAM13 on AMD64 with Redhat Enterprise mbeaudoin OpenFOAM Installation 20 June 17, 2008 06:43
Gerris software installation mer Main CFD Forum 2 November 12, 2005 08:50


All times are GMT -4. The time now is 08:03.