CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Installation on Windows, Mac and other Unsupported Platforms

PyFoam for Windows?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 23, 2012, 02:45
Default PyFoam for Windows?
  #1
New Member
 
Alex Roumanidakis
Join Date: Dec 2012
Posts: 1
Rep Power: 0
Vitterfolk is on a distinguished road
Hey guys, I'm new here so sorry if this has been asked before, but is it possible to install the PyFoam libraries on windows? I'm running the windows compatible version 1.5. I'm rather inexperienced with anything beyond the syntax and logic of programming (Haven't played much with command prompt or programming beyond matlab or lessons on code academy). I'm willing to do the research on installing libraries and stuff on my own, but I just wanted to know if linux was required prior to dumping a bunch of time on it. Thanks!
Vitterfolk is offline   Reply With Quote

Old   December 24, 2012, 11:24
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Alex and welcome to the forum!

PyFoam has been developed and tested to work on Linux and Mac OS X.

AFAIK, PyFoam on Windows is currently only available in blueCFD (http://www.bluecape.com.pt/blueCFD/ - I'm the guy responsible for blueCFD) and it is still very limited, in the sense that most of the functionalities will not work. We haven't made much more progress, due to the current workload we've had since its release nearly a year ago. Public release of the changes we've made so far is still pending internal review and approval at blueCAPE (which is where I work).

Anyway, the main problem is that there are several functions in Python that PyFoam uses that will only work out-of-the-box in POSIX systems, such as Linux and Mac.
For making it work on Windows, it's necessary to search for the Python libraries that can help replace the missing functions that the Python version for Windows doesn't have by default. And some of those missing functions might still have to be coded, in case the external libraries that have been found don't have them...

Best regards,
Bruno

PS: I've moved this thread to the sub-forum dedicated to Installation on Windows, Mac and other Unsupported Platforms
wyldckat is offline   Reply With Quote

Old   January 11, 2013, 14:23
Default
  #3
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings!

FYI, we've finally released the patches here: http://sourceforge.net/p/openfoam-ex...etspyfoam/166/

Best regards,
Bruno

Last edited by wyldckat; July 14, 2014 at 08:06. Reason: updated link to the new bug tracker
wyldckat is offline   Reply With Quote

Old   July 15, 2014, 06:50
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

I have some interesting updates on this topic. We at blueCAPE Lda (where I work) have created a new PyFoam repository at Github, dedicated to continuing the porting development of PyFoam to fully work on Windows: https://github.com/blueCFD/PyFoam

We made our first attempts to porting PyFoam to Windows back in 2011; later provided our modifications to the official PyFoam version in January 2013, which were introduced into PyFoam 0.6.0: www.cfd-online.com/Forums/openfoam-news-announcements-other/87114-new-release-pyfoam.html#post414040 - post #3

Unfortunately, the porting process was very incomplete back then and we haven't managed to pull any more efforts into porting PyFoam to Windows.
Therefore, we've started the project at Github yesterday, in hopes that this work can be continued by either ourselves or others.

The objective of this new repository at Github is to create a development environment for continuing the work that has been done so far: The very first release "PyFoam-Windows-0.6.3.tar.gz" is already available on the Releases page. For installing PyFoam 0.6.3 for Windows in blueCFD-Core, simply follow the instructions provided in the file "README.Windows".


A bug was already fixed today, but 3 are still open. Everyone is welcome to contribute!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 13, 2015, 09:02
Default pyFoam on windows
  #5
New Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 20
Rep Power: 6
fertinaz is on a distinguished road
Hi all,

Hopefully this is the correct place to create this thread. The question is about running pyFoamPlotWatcher on windows.

I did install pyFoam on a windows pc after a few hours of work. This is the project: https://github.com/blueCFD/PyFoam

Some minor modifications needed for a proper installation but it works fine. However when I try to see residuals & continuity plots following issue is exactly the problem I have: https://github.com/blueCFD/PyFoam/issues/3

Nothing appears when I run pyFoamPlotWatcher and it becomes visible for a second when Ctrl+C is hit then disappears again. You can see the attached file.

I would like to know if there any recommendations to cope with it.

Fatih.
Attached Images
File Type: jpg pyFoamErr.jpg (66.9 KB, 16 views)
fertinaz is offline   Reply With Quote

Old   January 13, 2015, 11:51
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Fatih,

I've moved your post from the post-processing forum to this thread, because this is a question specific to this port of PyFoam for Windows.

I need a few more details, in order to be able to help you:
  1. Which exact download package did you use and/or did you use "git clone"?
  2. Can you be more specific on the details regarding this statement:
    Quote:
    Originally Posted by fertinaz View Post
    Some minor modifications needed for a proper installation but it works fine.
    The smallest detail is more than enough to not have a working installation.
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 13, 2015, 14:48
Default
  #7
New Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 20
Rep Power: 6
fertinaz is on a distinguished road
Hello Bruno,

Thanks for your respond, this looks like a more appropriate location for this thread

The steps I followed in details:

1- Naturally I started with the installation of python. I decided to use version 2.7

2- Then downloaded the project zip file: https://github.com/blueCFD/PyFoam and extracted it in the OF folder I have on windows (this is the OF2.1 version ported by symscape)

3- Applied the commands written in README.windows which are
mkdir %WM_PROJECT_DIR%\etc\config.d\
xcopy contrib\Windows\PyFoam.* %WM_PROJECT_DIR%\etc\config.d\
call %WM_PROJECT_DIR%\etc\config.d\PyFoam.bat
.\winsetup.bat
These commands are run in the OpenFOAM command prompt

3- To successfully accomplish the installation I had to modify the winsetup.bat file in which the setup.py is called:
- python setup.py install --prefix="%PYFOAM_ARCH_PATH%"
+ C:\FullPathPython\python setup.py install --prefix="%PYFOAM_ARCH_PATH%"
Otherwise one should see the irritating msg: "python is not recognized as an internal or external command"

4- Had to install numpy. Downloaded numpy‑1.8.2‑cp27‑none‑win_amd64.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/ and installed it using pip.

5- Had to install gnuplot. Downloaded gp510-20141006-win64-mingw.exe.zip from http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/

6- After completing the gnuplot installation the full path for the gnuplot executable had to be written in PyFoam/PyFoam/ThirdParty/Gnuplot/gp_win32.py
- gnuplot_command = r'gnuplot.exe'
+ gnuplot_command = r'"C:\FullPathGnuplot\bin\gnuplot.exe"'
Note the "" here.

7- Run pyFoamPlotWatcher.bat with a sample log/simpleFoam.log

As far as I remember this must be it. I cannot check right now because I am not in the office at the moment but I guess these are the steps I followed today.

Thanks for your time.
fertinaz is offline   Reply With Quote

Old   January 13, 2015, 16:56
Default
  #8
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Fatih,

You didn't download the pre-release version "0.6.3-win" from here: https://github.com/blueCFD/PyFoam/releases - or did you?
Because if you downloaded that specific version, then that explains the problem.

Either way, please confirm if the changes indicated in this commit are present in your source code snapshot: https://github.com/blueCFD/PyFoam/co...5caf947bdf603c - because these changes are meant to be the ones that fix this problem you're having.

edit: I forgot to mention that I've only tested this with gnuplot 4.6 so far... using the binary package downloaded directly from the gnuplot's project at Sourceforge.net.

Best regards,
Bruno

Last edited by wyldckat; January 13, 2015 at 16:59. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   January 14, 2015, 03:54
Default
  #9
New Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 20
Rep Power: 6
fertinaz is on a distinguished road
Ok, so started from scratch.
1- Downloaded "0.6.3-win" from https://github.com/blueCFD/PyFoam/releases
2- Applied changes in the commit you mentioned above: winhacks.py, gp_win32.py and FoamThread.py
3- Downgraded to gnuplot 4.6.6
4- Removed existing ThirdParty folder and installed 0.6.3-win
5- Run pyFoamPlotWatcher.bat log.simpleFoam
6- Result: Please see attached file.

Would be it be that gnuplot cannot access to the log file because some other application invoked by pyfoam locks it at the same time? I am not sure though it is just a guess.
Attached Images
File Type: jpg pyFoamErr-new.jpg (99.2 KB, 15 views)
fertinaz is offline   Reply With Quote

Old   January 14, 2015, 18:28
Default
  #10
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Fatih,

Actually the "0.6.3-win" version is the one for which this feature you're trying to use will not work properly.
If you originally downloaded the one from the big "Download ZIP" button on the main page: https://github.com/blueCFD/PyFoam - then that is the latest code snapshot for this port. But even the latest version is still very experimental. I haven't been able to check properly what happens when I install this in another installation of blueCFD-Core on another machine. I'll try to look into this better either tomorrow or in the weekend.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 15, 2015, 06:34
Default
  #11
New Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 20
Rep Power: 6
fertinaz is on a distinguished road
Ok that was what I initially did, using the package comes by clicking "Download ZIP" button. The only difference between this version and the commit you mentioned is in the PyFoam/Execution/FoamThread.p

The code comes with the package is:
Code:
 if self.isWindows:
replaced with:
Code:
if uname()[0]=="Windows":
I tried both with gnuplot 5 and 4.6 but unfortunately did not seem to resolve the problem.

Many thanks for your time though. It would be nice if you can post here when you have a chance to dig deeper.
fertinaz is offline   Reply With Quote

Old   January 18, 2015, 14:37
Default
  #12
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Fatih,

OK, I've fixed a couple of additional issues. Please get the latest ZIP from https://github.com/blueCFD/PyFoam

Now it should no longer give the problem with "unlink" after Ctrl+C is pressed and it should be able to show the graphs without exiting immediately, nor locking up... although please do keep in mind that the "--persist" option does not work on Windows, due to a limitation in gnuplot/Windows, at least as far as I can figure out.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 20, 2015, 02:50
Default
  #13
New Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 20
Rep Power: 6
fertinaz is on a distinguished road
Hi Bruno, many thanks for your time and effort. It works fine now.

Have a nice day.

Last edited by fertinaz; January 20, 2015 at 02:50. Reason: - removed attached err pics
fertinaz is offline   Reply With Quote

Reply

Tags
openfoam, pyfoam, windows

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
pyFoam and paraview eelcovv OpenFOAM Paraview & paraFoam 27 February 3, 2015 17:38
Problems with PyFoam Christoph_84 OpenFOAM 30 May 8, 2014 04:35
pyFoam, pyFlu, extend: How does they relate? Horus OpenFOAM 9 May 21, 2011 12:49
pyFoam batch set up for OF 1.7 eelcovv OpenFOAM Running, Solving & CFD 3 January 19, 2011 09:38
pyFoam setting is not correct? or not compatible with 1.6? seasoul OpenFOAM 2 March 23, 2010 12:42


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