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

Matlab m file to create openfoam case "like Helyx"

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2015, 08:27
Question Matlab m file to create openfoam case "like Helyx"
  #1
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Hello dear Foamers,

I am creating a crazy solver in openfoam which needs hundreds of parameters to be defined in the case folder.
some of the boundary conditions, setField values depend on these parameters.
so i thought about creating a matlab, octave, or scilab function that will generate the case files based on provided parameters or read from text file.

Is there anything like this done before? it will make my task easier.
Thank you very much
kebsiali is offline   Reply With Quote

Old   July 8, 2015, 10:49
Default
  #2
Member
 
Bruno Blais
Join Date: Sep 2013
Location: Canada
Posts: 64
Rep Power: 12
blais.bruno is on a distinguished road
Quote:
Originally Posted by kebsiali View Post
Hello dear Foamers,

I am creating a crazy solver in openfoam which needs hundreds of parameters to be defined in the case folder.
some of the boundary conditions, setField values depend on these parameters.
so i thought about creating a matlab, octave, or scilab function that will generate the case files based on provided parameters or read from text file.

Is there anything like this done before? it will make my task easier.
Thank you very much
You might want to look into what has been done with pyFOAM. Some of the tools used there might be of use or at least how Bernard has shaped the framework might help you to get a better idea.

I think python is the ideal language for this type of task. With the numpy modules you can do any kind of calculations you need and with the OS module you can easily open, naviguate, etc. between files.

The work on pyFOAM is but an example of what you can do with python and openFOAM.
blais.bruno is offline   Reply With Quote

Old   July 12, 2015, 13:52
Default
  #3
Senior Member
 
Pete Bachant
Join Date: Jun 2012
Location: Boston, MA
Posts: 173
Rep Power: 13
pbachant is on a distinguished road
I have not used pyFoam, but Python in general is very good at working with text--quite a bit better than Matlab/Octave. Here's an example of a script I use to generate a dict with a large table of values, which is admittedly not optimized to take advantage of Python's advanced string formatting abilities: https://github.com/petebachant/UNH-R...dynmeshdict.py
__________________
Home | Twitter | GitHub
pbachant 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
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Community Contributions 25 March 6, 2017 10:03
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 05:18
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 12:24


All times are GMT -4. The time now is 02:31.