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

[Discussion]Should we create a GUI interface to OF utilities?[With Working prototype]

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 21, 2016, 05:41
Default [Discussion]Should we create a GUI interface to OF utilities?[With Working prototype]
  #1
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 18
chriss85 will become famous soon enough
I find that setting up long chains of commands can be rather tedious because one often needs to look up commands, check every step, manually put it in a script file for automation, make sure spelling is correct, and so on.

I think it would be relatively easy to create a simple GUI that offers an interface to the various command line programs contained in OpenFOAM. I even went so far to create a working prototype to illustrate this. The prototype will be described in the second post.

I have a few ideas, which I will put in a loose list here:
  • Make the GUI as modular as possible so that an interface for a command line program can be designed very easily without writing much code.
  • Provide selectors for regions, patches, sets, zones, fields, files and times from the current case. Possibly use pyFoam for this.
  • Add a backup function for reverting the applied options by copying the mesh and fields.
  • Track the executed commands to create a script file which can later be adjusted manually, or even save the complete GUI state so it can be restored. It is also necessary to cache the dictionaries that were used for each command so they don't need to be moved around manually.
  • Possible idea for later on: Integrate with paraview to automatically refresh the mesh after change and provide interactive selectors for positions, boxes, etc.
  • Possible idea for later on: Add an interface for editing configuration files and boundary conditions.
Unfortunately I don't have enough time to completely create this on my own, but I'm willing to work in a team of 2 or more people on it. I think it would be great to have a tool that can be used in combination with paraview for preprocessing. So basically I would like to hear if anyone is interested on working with me on this. Comments and further ideas are also appreciated. I realize there have been previous attempts at creating similar interfaces, so my plan is too keep it as simple as possible and only focus on functionality without spending much time on design.
chriss85 is offline   Reply With Quote

Old   October 21, 2016, 05:48
Default
  #2
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 18
chriss85 will become famous soon enough
I created a small prototype in a few hours to illustrate the concept.
The GUI is modular so that definition of a program can be done in a few lines like this:
Code:
class transformPoints(tool):
    options = [
        choiceOption(
                        "mode",
                        [
                            choiceItem("translate", "-translate", [vector("offset", XYZTEXT, VZERO)]),
                            choiceItem("scale", "-scale", [vector("factor", XYZTEXT, VONE)]),
                            choiceItem("rotate", "-rotate", [argumentTuple(vector("vector a", XYZTEXT, EX), vector("vector b", XYZTEXT, EY))]),
                            choiceItem("roll pitch yaw", "-rollPitchYaw", [vector("rotation vector", ["roll", "pitch", "yaw"], [90, 0, 0])]),
                            choiceItem("yaw pitch roll", "-yawPitchRoll", [vector("rotation vector", ["yaw", "pitch", "roll"], [90, 0, 0])])
                        ]
                    ),
        boolOption("rotate Fields", "-rotateFields", False)
    ]
    def __init__(self):
        super(transformPoints, self).__init__("transform mesh", "transformPoints", False)
I think it should be more or less self-explanatory.

Currently the GUI is very simple and looks like this:


The GUI is written in python with the tkinter module but for a real project we can use a different GUI framework if there are better suggestions.
Feel free to download the attached script and try it out yourself.
Attached Files
File Type: zip foamGUI.py.zip (4.0 KB, 6 views)

Last edited by chriss85; October 21, 2016 at 10:37.
chriss85 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
Setting rotating frame of referece. RPFigueiredo CFX 3 October 28, 2014 04:59
GETVAR Error in Multiband Monte Carlo Radiation Simulation with Directional Source silvan CFX 3 June 16, 2014 09:49
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
WARNING:''cannot create surface from sliding interface zone'' bahar FLUENT 12 March 22, 2013 15:03
Actuator disk model audrich FLUENT 0 September 21, 2009 07:06


All times are GMT -4. The time now is 11:50.