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

Generic case structure for iterative design process

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 5, 2011, 01:51
Question Generic case structure for iterative design process
  #1
New Member
 
Chris
Join Date: May 2011
Posts: 12
Rep Power: 15
capucsc is on a distinguished road
I'm looking for tips, tricks and general insights on building a generic simulation file structure for automated iterative design. I'm new to OF and to CFD, but have significant experience in automated design.

I'm looking at air flow over an object. Code external to OF will generate the structure for testing and write an STL file to disk. The STL will initially consist of only one solid. The geometry generated will have a maximum and minimum allowable size, and I need the case to accommodate anything within those limits.

This is my initial take on the process:
A python script will handle the overall process. It starts with a geometry description file. That file gets passed to a geometry builder which yields an STL. Python copies the generic OF file structure, assigns it a unique ID folder name and copies the STL into the proper directory. A bash script, which is stored in the copied template directory runs blockMesh, snappy and the solver. After the solver finishes (any easy way to detect?), the results will be processed and used to influence the next iteration of geometry design. This influence will be based on L/D and other parameters. I know that's high level, but are there any obvious places this process will break down?

Are there any examples of something similar to this? Right now, I have the geometry description file and the geometry builder done. I've been using discretizer and the OF tutorials to improve my understanding of how OF works but I still have a long way to go. I'm looking forward to your advice and would like to extend an invitation for collaboration, let me know if you're interested. Thanks in advance.
capucsc is offline   Reply With Quote

Old   May 5, 2011, 07:11
Default End of solver run
  #2
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 16
Linse is on a distinguished road
Hi Capucsc,

though I am unexperienced, up to now each of the runs of an OpenFOAM-solver did end with a note saying "End" in the output.
Maybe that is the initial step for you about knowing when you can start the next geometry iteration?

What I would suggest: Print the output of the solver into some log-file.
This logfile you might check all x seconds for the word "End".
As soon as that is found, you might call the reiteration loop for geometry.

Another possibility might be adding that very command at the point where the "End" message is issued within the solution routine. Where that exactly takes place, I don't know (yet)...

I am no programmer/informatics guy, so unfortunately I do not know about the very implementation in matters of source-code.
Linse is offline   Reply With Quote

Old   May 5, 2011, 14:50
Default
  #3
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
I have a case where I have to periodically remesh, with each different mesh begin stored in a different folder that covers a different span of time. For determining the end of a simulation, you don't really need to do that unless you are running multiple cases in parallel. Say if you're solver was icoFoam, and you run in your bash script:
Code:
 icoFOAM -case $PWD > foam.log
(if you need to log the results) then the console won't turn over control until that process is finished (so long as it isn't backgrounded); this should work no matter what method you use to stop the solver, though I am not very familiar with Python. When you call a bash script from python, does it wait until the end of the script before the next line of code?
mturcios777 is offline   Reply With Quote

Old   May 5, 2011, 20:22
Default
  #4
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,286
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
IF you are on linux type system, expect and autoexpect are your best friends. They allow you to manage talk between various programs.
Have a look.
arjun is offline   Reply With Quote

Old   May 6, 2011, 12:26
Default
  #5
New Member
 
Chris
Join Date: May 2011
Posts: 12
Rep Power: 15
capucsc is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
When you call a bash script from python, does it wait until the end of the script before the next line of code?
Yes it does, however, I think I would combine this with the log approach just for error checking.

Expect and autoexpect look very relevant to this problem. I'll try it out today.
capucsc is offline   Reply With Quote

Reply

Tags
automated design, generic case structure, open foam


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
Design of calibrator in profile extrusion process Srinivasa Rao Vaddiraju CFX 0 January 31, 2004 17:49
use of cfd in process equipment design pramod Main CFD Forum 0 August 14, 2002 11:06
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 16:56
CFD in a nutshell CFD Dummy Main CFD Forum 34 July 8, 2000 01:29
Info: Short Course On Thermal Design of Electronic Equipment Arnold Free Main CFD Forum 0 August 10, 1999 11:18


All times are GMT -4. The time now is 15:23.